:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-hover: linear-gradient(135deg, #5558e3 0%, #7c4ee8 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    
    /* Legacy variables for compatibility */
    --primary-color: #6366f1;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary-color: #10B981;
    --accent-color: #F59E0B;
    --danger-color: #EF4444;
    --background-color: #f8fafc;
    --card-bg: #FFFFFF;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #9CA3AF;
    --border-color: #e2e8f0;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary: #818cf8;
    --secondary: #a78bfa;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --dark: #ffffff;
    --light: #1a1a1a;
    --white: #2d2d2d;
    --gray: #d1d5db;
    --gray-light: #404040;
    --background-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #404040;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    
    /* Legacy variables for dark mode */
    --primary-color: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --secondary-color: #34d399;
    --accent-color: #fbbf24;
    --danger-color: #f87171;
    
    /* Additional dark mode variables for new components */
    --notification-bg: #2d2d2d;
    --notification-border: #404040;
    --notification-hover: rgba(129, 140, 248, 0.05);
    --notification-unread: rgba(129, 140, 248, 0.1);
    --question-bg: #2d2d2d;
    --question-border: #404040;
    --answer-hover: rgba(129, 140, 248, 0.1);
    --answer-selected: rgba(129, 140, 248, 0.15);
    --offcanvas-bg: #2d2d2d;
    --modal-bg: #2d2d2d;
    --input-bg: #2d2d2d;
    --input-border: #404040;
    --input-focus: #818cf8;
}

/* Dark mode for Bootstrap classes */
[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .lead {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-decoration-none {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
}

/* Sidebar Dark Mode - Specific Styles */
[data-theme="dark"] .sidebar-menu {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-nav {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item {
    color: var(--text-primary) !important;
    background: transparent !important;
}

[data-theme="dark"] .sidebar-nav .nav-item span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item i {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item:hover {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item:hover span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item:hover i {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item.active {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.1) 0%, transparent 100%) !important;
    color: var(--primary-color) !important;
    border-left: 4px solid var(--primary-color) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item.active span {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .sidebar-nav .nav-item.active i {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .nav-divider {
    background: var(--border-color) !important;
}

/* Global dark mode text colors */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
    color: var(--text-primary);
}

[data-theme="dark"] small {
    color: var(--text-muted) !important;
}

[data-theme="dark"] a:not(.btn) {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .fs-5 {
    color: var(--primary-color) !important;
}

/* Auth Forms Dark Mode */
[data-theme="dark"] .form-control {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1) !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .form-label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .auth-container {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .auth-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .auth-subtitle {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .auth-footer {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .auth-footer a {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .alert {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(248, 113, 113, 0.1) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(52, 211, 153, 0.1) !important;
    color: var(--success) !important;
    border-color: var(--success) !important;
}

[data-theme="dark"] .form-text {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .invalid-feedback {
    color: var(--danger) !important;
}

[data-theme="dark"] .is-invalid {
    border-color: var(--danger) !important;
}

[data-theme="dark"] .btn-primary {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

[data-theme="dark"] .btn-secondary {
    background: var(--text-secondary) !important;
    border-color: var(--text-secondary) !important;
    color: var(--card-bg) !important;
}

[data-theme="dark"] .btn-light {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-light:hover {
    background: var(--background-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Logo Dark Mode - Keep Primary Color */
[data-theme="dark"] .logo-mini {
    color: var(--primary) !important;
}

[data-theme="dark"] .logo-mini i {
    color: var(--primary) !important;
}

[data-theme="dark"] .logo-mini span {
    color: var(--primary) !important;
}

[data-theme="dark"] .logo-text {
    color: var(--primary) !important;
}

/* Profile Dropdown Dark Mode */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item i {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-color) !important;
}

/* Dropdown Menu Positioning and Style */
[data-theme="dark"] .dropdown-menu-end {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .dropdown-toggle::after {
    border-top-color: var(--text-primary) !important;
}

/* Dropdown item active state */
[data-theme="dark"] .dropdown-item.active,
[data-theme="dark"] .dropdown-item:active {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
}









* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mobile-app {
    max-width: 500px;
    margin: 0 auto;
    background: var(--card-bg);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
    transition: background-color 0.3s ease;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--card-bg);
    position: relative;
    padding-bottom: 80px;
    transition: background-color 0.3s ease;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--card-bg);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left {
    width: 44px;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.profile-btn, .notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.profile-btn:hover, .menu-btn:hover, .notification-btn:hover {
    background: var(--background-color);
    color: var(--text-primary);
    transform: scale(1.05);
}

.notification-badge, .notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--primary);
    font-size: 28px;
}

.logo-mini i {
    font-size: 32px;
}

.app-content {
    padding: 16px;
    padding-bottom: 100px;
    min-height: calc(100vh - 140px);
}

.messages-container {
    margin-bottom: 16px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 24px 24px 0 0;
    z-index: 1000; /* Higher than content sections */
    transition: background-color 0.3s ease;
}

/* Dark mode for bottom nav */
[data-theme="dark"] .bottom-nav {
    background: var(--card-bg) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .bottom-nav .nav-btn {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .bottom-nav .nav-btn.active {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .bottom-nav .nav-btn:hover {
    color: var(--primary-color) !important;
}



.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

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

.card-body {
    padding: 16px;
}

.card-header {
    background: var(--background-color);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-card.secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #34D399 100%);
}

.stat-card.accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, #FBBF24 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.subject-card, .topic-card, .test-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.subject-card:hover, .topic-card:hover, .test-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-color: var(--primary-light);
}

.subject-icon, .topic-icon, .test-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.subject-info, .topic-info, .test-info {
    flex: 1;
}

.subject-name, .topic-name, .test-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.subject-meta, .topic-meta, .test-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.subject-arrow, .topic-arrow, .test-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.btn {
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.form-control {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.ad-carousel {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.ad-slide {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.ad-slide.clickable-slide {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ad-slide.clickable-slide:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}



.institution-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--background-color);
    color: var(--text-secondary);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    padding: 8px 14px;
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filter-tab:hover, .filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.question-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease;
}

.question-number {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 12px;
}

.question-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.answer-option {
    display: block;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-option:hover {
    border-color: var(--primary-light);
    background: rgba(79, 70, 229, 0.05);
}

.answer-option input {
    display: none;
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

/* Dark Mode for Test Pages */
[data-theme="dark"] .question-card {
    background: var(--question-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--question-border) !important;
}

[data-theme="dark"] .question-number {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .question-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-option {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .answer-option:hover {
    border-color: var(--primary-color) !important;
    background: var(--answer-hover) !important;
}

[data-theme="dark"] .answer-option.selected {
    border-color: var(--primary-color) !important;
    background: var(--answer-selected) !important;
    color: var(--text-primary) !important;
}

/* Dark Mode for Additional Components */
[data-theme="dark"] .offcanvas {
    background-color: var(--offcanvas-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .offcanvas-header {
    background-color: var(--card-bg) !important;
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .offcanvas-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .offcanvas-body {
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content {
    background-color: var(--modal-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-header {
    background-color: var(--card-bg) !important;
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-body {
    background-color: var(--modal-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-footer {
    background-color: var(--card-bg) !important;
    border-top-color: var(--border-color) !important;
}

.result-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease;
}

/* Dark mode for result card */
[data-theme="dark"] .result-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .result-score {
    color: var(--text-primary) !important;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.result-icon.success {
    color: var(--secondary-color);
}

.result-icon.fail {
    color: var(--danger-color);
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.menu-profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

.menu-item:hover {
    color: var(--primary-color);
}

.menu-item i {
    font-size: 1.25rem;
    width: 24px;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: white;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
}

.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 32px 24px;
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* Footer Styles */
.app-footer {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: #E5E7EB;
    padding: 40px 16px 120px;
    margin-top: 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    text-align: left;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.footer-logo i {
    color: var(--primary-light);
}

.footer-tagline {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin: 0;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section {
    text-align: left;
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-light);
    border-radius: 2px;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 12px;
}

.footer-list a, .footer-list li {
    color: #D1D5DB;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.footer-list a:hover {
    color: var(--primary-light);
    transform: translateX(4px);
}

.footer-list i {
    font-size: 1rem;
    color: var(--primary-light);
    flex-shrink: 0;
}

.social-links {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.footer-bottom {
    text-align: left;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-bottom: 12px;
}

.footer-bottom-links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-bottom-links a {
    color: #D1D5DB;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: var(--primary-light);
}

.footer-bottom-links span {
    color: #6B7280;
}

/* Notification Styles */
.notification-offcanvas {
    width: 380px !important;
}

.notification-list {
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
}

.notification-item:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.03), transparent);
}

.notification-item.unread {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.02));
    border-left: 4px solid var(--primary-color);
}

.notification-icon-wrapper {
    flex-shrink: 0;
}

.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Dark Mode for Notifications */
[data-theme="dark"] .notification-offcanvas {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-item {
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-item:hover {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.05), transparent) !important;
}

[data-theme="dark"] .notification-item.unread {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.1), rgba(129, 140, 248, 0.03)) !important;
    border-left-color: var(--primary-color) !important;
}

[data-theme="dark"] .notification-content {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-title {
    color: var(--text-primary) !important;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-time i {
    font-size: 0.7rem;
}

.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.empty-notification-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--background-color), #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-icon i {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.empty-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Action Buttons Section */
.action-buttons-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 24px 0;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-button:hover::before {
    opacity: 1;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.courses-button {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
}

.news-button {
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
}

.action-button-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.action-button:hover .action-button-icon {
    transform: scale(1.05) rotate(3deg);
    background: rgba(255, 255, 255, 0.3);
}

.action-button-content {
    flex: 1;
}

.action-button-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.action-button-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.action-button:hover .action-button-arrow {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.3);
}

/* Course Styles */
.course-card, .course-featured-card {
    transition: all 0.3s ease;
}

.course-card:hover, .course-featured-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.course-featured-card {
    border: 2px solid var(--primary-light);
}

.lesson-card {
    transition: all 0.3s ease;
}

.lesson-card:hover {
    box-shadow: var(--shadow-md);
}

/* Enrollment Modal */
.enrollment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.enrollment-modal.active {
    display: flex;
}

.enrollment-modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

.enrollment-modal-header {
    padding: 20px;
    background: var(--gradient);
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.enrollment-modal-header .modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.enrollment-modal-header .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.enrollment-modal-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.enrollment-modal-body {
    padding: 20px;
}

.enrollment-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsive for enrollment modal */
@media (max-width: 768px) {
    .enrollment-modal {
        padding: 10px;
    }
    
    .enrollment-modal-content {
        max-width: 100%;
        margin: 0;
    }
    
    .enrollment-modal-header {
        padding: 15px;
    }
    
    .enrollment-modal-body {
        padding: 15px;
    }
    
    .enrollment-modal-footer {
        padding: 15px;
    }
    
    .enrollment-modal-footer .d-flex {
        flex-direction: row !important;
        gap: 10px;
    }
    
    .enrollment-modal-footer .btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

/* Dark mode for enrollment modal */
[data-theme="dark"] .enrollment-modal-content {
    background: var(--dark-card-bg);
    color: var(--dark-text);
}

[data-theme="dark"] .enrollment-modal-footer {
    border-top-color: var(--dark-border);
}

.lesson-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}



.lesson-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lesson-list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.lesson-list-item:hover:not(.disabled) {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.lesson-list-item.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.1), transparent);
    border-color: var(--primary-color);
}

.lesson-list-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lesson-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
}

.lesson-list-item.active .lesson-number {
    background: var(--primary-color);
    color: white;
}

.lesson-list-title {
    font-weight: 500;
    margin-bottom: 4px;
}

/* News Styles */
.news-card {
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.news-featured-card {
    border: 2px solid var(--primary-light);
    transition: all 0.3s ease;
}

.news-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.news-content p {
    margin-bottom: 16px;
}

/* Responsive Styles */
@media (min-width: 481px) {
    .app-container {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }
    
    .action-buttons-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 768px) {
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
        margin-bottom: 48px;
    }
    
    .app-footer {
        padding: 60px 40px 120px;
    }
    
    .footer-brand {
        margin-bottom: 48px;
        padding-bottom: 32px;
    }
    
    .footer-logo {
        font-size: 1.75rem;
    }
}

/* Result Buttons */
.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.result-buttons .btn {
    width: 100%;
    margin: 0 !important;
}

@media (min-width: 576px) {
    .result-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .result-buttons .btn {
        width: auto;
        flex: 0 1 auto;
    }
}

/* Form Hints */
.password-hint, .form-hint {
    margin-top: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(79, 70, 229, 0.02));
    border-left: 3px solid var(--primary-light);
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.password-hint small, .form-hint small {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}

.password-hint i, .form-hint i {
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Form Error Messages */
.text-danger {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--danger);
}

.text-danger i {
    margin-top: 2px;
    flex-shrink: 0;
}
/* Search Styles */
.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding-left: 45px;
    padding-right: 45px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 1.1rem;
    z-index: 2;
}

.search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
}

.search-clear:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(79, 70, 229, 0.02));
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
}

.search-results-count, .topic-results-count {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.search-results-header .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0;
}

.search-results-header .btn-link:hover {
    text-decoration: underline;
}

/* Search Animation */
.subject-card, .topic-card {
    transition: all 0.3s ease;
}

.subject-card[style*="display: none"], .topic-card[style*="display: none"] {
    opacity: 0;
    transform: scale(0.95);
}

/* Search Input Focus Animation */
.search-input-wrapper:focus-within .search-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Mobile Search Optimization */
@media (max-width: 480px) {
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 40px);
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

/* Dark mode for install prompt */
[data-theme="dark"] .install-prompt {
    background: var(--card-bg) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .install-prompt-title,
[data-theme="dark"] .install-prompt-subtitle {
    color: var(--text-primary) !important;
}

.install-prompt.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.install-prompt-content {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-prompt-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.install-prompt-text {
    flex: 1;
    min-width: 0;
}

.install-prompt-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.install-prompt-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.install-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.install-prompt-actions .btn {
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .install-prompt {
        bottom: 90px; /* Above bottom navigation */
        width: calc(100% - 20px);
        left: 50%;
        transform: translateX(-50%) translateY(100px);
    }
    
    .install-prompt.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .install-prompt-content {
        padding: 16px;
        gap: 12px;
    }
    
    .install-prompt-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .install-prompt-title {
        font-size: 0.9rem;
    }
    
    .install-prompt-subtitle {
        font-size: 0.8rem;
    }
    
    .install-prompt-actions .btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Animation for better UX */
@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.install-prompt.show {
    animation: slideUp 0.3s ease-out;
}

/* Backdrop blur effect */
.install-prompt::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    z-index: -1;
}

/* Install button hover effect */
.install-prompt-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

/* Dismiss button styling */
.install-prompt-actions .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.install-prompt-actions .btn-outline-secondary:hover {
    background: var(--background-color);
    border-color: var(--text-muted);
    color: var(--text-primary);
}


/* Page Header Styles */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transform: translate(-20px, 20px);
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.page-header-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
}

.page-header-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-header-stat {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Category-specific header colors */
.page-header.subjects-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
}

.page-header.certificates-header {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.page-header.institutions-header {
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
}

.page-header.mock-exams-header {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

/* Animation for header changes */
.page-header {
    transition: all 0.3s ease;
}

.page-header-title {
    transition: all 0.3s ease;
}

/* Mobile optimization */
@media (max-width: 480px) {
    .page-header {
        padding: 20px 16px;
        margin-bottom: 20px;
    }
    
    .page-header-title {
        font-size: 1.25rem;
    }
    
    .page-header-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .page-header-stats {
        gap: 12px;
        margin-top: 12px;
    }
    
    .page-header-stat {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}



.institution-price {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.institution-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: auto;
}

/* Institution Detail Styles */
.institution-detail-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.institution-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.description-preview {
    color: var(--text-secondary);
}

.description-full {
    color: var(--text-primary);
}

/* Direction Styles */
.direction-card {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
    height: 100%;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.direction-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.direction-price {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.direction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-card {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.action-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.action-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.action-content h6 {
    font-weight: 600;
    margin-bottom: 8px;
}

.action-content .btn {
    margin-top: auto;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .institution-image {
        height: 150px;
    }
    
    .institution-detail-image {
        height: 200px;
    }
    
    .direction-actions {
        flex-direction: column;
    }
    
    .direction-actions .btn {
        width: 100%;
    }
    
    .action-card {
        padding: 16px;
    }
    
    .action-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .map-container {
        height: 250px;
    }
}
/* Contract Price Styling */
.institution-price {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.direction-price {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.contract-price-display {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.price-badge {
    color: white;
    text-align: center;
}

.price-badge strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
    opacity: 0.9;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

/* Responsive price styling */
@media (max-width: 576px) {
    .price-amount {
        font-size: 1.25rem;
    }
    
    .contract-price-display {
        padding: 16px;
        margin-bottom: 20px;
    }
}
/* Institution List New Styles */
.institution-info {
    margin-bottom: 12px;
}

.info-item {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 12px;
    margin-bottom: 4px;
}

.admission-period {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 8px;
}

/* Institution Detail New Styles */
.institution-info-section {
    margin-bottom: 16px;
}

.institution-info-item {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-separator {
    margin: 0 8px;
    color: var(--text-muted);
}

.institution-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.institution-price-main {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-block;
    margin-bottom: 12px;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.admission-period-main {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

.institution-logo-container {
    display: flex;
    justify-content: center;
}

.institution-logo-detail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.institution-image-container {
    display: flex;
    justify-content: center;
}

.institution-image-detail {
    width: 100%;
    max-width: 500px;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

/* Info Boxes */
.info-box {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    height: 100%;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.info-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: white;
}

.contract-icon {
    background: linear-gradient(135deg, #10B981, #059669);
}

.admission-icon {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.license-icon {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.license-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Direction Cards New */
.direction-card-new {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.direction-name-new {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: 16px;
    line-height: 1.4;
}

.direction-details {
    flex: 1;
    margin-bottom: 16px;
}

.detail-row {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.detail-label {
    color: var(--text-secondary) !important;
}

.detail-separator {
    margin: 0 8px;
    color: var(--text-muted);
}

.detail-price {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.direction-actions-new {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Video Wrapper for Desktop */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Description Section */
.description-section h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.description-preview {
    color: var(--text-secondary);
    line-height: 1.6;
}

.description-full {
    color: var(--text-primary);
    line-height: 1.6;
}

.description-section h6 {
    color: var(--text-primary) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .institution-title {
        font-size: 1.5rem;
    }
    
    .institution-logo-detail {
        width: 80px;
        height: 80px;
    }
    
    .institution-image-detail {
        height: 180px;
    }
    
    .info-box {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: 12px;
    }
    
    .direction-actions-new {
        flex-direction: column;
    }
    
    .direction-actions-new .btn {
        width: 100%;
    }
    
    .license-actions {
        flex-direction: column;
    }
    
    .license-actions .btn {
        width: 100%;
        margin: 2px 0;
    }
}

@media (max-width: 576px) {
    .institution-price-main {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .admission-period-main {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .direction-card-new {
        padding: 16px;
    }
    
    .direction-name-new {
        font-size: 1rem;
    }
}
/* Institution Card Labels */
.institution-price-with-label {
    margin-bottom: 12px;
}

.price-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admission-period-with-label {
    margin-bottom: 12px;
}

.period-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Update existing styles to remove margin when used with labels */
.institution-price-with-label .institution-price {
    margin-bottom: 0;
}

.admission-period-with-label .admission-period {
    margin-top: 0;
}

/* Institution Card Styles */
.institution-card-new {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.institution-card-new:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.institution-card-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.institution-card-new:hover::before {
    opacity: 1;
}

.institution-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.institution-logo-wrapper {
    flex-shrink: 0;
    position: relative;
}

.institution-logo-new {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.institution-card-new:hover .institution-logo-new {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.institution-main-info {
    flex: 1;
    min-width: 0;
}

.institution-name-new {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.institution-short-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.institution-details {
    margin-top: auto;
}

.institution-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.meta-item i {
    font-size: 0.9rem;
    color: var(--primary-color);
}

.institution-arrow {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.institution-card-new:hover .institution-arrow {
    color: var(--primary-color);
    transform: translateY(-50%) translateX(4px);
}

/* Responsive Design for Institution Cards */
@media (max-width: 768px) {
    .institution-card-new {
        padding: 16px;
    }
    
    .institution-header {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .institution-logo-new {
        width: 70px;
        height: 70px;
    }
    
    .institution-name-new {
        font-size: 1rem;
    }
    
    .institution-short-desc {
        font-size: 0.8rem;
    }
    
    .institution-meta-row {
        gap: 12px;
    }
    
    .meta-item {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .institution-card-new {
        padding: 14px;
    }
    
    .institution-header {
        gap: 10px;
    }
    
    .institution-logo-new {
        width: 60px;
        height: 60px;
    }
    
    .institution-name-new {
        font-size: 0.9rem;
    }
    
    .institution-short-desc {
        font-size: 0.7rem;
    }
}

/* ========== AI ASSISTANT FLOATING BUTTON ========== */
.ai-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 24px;
    cursor: pointer;
    z-index: 997;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.ai-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ========== AI MODAL ========== */
.ai-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    height: 70vh;
    background: var(--white);
    border-radius: 24px 24px 0 0;
    z-index: 2001;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.ai-modal.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.ai-modal-header {
    padding: 20px;
    background: var(--gradient);
    color: var(--white);
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-header-info i {
    font-size: 32px;
}

.ai-header-info h3 {
    font-size: 18px;
    margin-bottom: 2px;
}

.ai-status {
    font-size: 13px;
    opacity: 0.9;
}

.close-ai {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--background-color);
    transition: background-color 0.3s ease;
}

.ai-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

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

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ai-message.user .ai-avatar {
    background: var(--primary);
}

.ai-bubble {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 75%;
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.ai-message.user .ai-bubble {
    background: var(--primary);
    color: var(--white);
    border-radius: 16px 16px 4px 16px;
}

.ai-message.bot .ai-bubble {
    border-radius: 16px 16px 16px 4px;
}

.ai-input-container {
    display: flex;
    gap: 12px;
    padding: 16px 20px 20px;
    background: var(--white);
    border-top: 1px solid var(--gray-light);
}

.ai-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 20px;
    font-size: 15px;
    outline: none;
}

.ai-input-container input:focus {
    border-color: var(--primary);
}

.ai-input-container button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--gradient);
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========== OVERLAY ========== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
}

.overlay.active {
    display: block;
}

/* ========== HERO CARD ========== */
.hero-card {
    background: var(--gradient);
    border-radius: 24px;
    padding: 28px 24px;
    color: var(--white);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><circle cx="50" cy="50" r="30" fill="rgba(255,255,255,0.1)"/><circle cx="350" cy="150" r="40" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.hero-content p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.hero-stats {
    display: flex;
    gap: 24px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
}

.hero-stat strong {
    font-size: 24px;
    margin-bottom: 4px;
}

.hero-stat span {
    font-size: 12px;
    opacity: 0.9;
}

/* ========== FEATURED SCROLL ========== */
.featured-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 24px;
}

.featured-scroll::-webkit-scrollbar {
    display: none;
}

.featured-card {
    min-width: 280px;
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--warning);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.card-badge.new {
    background: var(--success);
}

.card-badge.hot {
    background: var(--danger);
}

.card-icon-large {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--white);
    margin-bottom: 16px;
}

.featured-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.featured-card p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 16px;
}

.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 16px;
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-card-action {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== SUBJECTS GRID MINI ========== */
.subjects-grid-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.subject-mini {
    aspect-ratio: 1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
}

.subject-mini:active {
    transform: scale(0.95);
}

.subject-mini i {
    font-size: 32px;
}

.physics-bg {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.math-bg {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.chemistry-bg {
    background: linear-gradient(135deg, #10b981, #059669);
}

.biology-bg {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.english-bg {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.history-bg {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

/* ========== PLATFORM STATS ========== */
.platform-stats {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 24px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.platform-stats h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.stats-grid-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-mini {
    background: var(--light);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.stat-mini i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-mini strong {
    display: block;
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-mini span {
    font-size: 13px;
    color: var(--gray);
}

/* ========== LOADING ANIMATION ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== RESPONSIVE TWEAKS ========== */
@media (max-width: 500px) {
    .mobile-app, .app-container {
        max-width: 100%;
    }
}

@media (max-height: 700px) {
    .ai-modal {
        height: 80vh;
    }
}
/* ========== SIDEBAR MENU ========== */
.sidebar-menu {
    width: 85% !important;
    max-width: 320px !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    background: var(--gradient);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-profile img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.user-info p {
    font-size: 13px;
    opacity: 0.9;
}

.theme-toggle {
    margin-top: 8px;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-btn i {
    font-size: 12px;
}

.close-sidebar {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 140px);
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: left;
    gap: 12px;
    background: transparent;
}

.sidebar-nav .nav-item i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: var(--primary-color);
    transition: color 0.3s ease, transform 0.2s ease;
}

.sidebar-nav .nav-item span {
    flex: 1;
    text-align: left;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.sidebar-nav .nav-item:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.sidebar-nav .nav-item:hover i {
    color: var(--primary-color);
    transform: scale(1.05);
}

.sidebar-nav .nav-item:hover span {
    color: var(--text-primary);
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.sidebar-nav .nav-item.active i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.sidebar-nav .nav-item.active span {
    color: var(--primary-color);
}

.sidebar-nav .nav-item:hover i {
    color: var(--primary);
    transform: scale(1.05);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 20px;
    transition: background-color 0.3s ease;
}



/* ========== MAIN CONTAINER ========== */
.main-container {
    padding: 16px;
    padding-bottom: 100px;
}

.page {
    display: block;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ========== SECTION HEADER ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.see-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* ========== CONTINUE LEARNING ========== */
.continue-learning {
    margin-bottom: 24px;
}

.learning-card {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
    flex-shrink: 0;
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.card-info p {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.progress-mini {
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.btn-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--gradient);
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========== USER AVATAR ========== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    background: none;
    padding: 0;
}

.user-avatar:hover {
    transform: scale(1.05);
    border-color: var(--primary-dark);
}

.user-avatar:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .user-avatar {
    border-color: var(--primary-color) !important;
}

[data-theme="dark"] .user-avatar:hover {
    border-color: var(--primary-dark) !important;
}

[data-theme="dark"] .user-avatar:focus {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2) !important;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 12px 6px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 24px 24px 0 0;
    z-index: 1000; /* Higher than content sections */
    transition: background-color 0.3s ease;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 6px 4px;
    transition: all 0.3s ease, color 0.3s ease;
    text-align: center;
    min-height: 44px;
    border-radius: 8px;
}

/* Bottom navigation specific nav-item styling */
.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.bottom-nav .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.bottom-nav .nav-item.active i {
    transform: scale(1.1);
}

.nav-btn i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.nav-btn:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.nav-btn.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    font-weight: 600;
}

.nav-btn.active i {
    transform: scale(1.1);
}

/* Center item (Sertifikatlar) special styling */
.nav-btn:nth-child(3) {
    font-weight: 600;
    position: relative;
}

.nav-btn:nth-child(3)::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-btn:nth-child(3).active::after {
    opacity: 1;
}
/* ========== PAGE TITLE ========== */
.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
}

/* ========== SEARCH BOX ========== */
.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary);
}

/* ========== FILTER CHIPS ========== */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.chip.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ========== SUBJECT DETAIL MOBILE ========== */
.subject-detail-mobile {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.subject-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light);
}

.subject-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--white);
    flex-shrink: 0;
}

.subject-info {
    flex: 1;
}

.subject-info h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.subject-info p {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating i {
    color: var(--warning);
    font-size: 14px;
}

.rating span {
    font-weight: 600;
    font-size: 14px;
}

.btn-subject-start {
    padding: 10px 20px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

/* ========== PROGRESS SECTION ========== */
.progress-section {
    background: var(--background-color);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-header span {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

.progress-header strong {
    font-size: 18px;
    color: var(--primary);
}

.progress-bar-large {
    height: 10px;
    background: var(--gray-light);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.detail-item i {
    color: var(--primary);
    width: 20px;
}

/* ========== TOPICS ========== */
.topics-section h4 {
    font-size: 18px;
    margin-bottom: 16px;
}

.topic-mobile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--background-color);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.topic-mobile.completed {
    background: rgba(16, 185, 129, 0.1);
}

.topic-mobile.locked {
    opacity: 0.6;
}

.topic-number {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.topic-content {
    flex: 1;
}

.topic-content h5 {
    font-size: 16px;
    margin-bottom: 4px;
}

.topic-content p {
    font-size: 13px;
    color: var(--gray);
}

.topic-actions {
    display: flex;
    gap: 8px;
}

.btn-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.topic-check {
    color: var(--success);
    font-size: 24px;
}

.topic-lock {
    font-size: 20px;
    color: var(--gray);
}

/* ========== INSTITUTION CATEGORIES ========== */
.institution-categories {
    display: grid;
    gap: 16px;
}

.category-card {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.category-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 20px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--white);
}

.category-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.category-card p {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 16px;
}

.btn-category {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-light);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray);
    font-size: 14px;
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 500px) {
    .main-container {
        padding: 12px;
        padding-bottom: 100px;
    }
    
    .subject-detail-mobile {
        padding: 16px;
    }
    
    .subject-header {
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }
    
    .subject-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
}
/* ========== DARK MODE FOR LEADERBOARD PAGES ========== */
[data-theme="dark"] .table {
    --bs-table-bg: var(--card-bg) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-light {
    --bs-table-bg: var(--background-color) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-bg: var(--background-color) !important;
    background-color: var(--background-color) !important;
}

[data-theme="dark"] .table-primary {
    --bs-table-bg: rgba(129, 140, 248, 0.2) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: rgba(129, 140, 248, 0.2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-success {
    --bs-table-bg: rgba(52, 211, 153, 0.2) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: rgba(52, 211, 153, 0.2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-warning {
    --bs-table-bg: rgba(251, 191, 36, 0.2) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: rgba(251, 191, 36, 0.2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table thead th {
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table tbody td {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table-responsive {
    background-color: var(--card-bg) !important;
}

/* ========== DARK MODE FOR TEST PAGES ========== */
[data-theme="dark"] .long-text-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--background-color) 100%) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .long-text-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .long-text-content {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .long-text-content::-webkit-scrollbar-track {
    background: var(--background-color) !important;
}

[data-theme="dark"] .long-text-content::-webkit-scrollbar-thumb {
    background: var(--primary-color) !important;
}

[data-theme="dark"] .score-display {
    background: linear-gradient(135deg, var(--success), var(--secondary-color)) !important;
}

[data-theme="dark"] .timer-display {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary)) !important;
}

[data-theme="dark"] .question-points-mobile {
    background: linear-gradient(135deg, var(--success), var(--secondary-color)) !important;
}

[data-theme="dark"] .question-number {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .question-text {
    color: var(--text-primary) !important;
}

/* ========== DARK MODE FOR ANALYSIS PAGES ========== */
[data-theme="dark"] .analysis-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-header {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-content {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-question {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-question-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-answer {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-answer.correct {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: var(--success) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-answer.incorrect {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: var(--danger) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-answer.user-selected {
    background: rgba(129, 140, 248, 0.1) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-stats {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-item {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-value {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary) !important;
}

/* ========== MOBILE ENHANCEMENTS ========== */
/* Keep all existing functionality but add mobile-first design */

/* Mobile-first responsive adjustments */
@media (max-width: 768px) {
    .app-container {
        padding-bottom: 90px; /* Space for AI fab */
    }
    
    .hero-section {
        border-radius: var(--radius-xl);
        margin-bottom: 20px;
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-card {
        border-radius: var(--radius-lg);
        padding: 16px;
    }
    
    .subject-card, .topic-card, .test-card {
        border-radius: var(--radius-lg);
        margin-bottom: 8px;
    }
    
    .action-buttons-section {
        margin: 20px 0;
    }
    
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .page-header {
        border-radius: var(--radius-xl);
        margin-bottom: 20px;
        padding: 20px;
    }
    
    .filter-tabs {
        margin-bottom: 16px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        border-radius: var(--radius-lg);
        font-size: 0.85rem;
    }
    
    .search-container {
        margin-bottom: 16px;
    }
    
    .search-input {
        border-radius: var(--radius-lg);
        padding: 12px 16px 12px 45px;
    }
    
    .institution-card-new {
        border-radius: var(--radius-lg);
        margin-bottom: 12px;
    }
}

/* Enhanced mobile navigation */
@media (max-width: 500px) {
    .bottom-nav {
        padding: 8px 4px 12px;
        gap: 1px;
    }
    
    .nav-btn {
        font-size: 0.65rem;
        padding: 4px 2px;
        min-height: 40px;
    }
    
    .nav-btn i {
        font-size: 1.2rem;
        marg
    
    .logo-mini {
        font-size: 22px;
        gap: 10px;
    }
    
    .logo-mini i {
        font-size: 26px;
    }
    
    /* Mobile sidebar fixes */
    .sidebar-menu {
        height: 100vh !important;
        max-height: 100vh !important;
    }
    
    .sidebar-nav {
        max-height: calc(100vh - 140px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .sidebar-header {
        flex-shrink: 0 !important;
        min-height: 120px;
    }
}

@media (max-width: 400px) {
    .nav-btn {
        font-size: 0.6rem;
        padding: 4px 1px;
    }
    
    .nav-btn i {
        font-size: 1.1rem;
    }
    
    .bottom-nav {
        gap: 0;
    }
    
    /* Very small screens sidebar fixes */
    .sidebar-nav {
        max-height: calc(100vh - 120px) !important;
        padding: 8px 0;
    }
    
    .sidebar-header {
        padding: 16px;
        min-height: 100px;
    }
    
    .user-profile img {
        width: 50px;
        height: 50px;
    }
    
    .user-info h3 {
        font-size: 16px;
    }
    
    .user-info p {
        font-size: 12px;
    }
}

/* AI Fab positioning for mobile */
@media (max-width: 768px) {
    .ai-fab {
        bottom: 85px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
}

/* Ensure all cards have consistent mobile styling */
.card, .subject-card, .institution-card-new, .action-button {
    transition: all 0.3s ease;
}

.card:hover, .subject-card:hover, .institution-card-new:hover, .action-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Mobile-optimized footer */
@media (max-width: 768px) {
    .app-footer {
        padding: 30px 16px 90px;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
    .btn, .nav-btn, .filter-tab, .chip {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .subject-card, .institution-card-new {
        min-height: 80px;
        padding: 16px;
    }
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .subject-card:active, .institution-card-new:active, .action-button:active {
        transform: scale(0.98);
    }
}
/* Test sahifasi uchun yangi stillar */
.timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.timer-display i {
    font-size: 1.2rem;
}

.question-result {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.result-status.correct {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.result-status.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.question-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.question-buttons .btn {
    min-width: 150px;
}

.answers-container {
    margin-bottom: 20px;
}

.answer-option:disabled,
.answer-option input:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
}

.answer-option.answer-correct {
    border-color: #22c55e !important;
    background: rgba(34, 197, 94, 0.15) !important;
    border-width: 3px !important;
}

.answer-option.answer-incorrect {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    border-width: 3px !important;
}

/* Progress bar yangi stillar */
.progress {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Responsive dizayn */
@media (max-width: 768px) {
    .question-buttons {
        flex-direction: column;
    }
    
    .question-buttons .btn {
        width: 100%;
        min-width: auto;
    }
    
    .timer-display {
        font-size: 1rem;
    }
}

/* Animatsiyalar */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-card {
    animation: fadeIn 0.5s ease;
}

.question-result {
    animation: fadeIn 0.3s ease;
}
}
/* ========== DARK MODE FOR ANALYSIS PAGES ========== */
[data-theme="dark"] .analysis-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-header {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-content {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .question-analysis-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-left-color: var(--border-color) !important;
}

[data-theme="dark"] .question-number-badge.correct {
    background: rgba(52, 211, 153, 0.2) !important;
    color: var(--success) !important;
}

[data-theme="dark"] .question-number-badge.incorrect {
    background: rgba(248, 113, 113, 0.2) !important;
    color: var(--danger) !important;
}

[data-theme="dark"] .question-text-analysis {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-item-analysis {
    background: var(--background-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-item-analysis.correct-answer {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: var(--success) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-item-analysis.user-selected {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: var(--warning) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-item-analysis.wrong-answer {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: var(--danger) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-item-analysis.correct-answer.user-selected {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: var(--success) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answer-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-question {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-question-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-answer {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .analysis-answer.correct {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: var(--success) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-answer.incorrect {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: var(--danger) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-answer.user-selected {
    background: rgba(129, 140, 248, 0.1) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .analysis-stats {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-item {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-value {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .result-score {
    color: var(--text-primary) !important;
}

/* ========== DARK MODE FOR LEADERBOARD PAGES ========== */
[data-theme="dark"] .table {
    --bs-table-bg: var(--card-bg) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-light {
    --bs-table-bg: var(--background-color) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-bg: var(--background-color) !important;
    background-color: var(--background-color) !important;
}

[data-theme="dark"] .table-primary {
    --bs-table-bg: rgba(129, 140, 248, 0.2) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: rgba(129, 140, 248, 0.2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-success {
    --bs-table-bg: rgba(52, 211, 153, 0.2) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: rgba(52, 211, 153, 0.2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-warning {
    --bs-table-bg: rgba(251, 191, 36, 0.2) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: rgba(251, 191, 36, 0.2) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table thead th {
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table tbody td {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table-responsive {
    background-color: var(--card-bg) !important;
}

/* ========== DARK MODE FOR TEST PAGES ========== */
[data-theme="dark"] .long-text-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--background-color) 100%) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .long-text-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .long-text-content {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .long-text-content::-webkit-scrollbar-track {
    background: var(--background-color) !important;
}

[data-theme="dark"] .long-text-content::-webkit-scrollbar-thumb {
    background: var(--primary-color) !important;
}

[data-theme="dark"] .score-display {
    background: linear-gradient(135deg, var(--success), var(--secondary-color)) !important;
}

[data-theme="dark"] .timer-display {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary)) !important;
}

[data-theme="dark"] .question-points-mobile {
    background: linear-gradient(135deg, var(--success), var(--secondary-color)) !important;
}

[data-theme="dark"] .question-number {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .question-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .question-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}
/* ========== ADDITIONAL DARK MODE FOR ANALYSIS PAGES ========== */
[data-theme="dark"] .analysis-container {
    background: var(--background-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .question-header {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .question-status {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .answers-analysis {
    background: transparent !important;
}

[data-theme="dark"] .answer-indicator {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .earned-points {
    color: var(--success) !important;
}

[data-theme="dark"] .missed-points {
    color: var(--danger) !important;
}

[data-theme="dark"] .question-points {
    color: var(--text-secondary) !important;
}

/* Long text in analysis pages - Dark mode */
[data-theme="dark"] .question-analysis-card .long-text-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--background-color) 100%) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .question-analysis-card .long-text-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .question-analysis-card .long-text-content {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .question-analysis-card .long-text-content::-webkit-scrollbar-track {
    background: var(--background-color) !important;
}

[data-theme="dark"] .question-analysis-card .long-text-content::-webkit-scrollbar-thumb {
    background: var(--primary-color) !important;
}

/* Alert dark mode for analysis pages */
[data-theme="dark"] .alert-warning {
    background-color: rgba(251, 191, 36, 0.1) !important;
    color: var(--text-primary) !important;
    border-color: var(--warning) !important;
}

[data-theme="dark"] .alert-warning i {
    color: var(--warning) !important;
}

/* Badge dark mode for analysis pages */
[data-theme="dark"] .badge {
    color: var(--white) !important;
}

[data-theme="dark"] .badge.bg-success {
    background-color: var(--success) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .badge.bg-danger {
    background-color: var(--danger) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .badge.bg-warning {
    background-color: var(--warning) !important;
    color: var(--dark) !important;
}
