/*
 * Anket Oluşturma Sistemi - Custom CSS
 * Survey Builder System Custom Styles
 */

/* Question Card Animations */
.card[data-question-id] {
    transition: all 0.3s ease-in-out;
    border: 1px solid #e4e6ef;
}

.card[data-question-id]:hover {
    box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.075);
    transform: translateY(-2px);
}

/* Question Type Selection Cards */
.btn-outline.btn-outline-dashed {
    transition: all 0.2s ease-in-out;
}

.btn-outline.btn-outline-dashed:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.btn-outline.btn-outline-dashed.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.btn-outline.btn-outline-dashed.active i {
    color: white !important;
}

/* Option Input Animations */
.d-flex.align-items-center.mb-3 {
    transition: all 0.2s ease-in-out;
}

.d-flex.align-items-center.mb-3:hover {
    background-color: #f8f9fa;
    border-radius: 0.475rem;
    padding: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

/* Add Option Button Styling */
.btn-light-primary {
    transition: all 0.2s ease-in-out;
}

.btn-light-primary:hover {
    transform: translateY(-1px);
}

/* Remove Button Hover Effects */
.btn-color-danger:hover {
    transform: scale(1.1);
    transition: all 0.2s ease-in-out;
}

/* Form Control Focus Effects */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Question Counter Badge */
.question-counter {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Survey Form Header */
.survey-header {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e4e6ef;
}

/* Question Type Icons */
.question-type-icon {
    transition: all 0.3s ease-in-out;
}

.btn-outline:hover .question-type-icon {
    transform: scale(1.1);
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.475rem;
    z-index: 10;
}

/* Success States */
.success-highlight {
    border-color: var(--bs-success) !important;
    background-color: rgba(var(--bs-success-rgb), 0.1) !important;
}

/* Error States */
.error-highlight {
    border-color: var(--bs-danger) !important;
    background-color: rgba(var(--bs-danger-rgb), 0.1) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card-header .card-toolbar {
        margin-top: 1rem;
    }
    
    .d-flex.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .d-flex.align-items-center.mb-3 .form-check {
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
    
    .d-flex.align-items-center.mb-3 .form-control {
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
    
    .question-type-selection .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
[data-bs-theme="dark"] .card[data-question-id]:hover {
    box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(255, 255, 255, 0.075);
}

[data-bs-theme="dark"] .d-flex.align-items-center.mb-3:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Custom Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Question Drag and Drop (Future Enhancement) */
.question-drag-handle {
    cursor: move;
    color: #a1a5b7;
    transition: color 0.2s ease-in-out;
}

.question-drag-handle:hover {
    color: var(--bs-primary);
}

/* Survey Preview Styles */
.survey-preview {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-top: 2rem;
}

.survey-preview .form-control,
.survey-preview .form-select {
    background-color: white;
    border: 1px solid #d1d3e0;
}

.survey-preview .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Settings Modal Styles */
.modal-dialog.mw-750px {
    max-width: 750px;
}

.modal-body h4 {
    border-bottom: 1px solid #e4e6ef;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Settings Dropdown */
.dropdown-menu {
    border: 1px solid #e4e6ef;
    box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.075);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.dropdown-item i {
    color: var(--bs-primary);
}

/* Color Picker Styles */
.form-control-color {
    width: 50px !important;
    height: 38px;
    border: 1px solid #d1d3e0;
    border-radius: 0.475rem;
    cursor: pointer;
}

.color-option {
    transition: all 0.2s ease-in-out;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Access Control Styles */
.form-check-label .fw-semibold {
    color: #181c32;
}

.form-check-label .text-muted {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Settings Form Sections */
.settings-section {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e4e6ef;
}

.settings-section h4 {
    color: #181c32;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

/* User Selection Multi-select */
select[multiple] {
    min-height: 120px;
}

/* Settings Modal Animation */
.modal.fade .modal-dialog {
    transform: translate(0, -50px);
    transition: all 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
}

/* Settings Toggle Switches */
.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    background-image: none;
    background-color: #e4e6ef;
    border: none;
}

.form-switch .form-check-input:checked {
    background-color: var(--bs-primary);
}

/* Settings Cards */
.settings-card {
    background: white;
    border: 1px solid #e4e6ef;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease-in-out;
}

.settings-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Datetime Input Styling */
input[type="datetime-local"] {
    position: relative;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    color: var(--bs-primary);
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

/* Settings Success State */
.settings-success {
    background: rgba(80, 205, 137, 0.1);
    border-color: #50cd89;
    color: #0f5132;
}

/* Settings Warning State */
.settings-warning {
    background: rgba(255, 199, 0, 0.1);
    border-color: #ffc700;
    color: #664d03;
}

/* Settings Error State */
.settings-error {
    background: rgba(241, 65, 108, 0.1);
    border-color: #f1416c;
    color: #842029;
}

/* Question Type Modal Steps */
.question-step {
    transition: all 0.3s ease-in-out;
}

.question-step.d-none {
    opacity: 0;
    transform: translateX(20px);
}

/* Rating Container Styles */
.rating-container {
    border: 2px dashed var(--bs-primary);
    transition: all 0.3s ease-in-out;
}

.rating-container:hover {
    border-style: solid;
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.rating-preview .form-check-input {
    pointer-events: none;
}

.rating-preview .form-check-label {
    cursor: default;
}

/* Multiple Choice Type Selection */
.btn-active-light-success.active {
    background-color: rgba(80, 205, 137, 0.1);
    border-color: #50cd89;
    color: #0f5132;
}

/* Rating Question Styles */
.rating-container .form-check {
    padding: 0.75rem;
    border-radius: 0.475rem;
    transition: all 0.2s ease-in-out;
}

.rating-container .form-check:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.rating-container .form-check-input:checked + .form-check-label {
    font-weight: 700;
}

.rating-container .badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
    margin-right: 0.5rem;
}

/* Question Type Icons */
.question-type-icon {
    transition: all 0.3s ease-in-out;
}

.btn-outline:hover .question-type-icon {
    transform: scale(1.15);
}

/* Back Button Styles */
.btn-light-secondary {
    background-color: #f8f9fa;
    border-color: #e4e6ef;
    color: #7e8299;
}

.btn-light-secondary:hover {
    background-color: #e4e6ef;
    border-color: #d1d3e0;
    color: #5e6278;
}

/* Mobile Responsive for Rating */
@media (max-width: 768px) {
    .rating-container .d-flex {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .rating-container .form-check {
        text-align: center;
        width: 100%;
    }
}

/* Checkbox vs Radio Visual Differences */
.form-check-input[type="checkbox"] {
    border-radius: 0.375rem;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

/* Question Type Step Animations */
.question-step {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-step:not(.d-none) {
    animation-name: stepSlideIn;
}

/* Enhanced Question Counter */
.question-counter {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.25);
}

/* Multi Input Styles */
.multi-input-field {
    background: rgba(var(--bs-light-rgb), 0.5);
    border-radius: 0.475rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.multi-input-field:hover {
    background: rgba(var(--bs-primary-rgb), 0.05);
    transform: translateX(5px);
}

.multi-input-field .field-label,
.multi-input-field .field-placeholder {
    border: 1px solid #e1e3ea;
}

.multi-input-field .field-label:focus,
.multi-input-field .field-placeholder:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
}

/* Multi Input Preview */
.bg-light-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    border: 1px dashed var(--bs-primary);
}

.bg-light-success {
    background-color: rgba(var(--bs-success-rgb), 0.1) !important;
    border: 1px solid rgba(var(--bs-success-rgb), 0.3);
}

/* Multi Input Field Types */
.field-type {
    font-size: 0.875rem;
}

.field-required + .form-check-label {
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Multi Input Question Display */
.multi-input-question .form-control[disabled] {
    background-color: #f8f9fa;
    border-color: #e4e6ef;
    color: #7e8299;
}

/* Responsive Multi Input */
@media (max-width: 768px) {
    .multi-input-field {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .multi-input-field > div {
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    .multi-input-field .w-100px,
    .multi-input-field .w-80px {
        width: 100% !important;
    }
    
    .multi-input-field .flex-grow-1 {
        flex-grow: 0 !important;
    }
}

/* Multi Input Animation */
@keyframes multiInputSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.multi-input-field {
    animation: multiInputSlideIn 0.3s ease-out;
}

/* Multi Input Field Icons */
.multi-input-field .form-select::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='m0 0 4 0 0 1-4 0zm0 2 4 0 0 1-4 0zm0 2 4 0 0 1-4 0z'/%3E%3C/svg%3E") no-repeat center;
}

/* Success State for Multi Input */
.multi-input-success .bg-light-success {
    background-color: rgba(var(--bs-success-rgb), 0.2) !important;
    border-color: var(--bs-success);
}

.multi-input-success .form-control {
    border-color: var(--bs-success);
}

/* Multi Input Info Box */
.multi-input-info {
    background: linear-gradient(135deg, rgba(var(--bs-info-rgb), 0.1), rgba(var(--bs-primary-rgb), 0.05));
    border: 1px solid rgba(var(--bs-info-rgb), 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
}

.multi-input-info i {
    font-size: 1.25rem;
}

/* Sortable Drag & Drop Styles */
.question-drag-handle {
    cursor: grab;
    color: #a1a5b7;
    transition: all 0.2s ease-in-out;
}

.question-drag-handle:hover {
    color: var(--bs-primary);
    transform: scale(1.1);
}

.question-drag-handle:active {
    cursor: grabbing;
}

/* Sortable States */
.sortable-ghost {
    opacity: 0.3;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border: 2px dashed var(--bs-primary);
    transform: rotate(2deg);
}

.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 1rem 3rem rgba(var(--bs-dark-rgb), 0.175);
    z-index: 1000;
}

.sortable-drag {
    transform: rotate(5deg);
    opacity: 0.8;
}

/* Container States */
.is-dragging {
    background: rgba(var(--bs-primary-rgb), 0.02);
    border-radius: 0.75rem;
}

.is-dragging .card[data-question-id]:not(.sortable-chosen) {
    transition: all 0.3s ease;
    opacity: 0.7;
}

/* Drag Handle Animation */
@keyframes dragPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.question-drag-handle:hover {
    animation: dragPulse 1s infinite;
}

/* Question Reorder Animation */
.card[data-question-id] {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card[data-question-id]:hover .question-drag-handle {
    color: var(--bs-primary);
}

/* Drop Zone Indicator */
.sortable-ghost::before {
    content: "Buraya bırakın";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bs-primary);
    font-weight: 600;
    font-size: 1.1rem;
    z-index: 10;
}

/* Mobile Drag Handle */
@media (max-width: 768px) {
    .question-drag-handle {
        font-size: 1.5rem;
        padding: 0.5rem;
    }
    
    .sortable-chosen {
        transform: scale(1.05);
    }
}

/* Drag Success Animation */
@keyframes dragSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(var(--bs-success-rgb), 0.3);
    }
    100% {
        transform: scale(1);
    }
}

.drag-success {
    animation: dragSuccess 0.6s ease-out;
}
