:root {
    /* Color Palette - Premium Dark/Teal Theme */
    --primary-blue: #0f3460;
    --primary-teal: #16c79a;
    --secondary-teal: #13a77e;
    --accent-purple: #667eea;
    --accent-pink: #764ba2;
    --dark-bg: #1a1a2e;
    --card-bg: #ffffff;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-light: #e2e8f0;
    --success: #16c79a;
    --error: #e53e3e;
    --warning: #ecc94b;

    /* Enhanced Shadows for Depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.16);
    --shadow-2xl: 0 30px 60px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.14);
    --glow-teal: 0 0 20px rgba(22, 199, 154, 0.5);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-bg));
}

.glass-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* ========== NAVBAR & HAMBURGER MENU FIXES ========== */

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition-normal);
}

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

/* Hamburger Menu - Fixed Display */
.hamburger-menu {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.brand {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
    transition: var(--transition-normal);
}

.brand:hover {
    transform: translateY(-1px);
}

.brand i {
    color: var(--primary-teal);
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(22, 199, 154, 0.3));
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition-normal);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(22, 199, 154, 0.4);
    transition: var(--transition-normal);
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(22, 199, 154, 0.5);
}

.btn-logout {
    padding: 0.65rem 1.3rem;
    border: 1.5px solid var(--border-light);
    background: transparent;
    border-radius: var(--radius-full);
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #fff5f5, #fee);
    color: var(--error);
    border-color: #fc8181;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Layout */
.app-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    border-right: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition-normal);
    z-index: 900;
    box-shadow: var(--shadow-xs);
}

.nav-section h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a0aec0;
    margin-bottom: 1rem;
    font-weight: 700;
    padding-left: 1rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-normal);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-teal);
    transform: scaleY(0);
    transition: var(--transition-normal);
}

.nav-link:hover {
    background: linear-gradient(90deg, rgba(22, 199, 154, 0.08), transparent);
    color: var(--primary-blue);
    transform: translateX(4px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(22, 199, 154, 0.12), rgba(22, 199, 154, 0.04));
    color: var(--primary-teal);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
    transition: var(--transition-normal);
}

.nav-link:hover i,
.nav-link.active i {
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
    height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf4 100%);
}

.dashboard-view {
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-header {
    margin-bottom: 3rem;
    position: relative;
}

.welcome-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.welcome-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.action-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-teal), var(--accent-purple));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-normal);
}

.action-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(22, 199, 154, 0.05), transparent);
    opacity: 0;
    transition: var(--transition-normal);
}

.action-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(22, 199, 154, 0.2);
}

.action-card:hover::before {
    transform: scaleX(1);
}

.action-card:hover::after {
    opacity: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    transition: var(--transition-slow);
    position: relative;
    z-index: 1;
}

.action-card:hover .card-icon {
    transform: scale(1.15) rotate(-5deg);
}

.icon-blue {
    background: linear-gradient(135deg, rgba(15, 52, 96, 0.1), rgba(15, 52, 96, 0.05));
    color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(15, 52, 96, 0.15);
}

.icon-teal {
    background: linear-gradient(135deg, rgba(22, 199, 154, 0.1), rgba(22, 199, 154, 0.05));
    color: var(--primary-teal);
    box-shadow: 0 4px 12px rgba(22, 199, 154, 0.15);
}

.icon-purple {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(102, 126, 234, 0.05));
    color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.action-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
    position: relative;
    z-index: 1;
}

.action-card p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Recommendations Section */
.recommendations-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    margin-bottom: 3rem;
    color: white;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.recommendations-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(22, 199, 154, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

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

.rec-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.rec-scroll::-webkit-scrollbar {
    height: 6px;
}

.rec-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.rec-scroll::-webkit-scrollbar-thumb {
    background: white;
    border-radius: 3px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f8f9fa, #f0f2f5);
    transition: var(--transition-normal);
    border: 1px solid transparent;
}

.activity-item:hover {
    background: white;
    border-color: rgba(22, 199, 154, 0.2);
    box-shadow: var(--shadow-sm);
    transform: translateX(8px);
}

.activity-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(22, 199, 154, 0.1), rgba(22, 199, 154, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-teal);
    box-shadow: 0 4px 8px rgba(22, 199, 154, 0.15);
    font-size: 1.3rem;
    transition: var(--transition-normal);
}

.activity-item:hover .activity-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(22, 199, 154, 0.25);
}

.activity-details { flex: 1; }
.activity-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.2rem;
}
.activity-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========== CRITICAL FIXES ========== */

/* Feature Views - COMPLETELY FIXED */
.view-section {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
}

.view-section.active {
    display: block;
    animation: none; /* Remove conflicting animations */
}

/* QUIZ SPECIFIC FIXES - COMPLETE OVERHAUL */
#quizView {
    position: relative;
}

/* Quiz states - NO animations that conflict with JS */
#quizSetup {
    display: block;
}

#quizSetup.hidden {
    display: none;
}

#quizInterface {
    display: block;
    opacity: 1;
    visibility: visible;
}

#quizInterface.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

#quizResults {
    display: block;
}

#quizResults.hidden {
    display: none;
}

/* Questions Results - FIXED */
#questionsResults {
    display: none;
}

#questionsResults:not([style*="display: none"]) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Forms */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.3rem;
    display: block;
    font-size: 0.95rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 1rem 1.3rem;
    border: 2px solid #e8ecf0;
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: var(--transition-normal);
    background: #fafbfc;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary-teal);
    background: white;
    box-shadow: 0 0 0 4px rgba(22, 199, 154, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    color: white;
    border: none;
    padding: 1.1rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 6px 20px rgba(22, 199, 154, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(22, 199, 154, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

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

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    backdrop-filter: blur(10px);
    padding: 1.2rem 1.8rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 6px solid var(--success);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--primary-blue); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: none; /* Start hidden */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay:not(.hidden) {
    display: flex;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(22, 199, 154, 0.2);
    border-top: 4px solid var(--primary-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

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

/* Results Styling */
.result-card {
    background: white;
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border-left: 5px solid var(--primary-teal);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.result-card h4 {
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
    font-weight: 600;
}

/* ========== MOBILE RESPONSIVENESS FIXES ========== */

/* Tablet and Mobile (992px and below) */
@media (max-width: 992px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    /* Show hamburger menu on mobile/tablet */
    .hamburger-menu {
        display: flex;
    }

    /* Hide user info text on smaller screens */
    .user-info span {
        display: none;
    }

    .nav-right {
        gap: 1rem;
    }

    /* Sidebar mobile behavior */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 80px;
        height: calc(100vh - 80px);
        width: 100%;
        max-width: 320px;
        z-index: 999;
        box-shadow: var(--shadow-2xl);
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    /* Main content adjustment */
    .main-content {
        padding: 1.5rem;
        width: 100%;
    }

    /* Dashboard improvements */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .welcome-header h1 {
        font-size: 2rem;
    }

    .action-card {
        padding: 2rem;
    }

    /* View sections full width on mobile */
    .view-section {
        padding: 1.5rem;
        margin: 0 auto;
        width: 100%;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 1rem;
    }

    .brand {
        font-size: 1.3rem;
    }

    .brand i {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .welcome-header h1 {
        font-size: 1.8rem;
    }

    .welcome-header p {
        font-size: 1rem;
    }

    /* Cards more compact on mobile */
    .action-card {
        padding: 1.5rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .action-card h3 {
        font-size: 1.2rem;
    }

    /* Recommendations section mobile fix */
    .recommendations-section {
        padding: 1.5rem;
    }

    /* Forms mobile optimization */
    .input-group input,
    .input-group select {
        padding: 0.8rem 1rem;
    }

    .btn-primary {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* Quiz mobile optimization */
    .question-card {
        padding: 1.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .option-btn {
        padding: 1rem 1.2rem;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .navbar {
        padding: 0.6rem 0.8rem;
    }

    .brand {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 0.8rem;
    }

    .view-section {
        padding: 1rem;
    }

    .welcome-header h1 {
        font-size: 1.5rem;
    }

    .action-card {
        padding: 1.2rem;
    }

    .dashboard-grid {
        gap: 1rem;
    }

    /* Even more compact cards */
    .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .action-card h3 {
        font-size: 1.1rem;
    }

    .action-card p {
        font-size: 0.9rem;
    }
}

/* Toast Close Button */
.toast-close {
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-dark);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

/* ========== UTILITY CLASSES - COMPLETELY FIXED ========== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-light);
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Results Container */
.results-container {
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.results-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-action:hover {
    background: #f8f9fa;
    border-color: var(--primary-teal);
    color: var(--primary-teal);
    transform: translateY(-1px);
}

.topic-badge {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, rgba(22, 199, 154, 0.1), rgba(22, 199, 154, 0.05));
    color: var(--primary-teal);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Analytics Dashboard */
.analytics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: var(--transition-normal);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.analytics-charts {
    display: grid;
    gap: 2rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.chart-container h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.chart-placeholder {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: var(--radius-md);
}

/* Quiz Progress and Controls */
.quiz-progress-container {
    margin-bottom: 1.5rem;
}

.quiz-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.quiz-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-teal), var(--primary-blue));
    width: var(--progress-width, 0%);
    transition: width 0.3s ease;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

.score-value {
    font-size: 4rem;
    font-weight: 800;
}

.score-label {
    font-size: 1.5rem;
    color: var(--text-light);
}

.result-message {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Quiz Question Cards and Options */
.question-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.question-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
    line-height: 1.6;
    font-weight: 600;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

.option-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 1.3rem 1.8rem;
    border-radius: var(--radius-lg);
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-teal);
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.option-btn:hover:not(:disabled) {
    background: #f8fffe;
    border-color: var(--primary-teal);
    color: var(--primary-teal);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(22, 199, 154, 0.15);
}

.option-btn:hover:not(:disabled)::before {
    transform: scaleY(1);
}

.option-btn:active:not(:disabled) {
    transform: translateX(2px);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.option-btn.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08)) !important;
    border-color: #10b981 !important;
    color: #047857 !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

.option-btn.correct::before {
    background: #10b981;
    transform: scaleY(1);
}

.option-btn.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08)) !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

.option-btn.wrong::before {
    background: #ef4444;
    transform: scaleY(1);
}

.option-btn.selected {
    background: linear-gradient(135deg, rgba(22, 199, 154, 0.12), rgba(22, 199, 154, 0.05));
    border-color: var(--primary-teal);
    color: var(--primary-teal);
    font-weight: 600;
}

.option-btn.selected::before {
    transform: scaleY(1);
}

/* Improved Modern Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    min-height: 600px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-md);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
    background: linear-gradient(to bottom, #fafbfc, #ffffff);
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-blue), #1e40af);
    color: white;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    color: white;
}

.message-content {
    padding: 1.2rem 1.5rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
    position: relative;
    max-width: 100%;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-blue), #1e40af);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: white;
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

.chat-input-area {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input-area input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 48px;
    resize: none;
}

.chat-input-area input:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(22, 199, 154, 0.1);
}

.chat-input-area button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(22, 199, 154, 0.3);
    flex-shrink: 0;
}

.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(22, 199, 154, 0.4);
}

.chat-input-area button:active {
    transform: scale(0.95);
}

/* Mobile Responsiveness for Chat */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 200px);
        min-height: 500px;
    }

    .message {
        max-width: 90%;
    }

    .chat-messages {
        padding: 1rem;
        gap: 1rem;
    }

    .chat-input-area {
        padding: 1rem;
    }

    .chat-input-area input {
        padding: 0.8rem 1.2rem;
        min-height: 44px;
    }

    .chat-input-area button {
        width: 44px;
        height: 44px;
    }
}