/**
 * HỆ THỐNG GIAO DIỆN TÙY CHỌN (THEME OPTIONS) - CỔNG BỔ TÚC KIẾN THỨC UEH
 * Thiết kế hiện đại theo nhận diện Đại học Kinh tế TP. Hồ Chí Minh (UEH)
 * 
 * Option 1: modern    - Hiện đại UEH Pro (Academic Pro, chuẩn đại học số)
 * Option 2: tech      - Tối giản Clean Tech (Sắc nét, tinh gọn kiểu Apple/Stripe)
 * Option 3: energetic - Năng động Neo Dynamic (Youthful, Gradient & Trẻ trung)
 * Option 0: classic   - Giao diện gốc truyền thống
 */

/* ==========================================================================
   0. THANH ĐIỀU KHIỂN CHUYỂN ĐỔI GIAO DIỆN (THEME SWITCHER BAR)
   ========================================================================== */
.ueh-theme-switcher {
    position: sticky;
    top: 10px;
    z-index: 1050;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.ueh-theme-switcher .switcher-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 95, 105, 0.2);
    box-shadow: 0 8px 30px rgba(0, 70, 78, 0.12);
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1020px;
    margin: 0 auto;
}

.ueh-theme-switcher .switcher-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #005f69;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ueh-theme-switcher .switcher-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ueh-theme-switcher .btn-theme {
    border: 1px solid #d8e3e5;
    background: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    line-height: 1.3;
}

.ueh-theme-switcher .btn-theme:hover {
    border-color: #005f69;
    color: #005f69;
    background: #eff5f6;
    transform: translateY(-1px);
}

.ueh-theme-switcher .btn-theme.active {
    background: #005f69;
    border-color: #005f69;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 95, 105, 0.28);
}

.ueh-theme-switcher .btn-theme[data-theme="tech"].active {
    background: #0f172a;
    border-color: #0f172a;
}

.ueh-theme-switcher .btn-theme[data-theme="energetic"].active {
    background: linear-gradient(135deg, #005f69 0%, #f26f33 100%);
    border-color: transparent;
}

.ueh-theme-switcher .btn-theme[data-theme="classic"].active {
    background: #475569;
    border-color: #475569;
}

/* ==========================================================================
   1. ĐỊNH NGHĨA BIẾN MÀU THEO TỪNG OPTION THEME
   ========================================================================== */

/* --- TÙY CHỌN 1: MODERN UEH PRO (Mặc định được khuyến nghị) --- */
body[data-ui-theme="modern"] {
    --theme-font: 'Plus Jakarta Sans', 'Be Vietnam Pro', -apple-system, sans-serif;
    --theme-bg: #f4f8f8;
    --theme-card-bg: #ffffff;
    --theme-primary: #005f69;       /* Xanh cổ vịt UEH */
    --theme-primary-dark: #00444b;  /* Deep Teal */
    --theme-primary-light: #e6f2f3; /* Light Teal Tint */
    --theme-accent: #f26f33;        /* Cam UEH năng động */
    --theme-accent-light: #fef0e9;
    --theme-text-main: #132729;
    --theme-text-muted: #5a7376;
    --theme-border: #d5e4e6;
    --theme-radius: 14px;
    --theme-card-radius: 16px;
    --theme-shadow: 0 10px 30px rgba(0, 70, 78, 0.07);
    --theme-shadow-hover: 0 16px 40px rgba(0, 70, 78, 0.12);
    --theme-focus-glow: 0 0 0 0.22rem rgba(0, 95, 105, 0.18);
}

/* --- TÙY CHỌN 2: MINIMALIST CLEAN TECH --- */
body[data-ui-theme="tech"] {
    --theme-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --theme-bg: #f8fafc;
    --theme-card-bg: #ffffff;
    --theme-primary: #00383f;       /* Deep Pine */
    --theme-primary-dark: #002227;
    --theme-primary-light: #e0f2fe;
    --theme-accent: #0d9488;        /* Teal Cyan */
    --theme-accent-light: #f0fdfa;
    --theme-text-main: #0f172a;
    --theme-text-muted: #64748b;
    --theme-border: #cbd5e1;
    --theme-radius: 8px;
    --theme-card-radius: 12px;
    --theme-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    --theme-shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
    --theme-focus-glow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}

/* --- TÙY CHỌN 3: NEO DYNAMIC & YOUTHFUL UEH --- */
body[data-ui-theme="energetic"] {
    --theme-font: 'Outfit', 'Be Vietnam Pro', sans-serif;
    --theme-bg: #eef5f6;
    --theme-card-bg: #ffffff;
    --theme-primary: #006c78;
    --theme-primary-dark: #004b54;
    --theme-primary-light: #e3f4f6;
    --theme-accent: #ff6e40;        /* Vivid Coral Orange */
    --theme-accent-light: #fff3ee;
    --theme-text-main: #11282c;
    --theme-text-muted: #4e6c71;
    --theme-border: #cee1e4;
    --theme-radius: 20px;
    --theme-card-radius: 22px;
    --theme-shadow: 0 14px 38px rgba(0, 80, 90, 0.09);
    --theme-shadow-hover: 0 20px 48px rgba(0, 80, 90, 0.16);
    --theme-focus-glow: 0 0 0 0.25rem rgba(0, 108, 120, 0.2);
}

/* ==========================================================================
   2. QUY TẮC CSS ÁP DỤNG CHUNG CHO CÁC OPTION MỚI (!classic)
   ========================================================================== */
body[data-ui-theme="modern"],
body[data-ui-theme="tech"],
body[data-ui-theme="energetic"] {
    background-color: var(--theme-bg) !important;
    font-family: var(--theme-font) !important;
    color: var(--theme-text-main) !important;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Container chính */
body[data-ui-theme="modern"] .form-container,
body[data-ui-theme="tech"] .form-container,
body[data-ui-theme="energetic"] .form-container {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-width: 1040px;
    margin: 0 auto 60px auto !important;
}

/* Banner Tiêu đề Trang (Page Hero Header) */
body[data-ui-theme="modern"] .form-header,
body[data-ui-theme="tech"] .form-header,
body[data-ui-theme="energetic"] .form-header {
    background: var(--theme-card-bg);
    border-radius: var(--theme-card-radius);
    padding: 34px 30px 28px 30px;
    box-shadow: var(--theme-shadow);
    border: 1px solid var(--theme-border);
    margin-bottom: 24px;
    border-bottom: 4px solid var(--theme-primary) !important;
    position: relative;
    overflow: hidden;
}

body[data-ui-theme="energetic"] .form-header {
    background: linear-gradient(135deg, #005f69 0%, #008793 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

body[data-ui-theme="energetic"] .form-header h1 {
    color: #ffffff !important;
}

body[data-ui-theme="energetic"] .form-header .header-sub {
    color: rgba(255, 255, 255, 0.88) !important;
}

body[data-ui-theme="modern"] .form-header h1,
body[data-ui-theme="tech"] .form-header h1 {
    color: var(--theme-primary) !important;
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: -0.02em;
    margin-top: 14px;
    margin-bottom: 6px;
}

body[data-ui-theme="modern"] .form-header img,
body[data-ui-theme="tech"] .form-header img,
body[data-ui-theme="energetic"] .form-header img {
    max-width: 155px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

body[data-ui-theme="energetic"] .form-header img {
    background: #ffffff;
    padding: 8px 14px;
    border-radius: 12px;
}

/* Phân khối Thẻ Bước (Section Cards) */
body[data-ui-theme="modern"] .form-section-card,
body[data-ui-theme="tech"] .form-section-card,
body[data-ui-theme="energetic"] .form-section-card {
    background: var(--theme-card-bg);
    border-radius: var(--theme-card-radius);
    border: 1px solid var(--theme-border);
    box-shadow: var(--theme-shadow);
    padding: 28px 30px;
    margin-bottom: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

body[data-ui-theme="modern"] .form-section-card:hover,
body[data-ui-theme="tech"] .form-section-card:hover,
body[data-ui-theme="energetic"] .form-section-card:hover {
    box-shadow: var(--theme-shadow-hover);
    border-color: #bcd7db;
}

/* Tiêu đề từng thẻ bước (Section Card Header) */
.section-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--theme-border);
}

.section-card-header .step-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    font-weight: 800;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body[data-ui-theme="energetic"] .section-card-header .step-badge {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%);
    color: #ffffff;
}

.section-card-header .step-title h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--theme-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.section-card-header .step-title p {
    font-size: 0.82rem;
    color: var(--theme-text-muted);
    margin: 3px 0 0 0;
}

/* Tùy chỉnh nhãn & ô nhập liệu (Labels & Inputs) */
body[data-ui-theme="modern"] .form-label,
body[data-ui-theme="tech"] .form-label,
body[data-ui-theme="energetic"] .form-label {
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    color: var(--theme-text-main) !important;
    margin-bottom: 6px !important;
}

body[data-ui-theme="modern"] .form-control,
body[data-ui-theme="tech"] .form-control,
body[data-ui-theme="energetic"] .form-control,
body[data-ui-theme="modern"] .form-select,
body[data-ui-theme="tech"] .form-select,
body[data-ui-theme="energetic"] .form-select {
    border-radius: var(--theme-radius) !important;
    border: 1px solid var(--theme-border) !important;
    padding: 10px 14px !important;
    font-size: 0.92rem !important;
    color: var(--theme-text-main) !important;
    background-color: #ffffff !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body[data-ui-theme="modern"] .form-control:focus,
body[data-ui-theme="tech"] .form-control:focus,
body[data-ui-theme="energetic"] .form-control:focus,
body[data-ui-theme="modern"] .form-select:focus,
body[data-ui-theme="tech"] .form-select:focus,
body[data-ui-theme="energetic"] .form-select:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: var(--theme-focus-glow) !important;
    outline: none !important;
}

/* Thẻ văn bằng 1 & 2 (Degree Cards) */
body[data-ui-theme="modern"] .degree-card-box,
body[data-ui-theme="tech"] .degree-card-box,
body[data-ui-theme="energetic"] .degree-card-box {
    background: #fafcfc !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: var(--theme-radius) !important;
    padding: 22px !important;
    height: 100%;
}

body[data-ui-theme="modern"] .degree-card-box.degree-primary {
    border-top: 3px solid var(--theme-primary) !important;
}

body[data-ui-theme="modern"] .degree-card-box.degree-secondary {
    border-top: 3px solid var(--theme-text-muted) !important;
}

/* Vùng chọn Môn học tương tác (Interactive Course Selector) */
body[data-ui-theme="modern"] .custom-check-item,
body[data-ui-theme="tech"] .custom-check-item,
body[data-ui-theme="energetic"] .custom-check-item {
    border: 1.5px solid var(--theme-border) !important;
    border-radius: var(--theme-radius) !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    margin-bottom: 10px !important;
    overflow: hidden;
    position: relative;
}

body[data-ui-theme="modern"] .custom-check-item:hover,
body[data-ui-theme="tech"] .custom-check-item:hover,
body[data-ui-theme="energetic"] .custom-check-item:hover {
    border-color: var(--theme-primary) !important;
    background: var(--theme-primary-light) !important;
    transform: translateY(-1px);
}

body[data-ui-theme="modern"] .custom-check-item.is-selected,
body[data-ui-theme="tech"] .custom-check-item.is-selected,
body[data-ui-theme="energetic"] .custom-check-item.is-selected {
    border-color: var(--theme-primary) !important;
    background: #f1f8f9 !important;
    box-shadow: 0 2px 8px rgba(0, 95, 105, 0.12) !important;
}

body[data-ui-theme="modern"] .custom-check-item .form-check-input,
body[data-ui-theme="tech"] .custom-check-item .form-check-input,
body[data-ui-theme="energetic"] .custom-check-item .form-check-input {
    width: 20px;
    height: 20px;
    margin-left: 14px !important;
    cursor: pointer;
    border-color: #9cb8bc;
}

body[data-ui-theme="modern"] .custom-check-item .form-check-input:checked,
body[data-ui-theme="tech"] .custom-check-item .form-check-input:checked,
body[data-ui-theme="energetic"] .custom-check-item .form-check-input:checked {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

/* Đơn giá & tín chỉ của môn học */
.course-meta-badge {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--theme-primary);
    background: var(--theme-primary-light);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-left: auto;
}

/* Hộp Tóm tắt Học phí Tạm tính (Live Tuition Summary Box) */
.tuition-summary-box {
    background: var(--theme-primary-light);
    border: 1px solid #b7d7dc;
    border-radius: var(--theme-radius);
    padding: 14px 20px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

body[data-ui-theme="tech"] .tuition-summary-box {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body[data-ui-theme="energetic"] .tuition-summary-box {
    background: linear-gradient(135deg, #e4f5f7 0%, #fff0ea 100%);
    border-color: #b0dfe6;
}

.tuition-summary-box .summary-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--theme-text-main);
}

.tuition-summary-box .summary-total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--theme-primary);
    letter-spacing: -0.02em;
}

body[data-ui-theme="energetic"] .tuition-summary-box .summary-total {
    color: #e65100;
}

/* Nút Submit chính (GỬI HỒ SƠ) */
body[data-ui-theme="modern"] #submitButton,
body[data-ui-theme="tech"] #submitButton,
body[data-ui-theme="energetic"] #submitButton {
    background-color: var(--theme-primary) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    letter-spacing: 0.04em !important;
    padding: 14px 38px !important;
    border-radius: 50px !important;
    box-shadow: 0 6px 20px rgba(0, 95, 105, 0.28) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body[data-ui-theme="modern"] #submitButton:hover,
body[data-ui-theme="tech"] #submitButton:hover,
body[data-ui-theme="energetic"] #submitButton:hover {
    background-color: var(--theme-primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 26px rgba(0, 95, 105, 0.36) !important;
}

body[data-ui-theme="energetic"] #submitButton {
    background: linear-gradient(135deg, #005f69 0%, #f26f33 100%) !important;
}

body[data-ui-theme="energetic"] #submitButton:hover {
    background: linear-gradient(135deg, #004d55 0%, #dd581c 100%) !important;
}

/* Captcha Box tinh gọn */
body[data-ui-theme="modern"] .captcha-group-box,
body[data-ui-theme="tech"] .captcha-group-box,
body[data-ui-theme="energetic"] .captcha-group-box {
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    padding: 10px 14px;
}

/* ==========================================================================
   3. TÙY CHỌN 0: GIAO DIỆN GỐC (CLASSIC)
   ========================================================================== */
body[data-ui-theme="classic"] .form-section-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
}

body[data-ui-theme="classic"] .section-card-header {
    display: none !important;
}

body[data-ui-theme="classic"] .tuition-summary-box {
    display: none !important;
}

body[data-ui-theme="classic"] .course-meta-badge {
    display: none !important;
}

/* ==========================================================================
   4. TỐI ƯU GIAO DIỆN TRÊN DI ĐỘNG (RESPONSIVE MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
    .ueh-theme-switcher {
        position: static;
        margin-bottom: 16px;
    }
    
    .ueh-theme-switcher .switcher-inner {
        border-radius: 16px;
        padding: 10px 14px;
        justify-content: center;
    }
    
    .ueh-theme-switcher .switcher-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .ueh-theme-switcher .btn-theme {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    body[data-ui-theme="modern"] .form-header,
    body[data-ui-theme="tech"] .form-header,
    body[data-ui-theme="energetic"] .form-header {
        padding: 22px 18px;
    }

    body[data-ui-theme="modern"] .form-section-card,
    body[data-ui-theme="tech"] .form-section-card,
    body[data-ui-theme="energetic"] .form-section-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .tuition-summary-box {
        flex-direction: column;
        align-items: flex-start;
    }
}
