/* =========================================
   1. MODERN VARIABLES & RESET
   ========================================= */
   :root {
    /* Modern Color Palette */
    --primary: #4F46E5;       /* Indigo */
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --secondary: #10B981;     /* Emerald Green */
    --accent: #F59E0B;        /* Amber */
    
    /* Backgrounds & Surfaces */
    --bg-app: #F8FAFC;        /* Very light gray-blue */
    --surface-white: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.9);
    
    /* Typography Colors */
    --text-main: #1E293B;     /* Dark slate */
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* UI Elements */
    --border-light: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-lg: 16px;
    --radius-md: 12px;
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Smooth Reset */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100dvh; width: 100vw; overflow: hidden; font-family: var(--font-body); background: var(--bg-app); color: var(--text-main); }
button, input, textarea, select { font-family: inherit; outline: none; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Utility Classes */
.hidden { display: none !important; }
.full-width { width: 100%; }
.mt-4 { margin-top: 1rem; }
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-up { animation: fadeUp 0.4s ease-out forwards; }
.fade-in { animation: fadeIn 0.3s ease-out forwards; }

/* Ripple Effect Animation */
.ripple { position: relative; overflow: hidden; transform: translate3d(0, 0, 0); }
.ripple-effect { position: absolute; border-radius: 50%; background-color: rgba(255, 255, 255, 0.3); width: 100px; height: 100px; margin-top: -50px; margin-left: -50px; animation: rippleAnim 0.6s linear; pointer-events: none; }
@keyframes rippleAnim { from { transform: scale(0); opacity: 0.5; } to { transform: scale(2.5); opacity: 0; } }

/* =========================================
   2. AUTH & MODALS (Modernized)
   ========================================= */
.auth-container {
    height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #EFF6FF 100%);
    padding: 20px;
}
.auth-card {
    background: var(--surface-white); padding: 40px; border-radius: 24px; box-shadow: var(--shadow-lg);
    text-align: center; max-width: 400px; width: 100%;
}
.brand-logo { font-family: var(--font-heading); font-size: 28px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.auth-card h1 { font-family: var(--font-heading); margin-bottom: 10px; color: var(--text-main); }
.auth-card p { color: var(--text-muted); margin-bottom: 30px; }
.btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 14px; background: var(--surface-white); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); font-weight: 600; color: var(--text-main);
    transition: all 0.2s; box-shadow: var(--shadow-sm); cursor: pointer;
}
.btn-google:hover { background: #F8FAFC; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-google img { width: 20px; }

/* Modal Styles */
.modal-overlay, .sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); z-index: 1000;
    backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
    transition: opacity 0.3s ease;
}
.sidebar-overlay { z-index: 150; display: none; }
.sidebar-overlay.active { display: block; }

.modal-content {
    background: var(--surface-white); width: 90%; max-width: 450px; border-radius: 20px;
    padding: 30px; box-shadow: var(--shadow-lg); max-height: 90dvh; overflow-y: auto;
}
.modal-header h2 { font-family: var(--font-heading); color: var(--primary); display: flex; align-items: center; gap: 10px; }
.modal-header p { color: var(--text-muted); font-size: 14px; margin-top: 5px; }
.modal-body { margin: 25px 0; }

/* Modern Inputs with Floating Labels */
.input-row { display: flex; gap: 15px; }
.input-group { margin-bottom: 20px; position: relative; flex: 1; }
.label-float input {
    width: 100%; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: var(--radius-md);
    background: #F8FAFC; font-size: 15px; transition: all 0.2s;
}
.label-float label {
    position: absolute; top: 50%; left: 16px; transform: translateY(-50%); color: var(--text-light);
    pointer-events: none; transition: 0.2s all ease-out; font-size: 15px;
}
.label-float input:focus, .label-float input:not(:placeholder-shown) {
    border-color: var(--primary); background: var(--surface-white); box-shadow: 0 0 0 3px var(--primary-light);
}
.label-float input:focus + label, .label-float input:not(:placeholder-shown) + label {
    top: 0; left: 12px; transform: translateY(-50%) scale(0.85); background: var(--surface-white); padding: 0 6px; color: var(--primary);
}
.select-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.styled-select {
    width: 100%; padding: 14px; border: 1px solid var(--border-light); border-radius: var(--radius-md);
    background: #F8FAFC url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 1rem center/1.5em;
    appearance: none; font-size: 15px; cursor: pointer;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 14px; border: none; border-radius: var(--radius-md); font-weight: 600;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3); }
.btn-secondary { background: var(--surface-white); border: 1px solid var(--border-light); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; border: none; background: #F1F5F9; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-icon:hover { background: #E2E8F0; color: var(--text-main); }
.btn-outline { padding: 8px 16px; border: 1px solid var(--border-light); background: transparent; border-radius: 8px; font-weight: 500; font-size: 13px; color: var(--text-muted); cursor: pointer; transition: 0.2s; display: inline-flex; items: center; gap: 6px; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* =========================================
   3. MAIN APP LAYOUT (The Smooth Scroll Fix)
   ========================================= */
.app-layout { display: flex; height: 100%; width: 100%; position: relative; overflow: hidden; }

/* Sidebar styling with Glassmorphism for mobile */
.sidebar {
    width: 280px; background: var(--surface-white); border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column; padding: 24px 16px; z-index: 200;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 0 8px; }
.sidebar .brand { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--primary); }
.close-sidebar-btn { display: none; background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; }

.new-chat-btn {
    width: 100%; padding: 12px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; border: none; border-radius: var(--radius-md); font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: var(--shadow-sm); transition: 0.2s;
}
.new-chat-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.history-section-wrapper { flex: 1; overflow: hidden; display: flex; flex-direction: column; margin-top: 20px; }
.history-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.section-title { font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; padding-left: 8px; }
.scrollable-list { flex: 1; overflow-y: auto; padding: 0 4px; }
.history-item {
    padding: 10px 12px; margin-bottom: 4px; border-radius: 8px; cursor: pointer;
    font-size: 14px; color: var(--text-main); display: flex; align-items: center; gap: 12px;
    transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item i { font-size: 14px; color: var(--text-light); }
.history-item:hover { background: var(--primary-light); color: var(--primary); }
.history-item:hover i { color: var(--primary); }

.user-profile-mini {
    margin-top: auto; padding: 16px; background: #F8FAFC; border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-light); cursor: pointer;
}
.avatar { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), #F97316); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; box-shadow: var(--shadow-sm); }
.user-info { flex: 1; overflow: hidden; }
.user-info span { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: var(--text-muted); font-size: 13px; }
.logout-icon { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 16px; padding: 8px; border-radius: 50%; transition: 0.2s; }
.logout-icon:hover { background: #E2E8F0; color: #EF4444; }

/* --- Main Content Area & Mobile Nav --- */
.main-content-area { flex: 1; display: flex; flex-direction: column; position: relative; height: 100%; overflow: hidden; }
.mobile-header { display: none; align-items: center; padding: 16px; background: var(--surface-white); border-bottom: 1px solid var(--border-light); z-index: 10; }
.menu-btn { background: none; border: none; font-size: 24px; color: var(--text-main); cursor: pointer; padding: 4px; }
.mobile-brand { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--primary); margin-left: 16px; }

/* --- THE CORE VIEWPORT (Fixes Scrolling) --- */
.viewport-container {
    flex: 1; /* Takes all remaining space */
    overflow-y: auto; /* Only this area scrolls */
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
    padding: 20px;
    padding-bottom: 100px; /* Space for sticky input */
    position: relative;
}

/* =========================================
   4. COMPONENT STYLES (Views)
   ========================================= */
/* Sticky Headers within views */
.sticky-header { position: sticky; top: -20px; z-index: 20; background: var(--surface-glass); backdrop-filter: blur(8px); margin: -20px -20px 20px -20px; padding: 20px; border-bottom: 1px solid var(--border-light); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.sticky-header h3 { font-family: var(--font-heading); font-size: 18px; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.header-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Welcome Screen */
.welcome-hero { text-align: center; margin: 40px 0 60px; }
.welcome-hero h1 { font-family: var(--font-heading); font-size: 32px; margin-bottom: 12px; color: var(--text-main); }
.welcome-hero h1 span { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.welcome-hero p { font-size: 18px; color: var(--text-muted); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.action-card {
    background: var(--surface-white); padding: 30px; border-radius: 20px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
    cursor: pointer; transition: all 0.3s ease; text-align: left;
    position: relative; overflow: hidden;
}
.action-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: white; margin-bottom: 20px; box-shadow: var(--shadow-md); }
.bg-blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.bg-purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.bg-teal { background: linear-gradient(135deg, #14B8A6, #0D9488); }
.action-card h3 { font-family: var(--font-heading); font-size: 20px; margin-bottom: 10px; }
.action-card p { color: var(--text-muted); line-height: 1.5; }

/* Chat Interface */
.chat-messages-area { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.message { display: flex; gap: 16px; animation: fadeIn 0.3s ease; }
.message.user { flex-direction: row-reverse; }
.msg-avatar { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; font-size: 14px; box-shadow: var(--shadow-sm); }
.ai-avatar { background: linear-gradient(135deg, var(--secondary), #059669); }
.user-avatar { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.msg-bubble { padding: 16px 20px; border-radius: 18px; font-size: 15px; line-height: 1.6; max-width: 80%; box-shadow: var(--shadow-sm); }
.message.ai .msg-bubble { background: var(--surface-white); border-top-left-radius: 4px; color: var(--text-main); }
.message.user .msg-bubble { background: var(--primary); color: white; border-top-right-radius: 4px; }
/* AI Typing Loader */
.typing-loader { display: inline-flex; gap: 4px; padding: 12px 20px; background: var(--surface-white); border-radius: 18px; border-top-left-radius: 4px; margin-left: 52px; box-shadow: var(--shadow-sm); }
.typing-loader span { width: 8px; height: 8px; background: var(--text-light); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.typing-loader span:nth-child(1) { animation-delay: -0.32s; }
.typing-loader span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Quiz Interface */
.quiz-scroll-area { max-width: 800px; margin: 0 auto; }
.mcq-card { background: var(--surface-white); padding: 24px; border-radius: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); margin-bottom: 24px; transition: 0.3s; }
.mcq-card:hover { box-shadow: var(--shadow-md); }
.mcq-question { font-family: var(--font-heading); font-weight: 600; font-size: 17px; margin-bottom: 20px; color: var(--text-main); line-height: 1.5; }
.mcq-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-btn {
    padding: 16px; border: 2px solid var(--border-light); border-radius: 12px;
    background: var(--bg-app); cursor: pointer; font-size: 15px; font-weight: 500;
    color: var(--text-main); text-align: left; transition: all 0.2s; position: relative;
}
.option-btn:hover { background: var(--surface-white); border-color: var(--primary-light); }
.option-btn.correct { background: #ECFDF5; border-color: var(--secondary); color: #065F46; }
.option-btn.wrong { background: #FEF2F2; border-color: #EF4444; color: #991B1B; }
.explanation-box { margin-top: 20px; padding: 16px; background: var(--primary-light); border-radius: 12px; border-left: 4px solid var(--primary); font-size: 14px; color: var(--text-main); animation: fadeUp 0.3s ease; }
.load-more-wrapper { text-align: center; padding: 20px 0; }

/* Practice (Flashcards) 3D */
.full-height-flex { flex: 1; display: flex; flex-direction: column; }
.flashcard-viewport { flex: 1; display: flex; align-items: center; justify-content: center; perspective: 1500px; padding: 20px; }
.scene { width: 100%; max-width: 400px; height: 500px; }
.card-3d { width: 100%; height: 100%; position: relative; transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform-style: preserve-3d; cursor: pointer; }
.card-3d.is-flipped { transform: rotateY(180deg); }
.card__face {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    border-radius: 24px; padding: 30px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); background: var(--surface-white);
}
.card__face--front { background: linear-gradient(135deg, var(--surface-white), #F1F5F9); }
.card__face--back { transform: rotateY(180deg); background: linear-gradient(135deg, #F0FDFA, var(--surface-white)); border-color: var(--secondary); }
.card-content-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card-icon-sm { font-size: 40px; margin-bottom: 24px; color: var(--primary); opacity: 0.8; }
.card__face--back .card-icon-sm { color: var(--secondary); }
.card__face h2 { font-family: var(--font-heading); font-size: 26px; color: var(--text-main); }
.card__face p { font-size: 18px; line-height: 1.6; color: var(--text-main); }
.hint-text { font-size: 13px; color: var(--text-light); margin-top: auto; opacity: 0.7; }
.practice-controls { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 20px; background: var(--surface-white); border-top: 1px solid var(--border-light); border-radius: 20px 20px 0 0; }
.control-btn { width: 50px; height: 50px; border-radius: 50%; border: none; background: var(--primary-light); color: var(--primary); font-size: 20px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.control-btn:hover { background: var(--primary); color: white; transform: scale(1.1); }
.counter-badge { font-family: var(--font-heading); font-weight: 600; font-size: 16px; color: var(--text-muted); }

/* =========================================
   5. STICKY INPUT AREA
   ========================================= */
.input-area-sticky {
    position: absolute; bottom: 0; left: 0; width: 100%;
    z-index: 50; padding: 16px; pointer-events: none; /* Let clicks pass through padding */
}
.input-wrapper {
    display: flex; align-items: flex-end; gap: 12px;
    background: var(--surface-glass); backdrop-filter: blur(12px);
    padding: 10px 10px 10px 20px; border-radius: 24px;
    box-shadow: var(--shadow-md); border: 1px solid var(--border-light);
    max-width: 900px; margin: 0 auto; pointer-events: auto; /* Catch clicks here */
    transition: all 0.3s ease;
}
.input-wrapper:focus-within { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
textarea {
    flex: 1; background: transparent; border: none; resize: none;
    max-height: 120px; font-size: 16px; line-height: 1.5; padding: 8px 0;
    color: var(--text-main);
}
textarea::placeholder { color: var(--text-light); }
#send-btn {
    width: 48px; height: 48px; background: var(--primary); color: white;
    border: none; border-radius: 20px; flex-shrink: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#send-btn:hover { background: var(--primary-dark); transform: scale(1.05) rotate(-10deg); }
#send-btn:active { transform: scale(0.95); }

/* =========================================
   6. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: -100%; top: 0; height: 100%; width: 85%; max-width: 320px;
        background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
        box-shadow: var(--shadow-lg); border-right: none;
    }
    .sidebar.active { left: 0; }
    .close-sidebar-btn { display: block; }
    .mobile-header { display: flex; }
    
    .viewport-container { padding: 16px; padding-bottom: 90px; }
    .welcome-hero h1 { font-size: 28px; }
    .mcq-options-grid { grid-template-columns: 1fr; }
    .input-area-sticky { padding: 12px; }
    .input-wrapper { border-radius: 20px; }
    .scene { height: 400px; }
    .card__face { padding: 20px; }
    .card__face h2 { font-size: 22px; }
    .card__face p { font-size: 16px; }
    .header-actions { width: 100%; display: flex; gap: 10px; margin-top: 10px; }
    .header-actions .btn-outline { flex: 1; justify-content: center; }
    .header-content { flex-wrap: wrap; }
}


/* History Item Layout */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

/* Text area (Left side) */
.history-title {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Delete Button (Right side) */
.delete-btn {
    background: none;
    border: none;
    color: #9CA3AF; /* Grey */
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.delete-btn:hover {
    color: #EF4444; /* Red */
    background: #FEF2F2;
}

.continue-card {
    display:flex;
    justify-content:space-between;
    align-items:center;
    background: linear-gradient(135deg,#4F46E5,#6366F1);
    color:white;
    padding:18px 20px;
    border-radius:16px;
    margin-bottom:25px;
    box-shadow:0 8px 20px rgba(79,70,229,0.25);
}

.continue-card small { opacity:.8; font-size:12px; }
.continue-card h3 { margin:4px 0 0 0; font-size:18px; }


/* RESULT MODAL */
.result-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
    animation:fadeIn .25s ease;
}

.result-modal{
    width:90%;
    max-width:360px;
    background:#fff;
    border-radius:18px;
    padding:22px;
    box-shadow:0 20px 40px rgba(0,0,0,0.25);
    text-align:center;
    animation:scaleIn .25s ease;
}

.result-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
}

.close-result{
    border:none;
    background:none;
    font-size:18px;
    cursor:pointer;
}

.score-circle{
    width:120px;
    height:120px;
    border-radius:50%;
    background:linear-gradient(135deg,#6366f1,#4f46e5);
    color:white;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:26px;
    font-weight:600;
    margin:10px auto;
}

.accuracy{
    font-weight:600;
    margin-top:6px;
    color:#4b5563;
}

.result-analysis{
    margin:18px 0;
    padding:12px;
    border-radius:12px;
}

.result-analysis.weak{ background:#fee2e2; color:#b91c1c; }
.result-analysis.learning{ background:#fef3c7; color:#92400e; }
.result-analysis.good{ background:#d1fae5; color:#065f46; }
.result-analysis.strong{ background:#dcfce7; color:#166534; }

.retry-btn{
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#4f46e5;
    color:white;
    font-weight:600;
    cursor:pointer;
}

@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes scaleIn{from{transform:scale(.85)}to{transform:scale(1)}}
.weak-box{
    background:#fff7ed;
    border:1px solid #fed7aa;
    padding:14px;
    border-radius:14px;
    margin-bottom:18px;
}

.weak-box h3{
    font-size:16px;
    margin-bottom:8px;
    color:#9a3412;
}

.weak-topics-list{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.weak-chip{
    background:#ffedd5;
    color:#7c2d12;
    padding:6px 12px;
    border-radius:999px;
    font-size:13px;
    cursor:pointer;
    transition:.2s;
}

.weak-chip:hover{
    background:#fdba74;
}
/* FOCUS AREA CARD */
.weak-box{
    background:linear-gradient(135deg,#fff7ed,#ffedd5);
    border:none;
    padding:16px;
    border-radius:18px;
    margin-bottom:20px;
    box-shadow:0 8px 18px rgba(0,0,0,0.06);
}

.weak-box h3{
    font-size:15px;
    margin-bottom:12px;
    color:#c2410c;
    display:flex;
    align-items:center;
    gap:6px;
}

.weak-topics-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.weak-topic-card{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 14px;
    border-radius:14px;
    background:white;
    cursor:pointer;
    transition:.2s;
}

.weak-topic-card:hover{
    transform:translateY(-2px);
    box-shadow:0 6px 14px rgba(0,0,0,0.08);
}

.weak-title{
    font-weight:600;
    color:#1f2937;
    text-transform:capitalize;
}

.weak-sub{
    font-size:12px;
    color:#9ca3af;
}

.weak-score{
    font-weight:700;
    color:#dc2626;
    background:#fee2e2;
    padding:6px 10px;
    border-radius:999px;
    font-size:13px;
}
