/* ============================================
   StudyBuddy - Educational Platform Styles
   Palette: Indigo Ink (Education Focus)
   ============================================ */

:root {
    /* Indigo Ink Palette */
    --color-bg-primary: #1B0A3C;
    --color-bg-secondary: #3D1E7C;
    --color-accent: #7B68EE;
    --color-text-primary: #E8E0F0;
    --color-text-secondary: #B8A9D9;
    --color-text-muted: #8B7CB3;
    
    /* Extended Palette */
    --color-success: #4ADE80;
    --color-warning: #FBBF24;
    --color-danger: #EF4444;
    --color-info: #60A5FA;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7B68EE 0%, #9F7AEA 100%);
    --gradient-hero: linear-gradient(135deg, #1B0A3C 0%, #3D1E7C 50%, #5B21B6 100%);
    --gradient-card: linear-gradient(145deg, rgba(123, 104, 238, 0.1) 0%, rgba(61, 30, 124, 0.2) 100%);
    
    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(123, 104, 238, 0.3);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: rgba(27, 10, 60, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(123, 104, 238, 0.2);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo {
    font-size: 1.75rem;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-primary);
    background: rgba(123, 104, 238, 0.2);
}

.nav-link.cram-mode {
    color: var(--color-warning);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-danger {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: rgba(123, 104, 238, 0.2);
    color: var(--color-text-primary);
    border: 1px solid rgba(123, 104, 238, 0.3);
}

.btn-secondary:hover {
    background: rgba(123, 104, 238, 0.3);
}

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

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

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

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

.btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

.btn-back {
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: color 0.3s ease;
}

.btn-back:hover {
    color: var(--color-text-primary);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(80px + var(--space-2xl)) var(--space-xl) var(--space-2xl);
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%237B68EE' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    color: var(--color-text-primary);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-visual {
    flex: 1;
    max-width: 500px;
    position: relative;
    height: 400px;
    z-index: 1;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: float 6s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}

.card-icon {
    font-size: 1.5rem;
}

.card-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.card-1 { top: 0; left: 0; animation-delay: 0s; }
.card-2 { top: 20%; right: 0; animation-delay: 1s; }
.card-3 { bottom: 20%; left: 10%; animation-delay: 2s; }
.card-4 { bottom: 0; right: 10%; animation-delay: 3s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ============================================
   Main Container & Sections
   ============================================ */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
}

.section {
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
}

/* ============================================
   Subject Cards
   ============================================ */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.subject-card {
    background: var(--gradient-card);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.subject-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
}

.subject-card:hover::before {
    opacity: 0.1;
}

.subject-card > * {
    position: relative;
    z-index: 1;
}

.subject-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.subject-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.subject-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

.chapters-count {
    display: inline-block;
    background: rgba(123, 104, 238, 0.2);
    color: var(--color-accent);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   Chapter View
   ============================================ */
.chapter-view {
    background: rgba(61, 30, 124, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid rgba(123, 104, 238, 0.2);
}

.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.chapter-title {
    font-family: var(--font-display);
    font-size: 2rem;
    flex: 1;
}

.chapter-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 200px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(123, 104, 238, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-text {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    min-width: 80px;
}

.chapter-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-xl);
}

@media (max-width: 1024px) {
    .chapter-content-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Explanation Panel */
.explanation-panel {
    background: rgba(27, 10, 60, 0.5);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid rgba(123, 104, 238, 0.2);
}

.explanation-content {
    margin-bottom: var(--space-xl);
}

.explanation-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--color-accent);
}

.explanation-content p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.explanation-content ul,
.explanation-content ol {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.explanation-content li {
    margin-bottom: var(--space-xs);
    color: var(--color-text-secondary);
}

.diagram-container {
    background: rgba(123, 104, 238, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-container svg {
    max-width: 100%;
    height: auto;
}

/* Action Panel */
.action-panel {
    background: rgba(27, 10, 60, 0.5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(123, 104, 238, 0.2);
    overflow: hidden;
}

.action-tabs {
    display: flex;
    border-bottom: 1px solid rgba(123, 104, 238, 0.2);
}

.tab-btn {
    flex: 1;
    padding: var(--space-md);
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--color-text-primary);
    background: rgba(123, 104, 238, 0.1);
}

.tab-btn.active {
    color: var(--color-text-primary);
    background: rgba(123, 104, 238, 0.2);
    border-bottom: 2px solid var(--color-accent);
}

.tab-content {
    display: none;
    padding: var(--space-xl);
    max-height: 600px;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

/* Homework & Assignment */
.homework-list,
.assignment-list {
    margin-bottom: var(--space-lg);
}

.homework-item,
.assignment-item {
    background: rgba(123, 104, 238, 0.1);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.homework-item input[type="checkbox"],
.assignment-item input[type="checkbox"] {
    margin-top: 4px;
    accent-color: var(--color-accent);
}

.homework-item label,
.assignment-item label {
    flex: 1;
    cursor: pointer;
}

.homework-item.completed label,
.assignment-item.completed label {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Mind Map */
.mindmap-container {
    background: rgba(123, 104, 238, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    min-height: 400px;
    position: relative;
    overflow: auto;
}

.mindmap-svg {
    width: 100%;
    height: 100%;
}

.mindmap-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.mindmap-node:hover {
    filter: brightness(1.2);
}

.mindmap-node text {
    font-family: var(--font-body);
    font-size: 12px;
    fill: var(--color-text-primary);
}

.mindmap-node circle {
    fill: var(--color-accent);
}

.mindmap-node.central circle {
    fill: var(--color-bg-secondary);
}

.mindmap-link {
    stroke: var(--color-accent);
    stroke-width: 2;
    opacity: 0.6;
}

/* MCQ */
.mcq-container {
    margin-bottom: var(--space-lg);
}

.mcq-question {
    background: rgba(123, 104, 238, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.mcq-question h4 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.mcq-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.mcq-option {
    background: rgba(27, 10, 60, 0.5);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.mcq-option:hover {
    border-color: var(--color-accent);
    background: rgba(123, 104, 238, 0.1);
}

.mcq-option.selected {
    border-color: var(--color-accent);
    background: rgba(123, 104, 238, 0.2);
}

.mcq-option.correct {
    border-color: var(--color-success);
    background: rgba(74, 222, 128, 0.2);
}

.mcq-option.incorrect {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.2);
}

.mcq-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(123, 104, 238, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.mcq-results {
    background: rgba(123, 104, 238, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}

.mcq-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

/* ============================================
   Progress Dashboard
   ============================================ */
.progress-dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

@media (max-width: 900px) {
    .progress-dashboard {
        grid-template-columns: 1fr;
    }
}

.progress-card {
    background: var(--gradient-card);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.progress-card.overall {
    text-align: center;
}

.progress-card.overall h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

.circular-progress {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.circular-progress svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-bg {
    fill: none;
    stroke: rgba(123, 104, 238, 0.2);
    stroke-width: 8;
}

.progress-bar {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
}

.stat-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    display: block;
}

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

.subject-progress {
    background: var(--gradient-card);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.subject-progress h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

.subject-bar {
    margin-bottom: var(--space-md);
}

.subject-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.subject-bar-name {
    font-weight: 500;
}

.subject-bar-value {
    color: var(--color-accent);
    font-weight: 600;
}

.subject-bar-track {
    height: 8px;
    background: rgba(123, 104, 238, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.subject-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ============================================
   Cram Mode
   ============================================ */
.cram-section {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(123, 104, 238, 0.1) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.cram-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.time-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.time-btn {
    padding: var(--space-sm) var(--space-md);
    background: rgba(123, 104, 238, 0.2);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-btn:hover,
.time-btn.selected {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.form-select {
    width: 100%;
    padding: var(--space-md);
    background: rgba(27, 10, 60, 0.5);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.cram-plan {
    margin-top: var(--space-xl);
}

.cram-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.cram-task {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(27, 10, 60, 0.5);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all 0.3s ease;
}

.cram-task.active {
    border-color: var(--color-warning);
    background: rgba(251, 191, 36, 0.1);
}

.cram-task.completed {
    opacity: 0.6;
}

.cram-task-time {
    font-weight: 600;
    color: var(--color-accent);
    min-width: 80px;
}

.cram-task-content {
    flex: 1;
}

.cram-task-type {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.cram-active {
    background: rgba(27, 10, 60, 0.8);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    border: 2px solid var(--color-warning);
}

.timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--color-warning);
    margin-bottom: var(--space-md);
}

.current-task {
    font-size: 1.25rem;
    margin-bottom: var(--space-xl);
    color: var(--color-text-primary);
}

.cram-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-bg-primary);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(123, 104, 238, 0.2);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.modal-body textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(27, 10, 60, 0.5);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    margin-bottom: var(--space-md);
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.question-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    margin-bottom: var(--space-lg);
}

.suggestion-chip {
    background: rgba(123, 104, 238, 0.2);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-chip:hover {
    background: var(--color-accent);
    color: white;
}

.answer-container {
    background: rgba(123, 104, 238, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-md);
}

.answer-content h4 {
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

.answer-content p {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid rgba(123, 104, 238, 0.2);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: rgba(27, 10, 60, 0.8);
    border-top: 1px solid rgba(123, 104, 238, 0.2);
    padding: var(--space-xl);
    text-align: center;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.footer-tagline {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(27, 10, 60, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(123, 104, 238, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: var(--space-sm) var(--space-md);
        flex-wrap: wrap;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: calc(60px + var(--space-xl));
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .subject-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .timer-display {
        font-size: 2.5rem;
    }
}