/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C63FF;
    --secondary: #FF6584;
    --success: #00D9A3;
    --warning: #FFC107;
    --dark: #2D3748;
    --light: #F7FAFC;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* Fixed Header - Consistent height before and after login */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    min-height: 80px; /* FIXED: Ensure minimum height */
    background: rgba(255,255,255,0.95);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    gap: 1rem;
    align-items: center; /* FIXED: Ensure vertical alignment */
    min-height: 50px; /* FIXED: Match button heights */
}

.header-right {
    display: flex;
    align-items: center; /* FIXED: Ensure vertical alignment */
    min-height: 50px; /* FIXED: Match logo height */
}

.btn-auth {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    height: 40px; /* FIXED: Explicit height */
    line-height: 1; /* FIXED: Prevent text from affecting height */
}

.btn-auth:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ---- LOGO (centered) ------------------------------------------ */
.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 145px;
    height: auto;
    max-width: 145px;
    z-index: 10;
}

.profile-badge {
    display: flex; /* FIXED: Changed from position:fixed */
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 0.3s;
}

.profile-badge:hover {
    transform: scale(1.1);
}

.profile-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ===== NAVIGATION MENU ===== */

/* Navigation Toggle Button (Always visible - PC and Mobile) */
.nav-toggle {
    display: flex;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.nav-toggle:hover {
    background: #5a52d5;
    transform: scale(1.05);
}

/* Navigation Menu - Hidden by default, shown on toggle */
.nav-menu {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 280px;
    max-height: calc(100vh - 80px);
    background: white;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.nav-menu.active {
    right: 0;
}

.nav-link {
    padding: 1rem 1.5rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: #f8f9fa;
    color: var(--primary);
    padding-left: 2rem;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.1), transparent);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
        min-height: 70px; /* FIXED: Slightly smaller on mobile but still consistent */
    }
    
    .btn-auth {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
        height: 36px; /* FIXED: Smaller on mobile */
    }
    
    .logo {
        width: 120px; /* FIXED: Smaller on mobile */
        height: auto;
    }
    
    .profile-badge {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    /* Mobile Navigation - Adjust positioning */
    .nav-menu {
        top: 70px;
        width: 250px;
        max-height: calc(100vh - 70px);
    }
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    color: white;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-slogan {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.card-subtitle {
    color: #718096;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-card {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-card:hover {
    background: #5a52d5;
    transform: scale(1.05);
}

/* Pricing Section */
.pricing-section {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.pricing-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-popular {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
}

.popular-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--warning);
    color: var(--dark);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-duration {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.plan-price {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.btn-plan {
    width: 100%;
    padding: 0.75rem;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pricing-popular .btn-plan {
    background: white;
    color: var(--primary);
}

.btn-plan:hover {
    transform: scale(1.05);
}

/* Footer */
.footer {
    background: rgba(0,0,0,0.1);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close:hover {
    color: var(--dark);
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: #f0f0f0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
}

.btn-google {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-google:hover {
    background: #f8f8f8;
    border-color: var(--primary);
}

.input-field {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #5a52d5;
}

/* Chapter List */
.chapter-list {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.chapter-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.chapter-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.lock-icon {
    font-size: 1.5rem;
}

/* =====================================================
   QUIZ & MOCK TEST INTERFACE - COMPLETE MOBILE FIX
   Replace the existing quiz/mock test styles in styles.css
   ===================================================== */

/* ===== QUIZ INTERFACE STYLES ===== */

/* Quiz Setup Screen */
.quiz-setup {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.quiz-setup h1 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 2rem;
}

.set-selector {
    margin: 2rem 0;
    text-align: left;
}

.set-selector label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.set-selector select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.set-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Quiz Container - Enhanced */
.quiz-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Quiz Header - Improved Layout */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin-bottom: 1.5rem;
}

.question-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Progress Bar - Enhanced */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

/* Question Content Area */
.question-content {
    padding: 1.5rem 0;
}

.question-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--dark);
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
}

/* Options Container - Better Spacing */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    padding: 1.25rem 1.5rem;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 60px;
}

.option::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.option:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    transform: translateX(5px);
}

.option.selected {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(108, 99, 255, 0.05));
    border-color: var(--primary);
    border-width: 3px;
    font-weight: 600;
}

.option.selected::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

/* Answer Review States */
.option.correct-answer {
    background: linear-gradient(135deg, rgba(0, 217, 163, 0.15), rgba(0, 217, 163, 0.05)) !important;
    border-color: var(--success) !important;
    border-width: 3px;
}

.option.correct-answer::before {
    content: '✓';
    background: var(--success);
    border-color: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.option.wrong-answer {
    background: linear-gradient(135deg, rgba(255, 101, 132, 0.15), rgba(255, 101, 132, 0.05)) !important;
    border-color: var(--secondary) !important;
    border-width: 3px;
}

.option.wrong-answer::before {
    content: '✗';
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Explanation Box */
.explanation {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff3cd 0%, #fffaed 100%);
    border-left: 5px solid var(--warning);
    border-radius: 10px;
    line-height: 1.8;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.explanation strong {
    color: var(--warning);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Quiz Navigation - Enhanced */
.quiz-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.btn-nav {
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-nav:active {
    transform: translateY(0);
}

.btn-prev {
    background: white;
    color: var(--dark);
    border: 2px solid #e2e8f0;
}

.btn-prev:hover {
    background: #f8f9fa;
    border-color: var(--primary);
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-next {
    background: linear-gradient(135deg, var(--primary), #5a52d5);
    color: white;
}

.btn-next:hover {
    background: linear-gradient(135deg, #5a52d5, var(--primary));
}

.btn-submit {
    background: linear-gradient(135deg, var(--success), #00b386);
    color: white;
    grid-column: span 3;
    font-size: 1.1rem;
    padding: 1.25rem;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #00b386, var(--success));
}

/* Question Palette - Improved */
.question-palette {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 2rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.question-palette h3 {
    margin-bottom: 1rem;
    color: var(--dark);
    font-size: 1.1rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.75rem;
}

.palette-btn {
    aspect-ratio: 1;
    border: 2px solid #cbd5e0;
    background: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.palette-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.palette-btn.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.palette-btn.answered {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.palette-btn.marked {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

.palette-btn.answered-marked {
    background: linear-gradient(135deg, var(--success) 50%, var(--warning) 50%);
    color: white;
    border: 2px solid var(--success);
}

.palette-btn.not-answered {
    background: white;
    color: var(--dark);
    border-color: #cbd5e0;
}

.palette-btn.not-visited {
    background: #f8f9fa;
    color: #718096;
    border-color: #e2e8f0;
}

.palette-btn.flagged {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* Score Container - Enhanced */
.score-container {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 700px;
    margin: 2rem auto;
    box-shadow: var(--shadow-lg);
}

.score-container h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.3);
    position: relative;
}

.score-circle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--success);
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0; }
}

.score-details {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.score-stat {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.1rem;
}

.score-stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #718096;
}

.stat-value {
    font-weight: 700;
    font-size: 1.2rem;
}

.stat-value.correct {
    color: var(--success);
}

.stat-value.incorrect {
    color: var(--secondary);
}

.stat-value.unanswered {
    color: #718096;
}

.score-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.score-actions button {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ===== MOCK TEST INTERFACE STYLES ===== */

.mock-test-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Mock Test Header - Fixed and Enhanced */
.mock-test-header {
    background: white;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary);
}

.test-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.test-info h2 {
    margin: 0;
    color: var(--dark);
    font-size: 1.5rem;
}

.test-pattern {
    background: linear-gradient(135deg, var(--primary), #5a52d5);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.test-timer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fff3cd 0%, #fffaed 100%);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.timer-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.timer-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    font-family: 'Courier New', monospace;
    min-width: 80px;
    text-align: center;
}

/* Mock Test Container - Better Grid */
.mock-test-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Test Main Section - Enhanced */
.test-main {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.question-section {
    min-height: 450px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.question-num {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.marks {
    font-weight: 700;
    background: linear-gradient(135deg, var(--success), #00b386);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 217, 163, 0.3);
}

.question-body {
    margin: 2rem 0;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--dark);
    padding: 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
}

/* Options List for Mock Test */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
}

.option-item:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    transform: translateX(5px);
}

.option-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.option-item label {
    flex: 1;
    cursor: pointer;
    line-height: 1.6;
    font-size: 1rem;
}

.option-item:has(input:checked) {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(108, 99, 255, 0.05));
    border-color: var(--primary);
    border-width: 3px;
}

.option-item:has(input:checked) label {
    color: var(--primary);
    font-weight: 600;
}

/* Question Actions */
.question-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.action-btn {
    padding: 1rem 1.5rem;
    background: white;
    border: 3px solid var(--primary);
    color: var(--primary);
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* Navigation Controls - Enhanced */
.navigation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.nav-btn {
    padding: 1.25rem;
    background: #e2e8f0;
    color: var(--dark);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary), #5a52d5);
    color: white;
}

.nav-btn.primary:hover {
    background: linear-gradient(135deg, #5a52d5, var(--primary));
}

/* Test Sidebar - Enhanced */
.test-sidebar {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-of-type {
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 1.2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.section-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-count.answered {
    color: var(--success);
}

.stat-count.not-answered {
    color: var(--secondary);
}

.stat-count.marked {
    color: var(--warning);
}

.stat-count.not-visited {
    color: #718096;
}

.stat-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
}

/* Question Grid - Enhanced */
.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.grid-question-btn {
    aspect-ratio: 1;
    border: 2px solid #cbd5e0;
    background: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.grid-question-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.grid-question-btn.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.grid-question-btn.answered {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.grid-question-btn.marked {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

.grid-question-btn.answered-marked {
    background: linear-gradient(135deg, var(--success) 50%, var(--warning) 50%);
    color: white;
    border: 2px solid var(--success);
}

.grid-question-btn.not-visited {
    background: #f8f9fa;
    color: #718096;
}

/* Submit Test Button - Enhanced */
.submit-test-btn {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--secondary), #e54567);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(255, 101, 132, 0.3);
}

.submit-test-btn:hover {
    background: linear-gradient(135deg, #e54567, var(--secondary));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 101, 132, 0.4);
}

/* ===== MOBILE RESPONSIVE FIXES ===== */

@media (max-width: 768px) {
    
    /* Quiz Setup */
    .quiz-setup {
        padding: 2rem 1.5rem;
    }
    
    .quiz-setup h1 {
        font-size: 1.5rem;
    }
    
    /* Quiz Container */
    .quiz-container {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    /* Quiz Header */
    .quiz-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .question-number,
    .timer {
        font-size: 1rem;
    }
    
    .timer {
        padding: 0.4rem 0.75rem;
    }
    
    /* Question Text */
    .question-text {
        font-size: 1.05rem;
        line-height: 1.6;
        padding: 1rem;
    }
    
    /* Options */
    .options-container {
        gap: 0.75rem;
    }
    
    .option {
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 50px;
    }
    
    .option::before {
        width: 18px;
        height: 18px;
        margin-right: 0.75rem;
    }
    
    /* Navigation */
    .quiz-navigation {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .btn-nav {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    .btn-submit {
        grid-column: span 1;
        padding: 1rem;
    }
    
    /* Palette */
    .question-palette {
        padding: 1rem;
    }
    
    .palette-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .palette-btn {
        font-size: 0.9rem;
    }
    
    /* Score Container */
    .score-container {
        padding: 2rem 1.5rem;
    }
    
    .score-container h1 {
        font-size: 1.8rem;
    }
    
    .score-circle {
        width: 160px;
        height: 160px;
        font-size: 2.5rem;
    }
    
    .score-details {
        padding: 1.5rem;
    }
    
    .score-stat {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .score-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Mock Test Header */
    .mock-test-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        align-items: stretch;
    }
    
    .test-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .test-info h2 {
        font-size: 1.3rem;
    }
    
    .test-pattern {
        align-self: flex-start;
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }
    
    .test-timer {
        justify-content: center;
        padding: 0.6rem 1rem;
    }
    
    .timer-label {
        font-size: 0.85rem;
    }
    
    .timer-value {
        font-size: 1.3rem;
        min-width: 70px;
    }
    
    /* Mock Test Container */
    .mock-test-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.75rem;
    }
    
    /* Test Main */
    .test-main {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .question-section {
        min-height: auto;
    }
    
    /* Question Header */
    .question-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .question-num {
        font-size: 1rem;
    }
    
    .marks {
        font-size: 0.85rem;
        padding: 0.3rem 0.75rem;
    }
    
    /* Question Body */
    .question-body {
        margin: 1.5rem 0;
    }
    
    .question-text {
        font-size: 1.05rem;
        line-height: 1.6;
        padding: 1rem;
    }
    
    /* Options List */
    .options-list {
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .option-item {
        padding: 1rem;
        gap: 0.75rem;
        min-height: 50px;
    }
    
    .option-item input[type="radio"] {
        width: 18px;
        height: 18px;
    }
    
    .option-item label {
        font-size: 0.95rem;
    }
    
    /* Question Actions */
    .question-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .action-btn {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    /* Navigation Controls */
    .navigation-controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .nav-btn {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    /* Test Sidebar */
    .test-sidebar {
        position: static;
        padding: 1.5rem;
        margin-top: 0;
    }
    
    .sidebar-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .section-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-count {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Question Grid */
    .question-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .grid-question-btn {
        font-size: 0.9rem;
    }
    
    /* Submit Button */
    .submit-test-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Extra Small Devices (320px to 480px) */
@media (max-width: 480px) {
    
    /* Quiz Setup */
    .quiz-setup {
        padding: 1.5rem 1rem;
    }
    
    .quiz-setup h1 {
        font-size: 1.3rem;
    }
    
    /* Quiz Container */
    .quiz-container {
        padding: 1rem;
    }
    
    /* Progress Bar */
    .progress-bar {
        height: 6px;
        margin-bottom: 1.5rem;
    }
    
    /* Question Text */
    .question-text {
        font-size: 1rem;
        padding: 0.85rem;
    }
    
    /* Options */
    .option {
        padding: 0.85rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    .option::before {
        width: 16px;
        height: 16px;
        margin-right: 0.6rem;
    }
    
    /* Palette */
    .palette-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }
    
    .palette-btn {
        font-size: 0.85rem;
    }
    
    /* Score Circle */
    .score-circle {
        width: 140px;
        height: 140px;
        font-size: 2.2rem;
    }
    
    .score-details {
        padding: 1rem;
    }
    
    .score-stat {
        font-size: 0.95rem;
    }
    
    /* Mock Test Header */
    .test-info h2 {
        font-size: 1.2rem;
    }
    
    .timer-value {
        font-size: 1.2rem;
        min-width: 65px;
    }
    
    /* Test Main */
    .test-main {
        padding: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
        padding: 0.85rem;
    }
    
    /* Options List */
    .option-item {
        padding: 0.85rem;
        min-height: 48px;
    }
    
    .option-item input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    
    .option-item label {
        font-size: 0.9rem;
    }
    
    /* Question Grid */
    .question-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }
    
    /* Section Stats */
    .section-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.85rem;
    }
}

/* Landscape Mode Optimizations */
@media (max-width: 900px) and (orientation: landscape) {
    
    .quiz-container {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .mock-test-header {
        padding: 0.75rem 1rem;
    }
    
    .test-info h2 {
        font-size: 1.2rem;
    }
    
    .question-text {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .score-circle {
        width: 140px;
        height: 140px;
        font-size: 2.2rem;
        margin: 1.5rem auto;
    }
}

/* Tablet Specific (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    
    .mock-test-container {
        grid-template-columns: 1fr;
    }
    
    .test-sidebar {
        position: static;
        max-width: 100%;
    }
    
    .question-grid,
    .palette-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .section-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quiz-navigation {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .btn-submit {
        grid-column: span 3;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .mock-test-header,
    .test-timer,
    .navigation-controls,
    .question-actions,
    .test-sidebar,
    .quiz-navigation,
    .question-palette {
        display: none !important;
    }
    
    .mock-test-container {
        grid-template-columns: 1fr;
    }
    
    .test-main,
    .quiz-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .option,
    .option-item {
        page-break-inside: avoid;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus Visible for Keyboard Navigation */
.option:focus-visible,
.palette-btn:focus-visible,
.grid-question-btn:focus-visible,
.btn-nav:focus-visible,
.action-btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .option,
    .option-item,
    .palette-btn,
    .grid-question-btn {
        border-width: 3px;
    }
    
    .option.selected,
    .palette-btn.current,
    .grid-question-btn.current {
        border-width: 4px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .option,
    .option-item,
    .btn-nav,
    .action-btn,
    .palette-btn,
    .grid-question-btn,
    .score-circle::after {
        transition: none;
        animation: none;
    }
}

/* ===== LOADING STATES ===== */

.question-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.question-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== UTILITY CLASSES ===== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ===== END OF QUIZ & MOCK TEST STYLES ===== */

/* Profile Page Styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-lg);
}

.profile-greeting {
    font-size: 2rem;
    color: var(--dark);
    margin: 0;
}

.profile-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.subscription-card {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 15px;
}

.subscription-active, .subscription-inactive {
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.status-active {
    background: var(--success);
    color: white;
}

.status-inactive {
    background: var(--secondary);
    color: white;
}

.subscription-detail {
    margin: 0.5rem 0;
    color: #718096;
}

.subscription-active h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 1rem 0;
}

/* Quiz Palette Styles */
.question-palette {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.question-palette h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.palette-btn {
    aspect-ratio: 1;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.palette-btn.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.palette-btn.answered {
    background: var(--success);
    color: white;
}

.palette-btn.flagged {
    background: var(--warning);
    color: white;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.3s;
}

.correct-answer {
    background: #d4edda !important;
    border-color: var(--success) !important;
}

.wrong-answer {
    background: #f8d7da !important;
    border-color: var(--secondary) !important;
}

.explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    border-radius: 5px;
    line-height: 1.6;
}

.score-stat {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.score-stat:last-child {
    border-bottom: none;
}

/* Responsive Design for Mock Test */
@media (max-width: 1024px) {
    .mock-test-container {
        grid-template-columns: 1fr;
    }
    
    .test-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .mock-test-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .test-pattern {
        margin-left: 0;
    }
    
    .question-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .navigation-controls {
        flex-direction: column;
    }
    
    .section-stats {
        grid-template-columns: 1fr;
    }
}

/* Add these styles to your existing styles.css */

/* Unlocked Badge Styles */
.unlocked-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00D9A3, #00B386);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 217, 163, 0.3);
    animation: unlockPulse 2s ease-in-out infinite;
}

@keyframes unlockPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 217, 163, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 217, 163, 0.5);
    }
}

/* Remove opacity from unlocked items */
.chapter-item:not(.locked),
.mocktest-card:not(.locked),
.notes-card:not(.locked) {
    opacity: 1;
    cursor: pointer;
}

/* Add green glow to unlocked items on hover */
.chapter-item:not(.locked):hover,
.mocktest-card:not(.locked):hover,
.notes-card:not(.locked):hover {
    box-shadow: 0 8px 24px rgba(0, 217, 163, 0.2);
    border: 2px solid rgba(0, 217, 163, 0.3);
}

/* Free badge styling enhancement */
.free-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFC107, #FFA000);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Lock icon enhancement */
.lock-icon {
    font-size: 1.5rem;
    color: #CBD5E0;
    filter: grayscale(100%);
}

/* Chapter subtitle enhancement */
.chapter-subtitle {
    font-size: 0.9rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Success state for unlocked content */
.content-unlocked {
    position: relative;
}

.content-unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #00D9A3, #00B386);
    border-radius: 10px 10px 0 0;
}

/* Subscription active indicator */
.subscription-indicator {
    position: fixed;
    top: 80px;
    right: 2rem;
    background: linear-gradient(135deg, #00D9A3, #00B386);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 217, 163, 0.3);
    z-index: 999;
    display: none;
    animation: slideInFromRight 0.5s ease-out;
}

.subscription-indicator.active {
    display: block;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(300px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced locked state */
.chapter-item.locked,
.mocktest-card.locked,
.notes-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
    filter: grayscale(50%);
}

.chapter-item.locked::after,
.mocktest-card.locked::after,
.notes-card.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: inherit;
    pointer-events: none;
}

/* Unlock animation */
@keyframes unlockAnimation {
    0% {
        opacity: 0.5;
        filter: grayscale(50%);
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        filter: grayscale(0%);
        transform: scale(1);
    }
}

.content-unlocking {
    animation: unlockAnimation 0.6s ease-out forwards;
}

/* ============================================
   BIOBRAINZ MOBILE OPTIMIZATION PATCH
   Add this to the END of your styles.css file
   ============================================ */

/* ===== MOBILE-FIRST RESPONSIVE BREAKPOINTS ===== */

/* Extra Small Devices (phones, 320px to 480px) */
@media (max-width: 480px) {
    
    /* ----- HEADER FIXES ----- */
    .header {
        padding: 0.75rem 1rem;
        min-height: 65px;
        gap: 0.5rem;
    }
    
    .header-left {
        flex: 0 0 auto;
        min-width: 80px;
    }
    
    .header-right {
        flex: 0 0 auto;
    }
    
    /* Logo - Smaller and centered with flexbox */
    .logo {
        height: 70px;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 50%;
        margin-top: -35px; /* Half of height */
    }
    
    .btn-auth {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        height: 32px;
        white-space: nowrap;
    }
    
    .profile-badge {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* ----- HERO SECTION ----- */
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-slogan {
        font-size: 1rem;
    }
    
    /* ----- CONTAINER ----- */
    .container {
        padding: 1rem 0.75rem;
    }
    
    /* ----- CARDS GRID ----- */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .card-subtitle {
        font-size: 0.9rem;
    }
    
    /* ----- PRICING ----- */
    .pricing-section {
        padding: 2rem 1rem;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pricing-card {
        padding: 1.5rem;
    }
    
    .pricing-popular {
        transform: scale(1);
        margin-bottom: 1rem;
    }
    
    .plan-price {
        font-size: 2.5rem;
    }
    
    /* ----- AUTH MODAL ----- */
    .modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .auth-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .auth-tab {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .input-field {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    #recaptcha-container {
        transform: scale(0.85);
        transform-origin: 0 0;
        margin-bottom: 1rem;
    }
    
    /* ----- CHAPTER LIST ----- */
    .chapter-list {
        padding: 1.5rem;
    }
    
    .chapter-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .chapter-item h3 {
        font-size: 1.1rem;
    }
    
    .chapter-subtitle {
        font-size: 0.85rem;
    }
    
    .chapter-arrow,
    .lock-icon {
        align-self: flex-end;
        font-size: 1.2rem;
    }
    
    /* ----- QUIZ INTERFACE ----- */
    .quiz-container {
        padding: 1rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .question-number,
    .timer {
        font-size: 1rem;
    }
    
    .question-text {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .options-container {
        gap: 0.75rem;
    }
    
    .option {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-nav {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .question-palette {
        padding: 1rem;
    }
    
    .palette-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }
    
    .palette-btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    /* ----- MOCK TEST INTERFACE ----- */
    .mock-test-header {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .test-info h2 {
        font-size: 1.3rem;
    }
    
    .test-pattern {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
        margin-left: 0.5rem;
    }
    
    .test-timer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .timer-label {
        font-size: 0.85rem;
    }
    
    .timer-value {
        font-size: 1.3rem;
    }
    
    .mock-test-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .test-main {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .question-section {
        min-height: auto;
    }
    
    .question-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .question-body {
        margin: 1rem 0;
    }
    
    .question-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .options-list {
        gap: 0.75rem;
    }
    
    .option-item {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .option-item label {
        font-size: 0.95rem;
    }
    
    .question-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav-btn {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .test-sidebar {
        position: static;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .section-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-count {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .question-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }
    
    .grid-question-btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .submit-test-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* ----- RESULT MODAL ----- */
    .result-content {
        padding: 1rem;
    }
    
    .result-content h1 {
        font-size: 1.5rem;
    }
    
    .score-big {
        font-size: 2.5rem;
    }
    
    .result-breakdown {
        padding: 1rem;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .result-actions button {
        width: 100%;
    }
    
    /* ----- NOTES GRID ----- */
    .notes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .notes-card {
        padding: 1.5rem;
    }
    
    .notes-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .notes-btn {
        font-size: 0.85rem;
    }
    
    /* ----- PROFILE PAGE ----- */
    .profile-header {
        padding: 2rem 1rem;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .profile-greeting {
        font-size: 1.5rem;
    }
    
    .profile-section {
        padding: 1.5rem;
    }
    
    .subscription-card {
        padding: 1.5rem;
    }
    
    /* ----- TOAST NOTIFICATIONS ----- */
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    /* ----- SUBSCRIPTION INDICATOR ----- */
    .subscription-indicator {
        top: 70px;
        right: 1rem;
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    /* ----- SCORE CONTAINER ----- */
    .score-container {
        padding: 1.5rem;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
        font-size: 2.5rem;
    }
    
    .score-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .score-actions button {
        width: 100%;
    }
    
    /* ----- FOOTER ----- */
    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* ----- PAGE HEADER ----- */
    .page-header {
        text-align: center;
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header p {
        font-size: 0.95rem;
    }
    
    /* ----- MARKING SCHEME ----- */
    .marking-scheme {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .scheme-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Small Devices (phones landscape, 481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    
    .hero-title {
        font-size: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .question-grid,
    .palette-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .notes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Devices (tablets, 768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mock-test-container {
        grid-template-columns: 1fr;
    }
    
    .test-sidebar {
        position: static;
    }
    
    .question-grid,
    .palette-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* ===== TOUCH-FRIENDLY ENHANCEMENTS ===== */

@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for touch devices */
    
    .btn-auth,
    .btn-card,
    .btn-primary,
    .btn-plan,
    .action-btn,
    .nav-btn {
        min-height: 44px; /* Apple's recommended minimum */
    }
    
    .option,
    .option-item {
        min-height: 50px;
    }
    
    .palette-btn,
    .grid-question-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .chapter-item:hover,
    .option:hover {
        transform: none;
    }
    
    /* Add active state for better feedback */
    .btn-auth:active,
    .btn-card:active,
    .btn-primary:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* ===== LANDSCAPE ORIENTATION FIXES ===== */

@media (max-width: 768px) and (orientation: landscape) {
    
    .hero {
        padding: 1.5rem 1rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .modal-content {
        margin: 5% auto;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .quiz-container {
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .chapter-item,
    .option {
        border: 2px solid currentColor;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PREVENT ZOOM ON INPUT FOCUS (iOS Safari) ===== */

@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
}

/* ===== SAFE AREA INSETS (iPhone X and newer) ===== */

@supports (padding: max(0px)) {
    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    
    .toast {
        bottom: max(1rem, env(safe-area-inset-bottom));
        left: max(1rem, env(safe-area-inset-left));
        right: max(1rem, env(safe-area-inset-right));
    }
}

/* ===== LOADING STATE IMPROVEMENTS ===== */

.spinner {
    width: 30px;
    height: 30px;
}

@media (max-width: 480px) {
    .spinner {
        width: 25px;
        height: 25px;
    }
}

/* ===== END OF MOBILE OPTIMIZATION PATCH ===== */

/* ===============================================
   TOAST NOTIFICATION SYSTEM - ADD TO END OF STYLES.CSS
   =============================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInUp 0.4s ease-out, fadeOut 0.4s ease-out 2.6s;
    pointer-events: auto;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

/* Toast Types */
.toast.success {
    background: linear-gradient(135deg, #00D9A3, #00B386);
}

.toast.error {
    background: linear-gradient(135deg, #FF6584, #FF4567);
}

.toast.warning {
    background: linear-gradient(135deg, #FFC107, #FFA000);
    color: #2D3748;
}

.toast.info {
    background: linear-gradient(135deg, #6C63FF, #5A52D5);
}

/* Toast Icons */
.toast::before {
    content: '✓';
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.toast.success::before {
    content: '✓';
}

.toast.error::before {
    content: '✕';
}

.toast.warning::before {
    content: '⚠';
}

.toast.info::before {
    content: 'ℹ';
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Hover effect */
.toast:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
        max-width: none;
        font-size: 0.9rem;
        padding: 0.85rem 1.25rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .toast {
        bottom: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }
    
    .toast::before {
        width: 24px;
        height: 24px;
        font-size: 1.2rem;
    }
}

/* Multiple Toast Stacking */
.toast:nth-child(2) {
    bottom: 6rem;
}

.toast:nth-child(3) {
    bottom: 10rem;
}

@media (max-width: 768px) {
    .toast:nth-child(2) {
        bottom: 5rem;
    }
    
    .toast:nth-child(3) {
        bottom: 9rem;
    }
}

/* Progress bar for toast */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    animation: shrink 3s linear;
}

@keyframes shrink {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Safe area for iPhone X and newer */
@supports (padding: max(0px)) {
    .toast {
        bottom: max(2rem, env(safe-area-inset-bottom));
        right: max(2rem, env(safe-area-inset-right));
    }
    
     @media (max-width: 768px) {
        .toast {
            bottom: max(1rem, env(safe-area-inset-bottom));
            right: max(1rem, env(safe-area-inset-right));
            left: max(1rem, env(safe-area-inset-left));
        }
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
        opacity: 1;
    }
    
    .toast-progress::after {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid white;
    }
}
