/* Teacher Evaluation Survey UI/UX - Theme Color: #49506e */

/* Variables */
:root {
    --te-primary: #49506e;
    --te-primary-light: #5a6280;
    --te-primary-dark: #3d4459;
    --te-primary-alpha: rgba(73, 80, 110, 0.1);
    --te-primary-alpha-light: rgba(73, 80, 110, 0.05);
    --te-success: #28a745;
    --te-border: #e9ecef;
    --te-border-light: #f1f3f5;
    --te-bg-light: #fafbfc;
    --te-shadow: 0 2px 8px rgba(73, 80, 110, 0.08);
    --te-shadow-hover: 0 4px 16px rgba(73, 80, 110, 0.12);
}

/* Layout */
#ev-questionnaire-container {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid var(--te-border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--te-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--te-primary) 0%, var(--te-primary-light) 100%);
    border-radius: 16px 16px 0 0;
}

.category:hover {
    box-shadow: var(--te-shadow-hover);
    transform: translateY(-2px);
}

.category-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--te-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-heading::before {
    content: '●';
    color: var(--te-primary);
    font-size: 0.8rem;
}

/* Question */
.teq-question {
    border: 1px solid var(--te-border-light);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(73, 80, 110, 0.04);
}

.teq-question:hover {
    border-color: var(--te-primary-alpha);
    box-shadow: 0 2px 8px rgba(73, 80, 110, 0.08);
}

.teq-q-header {
    width: 100%;
    text-align: start;
    background: linear-gradient(135deg, var(--te-bg-light) 0%, #ffffff 100%);
    border: 0;
    outline: none;
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.3s ease;
    color: var(--te-primary-dark);
}

.teq-q-header:hover {
    background: linear-gradient(135deg, var(--te-primary-alpha-light) 0%, var(--te-primary-alpha) 100%);
    color: var(--te-primary);
}

.teq-q-header:focus {
    box-shadow: inset 0 0 0 2px var(--te-primary-alpha);
}

.teq-q-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.teq-q-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--te-primary) 0%, var(--te-primary-light) 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(73, 80, 110, 0.2);
    transition: all 0.3s ease;
}

.teq-q-header:hover .teq-q-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(73, 80, 110, 0.3);
}

.teq-q-toggle-icon {
    transition: all 0.3s ease;
    color: var(--te-primary);
    font-size: 14px;
    font-weight: bold;
}

.teq-q-header[aria-expanded="true"] .teq-q-toggle-icon {
    transform: rotate(180deg);
    color: var(--te-primary-light);
}

.teq-q-body {
    display: none;
    padding: 20px 24px;
    background: #ffffff;
    border-top: 1px solid var(--te-border-light);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

.teq-q-body.active {
    display: block;
}

/* Radios row */
.teq-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: flex-start;
}

/* Custom radio */
.teq-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    background: var(--te-bg-light);
    border: 1px solid var(--te-border);
}

.teq-option:hover {
    background: var(--te-primary-alpha-light);
    border-color: var(--te-primary-alpha);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(73, 80, 110, 0.1);
}

.teq-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--te-border);
    outline: none;
    position: relative;
    transition: all 0.3s ease;
    background: #ffffff;
}

.teq-option input[type="radio"]:hover {
    border-color: var(--te-primary-light);
    box-shadow: 0 0 0 4px var(--te-primary-alpha-light);
}

.teq-option input[type="radio"]:checked {
    border-color: var(--te-primary);
    background: var(--te-primary);
    box-shadow: 0 0 0 4px var(--te-primary-alpha);
}

.teq-option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 50%;
    animation: radioCheck 0.2s ease-out;
}

@keyframes radioCheck {
    from {
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.teq-option span {
    font-weight: 600;
    color: var(--te-primary-dark);
    transition: color 0.3s ease;
}

.teq-option:hover span {
    color: var(--te-primary);
}

.teq-option input[type="radio"]:checked + span {
    color: var(--te-primary);
}

/* Selection section enhancements */
.section-title {
    color: var(--te-primary);
    border-bottom: 2px solid var(--te-primary-alpha);
    padding-bottom: 8px;
    margin-bottom: 20px !important;
}

.muted {
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

/* Form enhancements */
.form-control:focus {
    border-color: var(--te-primary);
    box-shadow: 0 0 0 0.2rem var(--te-primary-alpha);
}

/* Submit Button with Theme Colors */
.btn-success.custom-btn,
#ev-submit-btn {
    background: linear-gradient(135deg, var(--te-primary) 0%, var(--te-primary-light) 100%);
    border-color: var(--te-primary);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(73, 80, 110, 0.2);
}

.btn-success.custom-btn:hover,
#ev-submit-btn:hover {
    background: linear-gradient(135deg, var(--te-primary-dark) 0%, var(--te-primary) 100%);
    border-color: var(--te-primary-dark);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(73, 80, 110, 0.3);
}

.btn-success.custom-btn:active,
#ev-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(73, 80, 110, 0.2);
}

.btn-success.custom-btn:focus,
#ev-submit-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(73, 80, 110, 0.25);
}

.btn-success.custom-btn svg,
#ev-submit-btn svg {
    transition: transform 0.3s ease;
}

.btn-success.custom-btn:hover svg,
#ev-submit-btn:hover svg {
    transform: translateX(2px);
}

/* Loading states */
.select2-container--default .select2-selection--single:focus {
    border-color: var(--te-primary);
    box-shadow: 0 0 0 0.2rem var(--te-primary-alpha);
}


/* Responsive */
@media (max-width: 768px) {
    .category {
        padding: 16px 20px;
        margin-bottom: 16px;
    }

    .teq-q-header {
        padding: 12px 16px;
    }

    .teq-q-body {
        padding: 16px 20px;
    }

    .teq-radios {
        gap: 8px 12px;
    }

    .teq-option {
        padding: 6px 10px;
    }
}

/* RTL support */
html[dir="rtl"] .teq-q-header {
    text-align: right;
}

html[dir="rtl"] .teq-q-title {
    flex-direction: row-reverse;
}

html[dir="rtl"] .teq-radios {
    justify-content: flex-start;
}

html[dir="rtl"] .category-heading::before {
    order: 1;
}

/* Full page layout enhancements */
.page-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 20px 0;
}

.te-page-header {
    background: linear-gradient(135deg, #49506e 0%, #5a6280 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px rgba(73, 80, 110, 0.15);
}

.te-page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.te-page-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.te-page-subtitle {
    margin: 8px 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.te-main-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(73, 80, 110, 0.1);
    overflow: hidden;
    border: 1px solid rgba(73, 80, 110, 0.1);
}

.te-selection-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.te-form-section {
    padding: 30px;
}


.te-dropdown-group {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.te-dropdown-group:hover {
    box-shadow: 0 4px 12px rgba(73, 80, 110, 0.08);
    border-color: rgba(73, 80, 110, 0.2);
}

.te-dropdown-group.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.custom-btn {
    min-width: 140px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

fieldset:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.section-title {
    color: #49506e;
    border-bottom: 2px solid rgba(73, 80, 110, 0.1);
    padding-bottom: 8px;
    margin-bottom: 20px !important;
    font-weight: 700;
}

.muted {
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}


/* Responsive */
@media (max-width: 768px) {
    .te-page-title {
        font-size: 1.5rem;
    }

    .te-selection-section,
    .te-form-section {
        padding: 20px;
    }

    .te-step-indicator {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Hide only the Subject icon in the filter labels of Teacher Evaluation page */
#subject-group .form-label i {
    display: none !important;
}