/* ========================================
   Central Exam - Premium Styles
   Modern, Beautiful, Responsive Design
   ======================================== */

:root {
    /* Colors - Premium Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Global Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ========================================
   Utilities
   ======================================== */

.hidden {
    display: none !important;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.975rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========================================
   Landing Page
   ======================================== */

.hero-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
}

.navbar {
    padding: 1.5rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-brand i {
    font-size: 2rem;
}

.nav-actions {
    display: flex;
    gap: var(--spacing-md);
}

.hero-content {
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-2xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-2xl);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: var(--spacing-xs);
}

/* ========================================
   Features Section
   ======================================== */

.features-section {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-2xl);
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.feature-card {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    margin-bottom: var(--spacing-md);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   Pricing Section
   ======================================== */

/* ========================================
   Pricing Section (Compact & Royal)
   ======================================== */

.pricing-section {
    padding: 3rem 0;
    /* Reduced from 5rem */
    background: var(--bg-secondary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-lg);
    /* Reduced gap */
    max-width: 900px;
    /* Tighter container */
    margin: 0 auto;
}

.price-card {
    background: white;
    padding: var(--spacing-xl);
    /* Reduced from 2xl */
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.price-card.featured {
    border: 2px solid var(--primary);
    transform: scale(1.02);
    /* Less aggressive scale */
    background: linear-gradient(to bottom, #fff, #f8faff);
}

.price-card .badge {
    position: absolute;
    top: -10px;
    right: 15px;
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    /* Gold Gradient */
    color: #8a6c08;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.plan-name {
    font-size: 1.25rem;
    /* Reduced from 1.5 */
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.plan-price {
    font-size: 2.25rem;
    /* Reduced from 3rem */
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
    letter-spacing: -1px;
}

.plan-price span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: normal;
}

.plan-features {
    list-style: none;
    margin-bottom: var(--spacing-lg);
}

.plan-features li {
    padding: 0.5rem 0;
    /* Compact padding */
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.95rem;
}

.plan-features i {
    color: var(--success);
    font-size: 0.85rem;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* ========================================
   Auth Pages
   ======================================== */

.auth-page {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: var(--spacing-xl);
}

.auth-page.active {
    display: flex;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ========================================
   Dashboard
   ======================================== */

.dashboard-page {
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.dashboard-page.active {
    display: grid;
}

.sidebar {
    background: white;
    border-right: 1px solid rgba(99, 102, 241, 0.2);
    /* Royal Border Color */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: var(--spacing-xl);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.875rem var(--spacing-md);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background: linear-gradient(to right, #eef2ff, white);
    /* Subtle Hover Effect */
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

/* --- Subscription Hero (Compact) --- */
.subscription-hero {
    max-width: 900px;
    margin: 0 auto var(--spacing-xl) auto;
    padding: var(--spacing-xl) !important;
    /* Reduced padding */
    text-align: center;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.subscription-hero h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.trial-banner {
    color: white;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-block;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.dashboard-main {
    background: var(--bg-secondary);
    overflow-y: auto;
}

.dashboard-header {
    background: white;
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-title-group h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.status-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.status-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Badge Variants */
.badge-plan {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    border: 1px solid rgba(67, 56, 202, 0.1);
}

.badge-plan.premium {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #db2777;
    border: 1px solid rgba(219, 39, 119, 0.1);
}

.badge-exam {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.1);
}

.badge-lang {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #c2410c;
    border: 1px solid rgba(194, 65, 12, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-text {
    text-align: right;
    display: none;
    /* Hidden on mobile */
}

@media (min-width: 768px) {
    .user-text {
        display: block;
    }
}

.user-text span {
    display: block;
}

.user-text #userName {
    font-weight: 700;
    font-size: 0.9rem;
}

.user-text .user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
    font-size: 1.2rem;
}

.dashboard-content {
    padding: var(--spacing-xl);
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.welcome-card {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-lg);
    /* Reduced from 2xl */
    border-radius: var(--radius-lg);
    /* Reduced radius */
    margin-bottom: var(--spacing-lg);
    /* Reduced margin */
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

.welcome-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 40%);
    pointer-events: none;
}

.welcome-card h2 {
    font-size: 1.5rem;
    /* Reduced from 2rem */
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    /* Reduced margin */
    position: relative;
    z-index: 1;
}

.welcome-card p {
    position: relative;
    z-index: 1;
    opacity: 0.9;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    /* Reduced min-width */
    gap: var(--spacing-md);
    /* Reduced gap */
    margin-bottom: var(--spacing-lg);
    /* Reduced margin */
}

.stat-card {
    background: white;
    padding: var(--spacing-md);
    /* Reduced from xl */
    border-radius: var(--radius);
    /* Reduced radius */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    /* Reduced gap */
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-card .stat-icon {
    width: 48px;
    /* Reduced from 60px */
    height: 48px;
    /* Reduced from 60px */
    background: #f1f5f9;
    color: #64748b;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    /* Reduced from 1.75rem */
    color: var(--primary);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    /* Reduced from 2rem */
    font-weight: 800;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.action-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.action-card i {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacing-md);
}

.action-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.action-card p {
    color: var(--text-secondary);
}

/* ========================================
   AI Chat
   ======================================== */

.chat-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.chat-message {
    display: flex;
    gap: var(--spacing-md);
    max-width: 80%;
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message-content {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.chat-message.user .message-content {
    background: var(--gradient-primary);
    color: white;
}

.chat-input-container {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--spacing-md);
}

.chat-input {
    flex: 1;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Responsive Design */
.mobile-menu-btn,
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .dashboard-page {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 9999;
        /* Highest priority */
        background: white;
        border-radius: 50%;
        width: 50px;
        /* Slightly larger */
        height: 50px;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
        /* Stronger shadow */
        border: 2px solid var(--primary);
        /* Visible border */
        color: var(--primary);
        font-size: 1.25rem;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s;
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
    }

    /* Adjust header to account for fixed button */
    .dashboard-header {
        padding-left: 80px !important;
        /* More space for button */
        padding-right: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        min-height: 80px;
        /* Taller header */
        flex-direction: column;
        /* Stack items */
        align-items: flex-start;
        /* Left align */
        justify-content: center;
        gap: 10px;
    }

    .header-left {
        width: 100%;
    }

    .header-title-group {
        width: 100%;
    }

    .header-title-group h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .status-badges {
        flex-wrap: wrap;
        /* Allow badges to wrap */
        gap: 5px;
        /* Tighter gap */
    }

    .status-app-badge {
        font-size: 0.65rem;
        /* Smaller badges */
        padding: 4px 8px;
    }

    .header-right {
        position: absolute;
        top: 20px;
        right: 15px;
    }

    .sidebar {
        display: flex;
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        /* Wider sidebar */
        height: 100vh;
        z-index: 10000;
        /* Above everything */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        /* Darker overlay */
        backdrop-filter: blur(2px);
        z-index: 9998;
        /* Just below sidebar/button */
    }

    .sidebar-overlay.active {
        display: block;
    }

    .nav-actions {
        gap: var(--spacing-sm);
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   Question Interface
   ======================================== */

.test-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.test-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.test-info {
    display: flex;
    gap: 2rem;
    font-size: 1rem;
    font-weight: 500;
}

.question-container {
    background: white;
    padding: 1.5rem;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    margin-bottom: 0;
    /* Remove gap */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    border-bottom: 1px solid var(--border);
    /* Separator */
    position: relative;
    z-index: 2;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: auto;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option {
    padding: 0.85rem 1.25rem;
    border: 1.5px solid #cbd5e1;
    /* Royal Slate Grey */
    border-radius: 12px;
    /* Softer pills */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    position: relative;
    overflow: hidden;
}

.option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.option label {
    flex: 1;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.option.selected {
    border-color: var(--primary);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    /* Glow effect */
}

.navigation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--text-secondary);
    color: white;
    border-color: var(--text-secondary);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.question-grid {
    background: #f8fafc;
    /* Slightly different bg for contrast */
    padding: 1.25rem;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    border-top: none;
    margin-top: 0;
}

.question-grid h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.grid-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    /* Circle */
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    background: var(--bg-secondary);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.grid-item:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.grid-item.answered {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

.grid-item.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .test-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .test-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question-container {
        padding: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .grid-item {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   Physical Guidance
   ======================================== */

.phy-form-container {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto var(--spacing-xl);
}

.phy-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.physical-results {
    animation: slideIn 0.5s ease-out;
}

.physical-status-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    color: white;
}

.physical-status-card.eligible {
    background: var(--gradient-success);
}

.physical-status-card.needs-work {
    background: var(--gradient-secondary);
}

.physical-status-card .status-icon {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.phy-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.phy-card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    color: white;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.phy-card-header.diet {
    background: var(--success);
}

.phy-card-header.workout {
    background: var(--info);
}

.phy-card-body {
    padding: var(--spacing-lg);
}

.markdown-content ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Features Grid Fix */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-content: center;
    margin-top: 40px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

/* Mobile Navbar Controls */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .btn-sm {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* ================= Mobile Responsiveness ================= */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
    }

    .stat {
        flex: 1 1 45%;
    }

    /* Mobile Menu */
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
    }

    .nav-actions {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #0f172a;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .nav-actions.active {
        display: flex;
    }

    .nav-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-menu-btn {
    display: none;
}

/* === HOTFIXES === */
.gradient-text {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
}

.features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr !important;
    }
}

/* === HERO BUTTON FIX === */
.hero-header .btn-outline {
    color: white !important;
    border-color: white !important;
}

.hero-header .btn-outline:hover {
    background: white !important;
    color: var(--primary) !important;
}

/* ========================================
   ROYAL THEME OVERRIDES & NEW HEADER
   ======================================== */

:root {
    --royal-blue: #1e3a8a;
    --royal-gold: #fbbf24;
    --royal-purple: #581c87;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    --header-height: 80px;
}

/* Royal Header */
.royal-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    z-index: 1000;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header-title-group h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.2;
}

.plan-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    align-self: flex-start;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.plan-badge.premium {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/* Exam Switcher */
.exam-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.exam-switcher label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.exam-switcher select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

/* User Profile Enhanced */
.user-info {
    border-left: 1px solid #e2e8f0;
    padding-left: var(--spacing-lg);
}

.user-text {
    display: flex;
    flex-direction: column;
    text-align: right;
    margin-right: 10px;
}

.user-text #userName {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
}

.user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* Dashboard Cards - Glass Effect */
.stat-card,
.welcome-card,
.action-card {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.welcome-card {
    background: linear-gradient(120deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.welcome-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
    transform: skewX(-20deg);
}