/* ============================================================
   AI ANSWER EVALUATION SYSTEM - PREMIUM STYLESHEET
   ============================================================
   Custom CSS with dark mode, glassmorphism, gradients,
   and micro-animations for a premium look and feel.
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
    /* Primary Colors */
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --primary-dark: #4F46E5;
    --primary-glow: rgba(108, 99, 255, 0.3);

    /* Accent Colors */
    --accent: #00D4AA;
    --accent-light: #33DDBB;
    --accent-dark: #00B894;
    --accent-glow: rgba(0, 212, 170, 0.3);

    /* Semantic Colors */
    --success: #00C853;
    --warning: #FFB300;
    --danger: #FF5252;
    --info: #40C4FF;

    /* Background Colors */
    --bg-primary: #0A0E1A;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(31, 41, 55, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    /* Text Colors */
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(108, 99, 255, 0.4);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #00D4AA 100%);
    --gradient-dark: linear-gradient(135deg, #0A0E1A 0%, #1F2937 100%);
    --gradient-card: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(0, 212, 170, 0.05) 100%);
    --gradient-glow: radial-gradient(600px at 50% 50%, rgba(108, 99, 255, 0.15), transparent 70%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.2);
    --shadow-glow-accent: 0 0 30px rgba(0, 212, 170, 0.2);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(800px at 20% 30%, rgba(108, 99, 255, 0.08), transparent 60%),
        radial-gradient(600px at 80% 70%, rgba(0, 212, 170, 0.06), transparent 60%),
        radial-gradient(400px at 50% 50%, rgba(108, 99, 255, 0.04), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    text-decoration: none;
    color: var(--primary-light);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ============================================================
   NAVBAR STYLES
   ============================================================ */
.glass-navbar {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.glass-navbar.scrolled {
    background: rgba(10, 14, 26, 0.95);
    box-shadow: var(--shadow-md);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-normal);
}

.brand-icon:hover {
    transform: rotate(10deg) scale(1.1);
}

.brand-text {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    font-size: 0.95rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text-primary) !important;
    background: var(--bg-glass);
}

.navbar-toggler {
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding-top: 80px;
    min-height: calc(100vh - 80px);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: var(--gradient-glow);
    pointer-events: none;
    z-index: -1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

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

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.3s both;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary-gradient {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
    z-index: -1;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(108, 99, 255, 0.4);
    color: white;
}

.btn-primary-gradient:hover::before {
    left: 100%;
}

.btn-outline-glass {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.btn-outline-glass:hover {
    background: var(--bg-glass);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-sm-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all var(--transition-normal);
}

.btn-sm-gradient:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    color: white;
}

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.glass-card:hover::before {
    opacity: 1;
}

/* ============================================================
   FEATURE CARDS
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.feature-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1.2rem;
    transition: all var(--transition-normal);
}

.feature-card:hover .feature-icon {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-glow);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================
   STATS SECTION
   ============================================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.stat-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

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

/* ============================================================
   UPLOAD SECTION
   ============================================================ */
.upload-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.upload-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-glass);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.mode-tab {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
}

.mode-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.mode-tab:hover:not(.active) {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label-custom {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-label-custom .optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.form-control-custom {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    outline: none;
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.form-control-custom::placeholder {
    color: var(--text-muted);
}

textarea.form-control-custom {
    min-height: 120px;
    resize: vertical;
}

/* File Upload Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-glass);
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.05);
    box-shadow: var(--shadow-glow);
}

.drop-zone-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: all var(--transition-normal);
}

.drop-zone:hover .drop-zone-icon {
    color: var(--primary);
    transform: translateY(-5px);
}

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

.drop-zone-text strong {
    color: var(--primary-light);
}

.drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--accent);
}

/* Question Block */
.question-block {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
}

.question-block:hover {
    border-color: var(--border-hover);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.question-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-light);
}

.btn-remove-question {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--danger);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-remove-question:hover {
    background: rgba(255, 82, 82, 0.2);
}

/* ============================================================
   DASHBOARD STYLES
   ============================================================ */
.dashboard-section {
    padding: 3rem 0;
}

/* Score Summary Cards */
.score-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-card {
    text-align: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.score-card-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.score-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-excellent { color: var(--success); }
.score-good { color: var(--info); }
.score-average { color: var(--warning); }
.score-poor { color: var(--danger); }

/* Grade Badge */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.grade-A { background: rgba(0, 200, 83, 0.15); color: var(--success); border: 2px solid var(--success); }
.grade-B { background: rgba(64, 196, 255, 0.15); color: var(--info); border: 2px solid var(--info); }
.grade-C { background: rgba(255, 179, 0, 0.15); color: var(--warning); border: 2px solid var(--warning); }
.grade-D, .grade-F { background: rgba(255, 82, 82, 0.15); color: var(--danger); border: 2px solid var(--danger); }

/* Charts Container */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Question Result Card */
.question-result-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}

.question-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-result-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.question-result-score {
    font-weight: 800;
    font-size: 1.3rem;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-xl);
}

/* Score Bars */
.score-bar-container {
    margin-bottom: 0.8rem;
}

.score-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.score-bar-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.score-bar-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.score-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: var(--radius-xl);
    transition: width 1s ease;
    position: relative;
}

.score-bar-fill.excellent { background: var(--gradient-primary); }
.score-bar-fill.good { background: linear-gradient(90deg, var(--info), #00B4D8); }
.score-bar-fill.average { background: linear-gradient(90deg, var(--warning), #FF8800); }
.score-bar-fill.poor { background: linear-gradient(90deg, var(--danger), #FF1744); }

/* Feedback Section */
.feedback-box {
    background: rgba(108, 99, 255, 0.05);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-top: 1rem;
}

.feedback-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tag-keyword {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.2rem;
}

.tag-matched {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.3);
}

.tag-missed {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.tag-partial {
    background: rgba(255, 179, 0, 0.15);
    color: var(--warning);
    border: 1px solid rgba(255, 179, 0, 0.3);
}

/* ============================================================
   HISTORY TABLE
   ============================================================ */
.history-section {
    padding: 3rem 0;
}

.table-glass {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-glass thead th {
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table-glass tbody td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.95rem;
}

.table-glass tbody tr {
    transition: background var(--transition-fast);
}

.table-glass tbody tr:hover {
    background: var(--bg-glass-hover);
}

.table-glass tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease;
}

/* Staggered animation for lists */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .glass-card {
        padding: 1.5rem;
    }

    .mode-tabs {
        flex-direction: column;
    }

    .question-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }

    .btn-primary-gradient,
    .btn-outline-glass {
        width: 100%;
        text-align: center;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
}

.toast-notification {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideInLeft 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 300px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ============================================================
   QUESTION PAPER ANALYZER
   ============================================================ */

/* Upload row: drop zone + analyze button side by side */
.paper-upload-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.paper-upload-row .paper-drop-zone {
    flex: 1;
    padding: 2rem 1.5rem;
}

.paper-buttons-col,
.answer-buttons-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.btn-analyze-paper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all var(--transition-normal);
    opacity: 0.5;
}

.btn-analyze-paper.active,
.btn-analyze-paper:not([disabled]) {
    opacity: 1;
    cursor: pointer;
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(108, 99, 255, 0.08);
}

.btn-analyze-paper.active:hover,
.btn-analyze-paper:not([disabled]):hover {
    background: rgba(108, 99, 255, 0.15);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-analyze-paper i {
    font-size: 1.4rem;
}

/* Question Structure button */
.btn-question-structure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.7rem 1rem;
    background: var(--bg-glass);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all var(--transition-normal);
    opacity: 0.5;
}

.btn-question-structure.active,
.btn-question-structure:not([disabled]) {
    opacity: 1;
    cursor: pointer;
    border-color: var(--warning, #f59e0b);
    color: var(--warning, #f59e0b);
    background: rgba(245, 158, 11, 0.08);
}

.btn-question-structure.active:hover,
.btn-question-structure:not([disabled]):hover {
    background: rgba(245, 158, 11, 0.15);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-question-structure i {
    font-size: 1.2rem;
}

/* Student Attempts button */
.btn-student-attempts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.7rem 1rem;
    background: var(--bg-glass);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all var(--transition-normal);
    opacity: 0.5;
}

.btn-student-attempts.active,
.btn-student-attempts:not([disabled]) {
    opacity: 1;
    cursor: pointer;
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.btn-student-attempts.active:hover,
.btn-student-attempts:not([disabled]):hover {
    background: rgba(59, 130, 246, 0.15);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-student-attempts i {
    font-size: 1.2rem;
}

/* Question Structure Summary Cards */
.qs-summary {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.qs-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.qs-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.qs-q-label {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary-light);
}

.qs-marks {
    margin-left: auto;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.qs-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qs-badge-mcq {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.qs-badge-desc {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.qs-badge-compulsory {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.qs-badge-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.qs-badge-warn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.qs-card-body {
    padding: 0.6rem 1rem 0.8rem;
}

.qs-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.qs-detail i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.qs-rule {
    color: var(--warning, #f59e0b);
}

.qs-subs {
    margin-top: 0.4rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
}

.qs-sub-item {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.2rem 0 0.2rem 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
}

.qs-sub-label {
    font-weight: 700;
    color: var(--accent);
    min-width: 1.2em;
}

.qs-sub-marks {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    margin-left: auto;
    white-space: nowrap;
}

.qs-rules-banner {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.8rem;
}

.qs-rules-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #818cf8;
    margin-bottom: 0.3rem;
}

/* ============================================================
   MCQ RESULT DISPLAY
   ============================================================ */
.mcq-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.mcq-result-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

.mcq-result-box.mcq-correct {
    background: rgba(0, 200, 83, 0.08);
    border: 1px solid rgba(0, 200, 83, 0.25);
}

.mcq-result-box.mcq-incorrect {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.25);
}

.mcq-result-icon {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.mcq-correct .mcq-result-icon {
    color: var(--success);
}

.mcq-incorrect .mcq-result-icon {
    color: var(--danger);
}

.mcq-result-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mcq-result-label {
    font-weight: 700;
    font-size: 1rem;
}

.mcq-correct .mcq-result-label {
    color: var(--success);
}

.mcq-incorrect .mcq-result-label {
    color: var(--danger);
}

.mcq-result-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mcq-result-detail strong {
    color: var(--text-primary);
}

.qs-rules-item {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.text-success {
    color: #22c55e !important;
}

.text-danger {
    color: #ef4444 !important;
}

/* Answer upload row: drop zone + See Extracted Text button side by side */
.answer-upload-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.answer-upload-row .drop-zone {
    flex: 1;
}

.btn-analyze-answer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all var(--transition-normal);
    opacity: 0.5;
}

.btn-analyze-answer.active,
.btn-analyze-answer:not([disabled]) {
    opacity: 1;
    cursor: pointer;
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 212, 170, 0.08);
}

.btn-analyze-answer.active:hover,
.btn-analyze-answer:not([disabled]):hover {
    background: rgba(0, 212, 170, 0.15);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-analyze-answer i {
    font-size: 1.4rem;
}

/* Structure Modal Overlay */
.structure-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

.structure-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl, 16px);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.3s ease;
}

.structure-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.structure-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-close-modal:hover {
    background: rgba(255, 82, 82, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.structure-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.structure-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.structure-info-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* Question cards inside modal — plain tree format */
.structure-tree-output {
    font-family: var(--font-mono, 'JetBrains Mono', 'Consolas', 'Courier New', monospace);
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.tree-q-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary-light);
    margin-top: 0.3rem;
}

.tree-line {
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.tree-sub-label {
    font-weight: 700;
    color: var(--accent);
}

.tree-answer-text {
    display: inline;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.structure-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Responsive for paper upload */
@media (max-width: 768px) {
    .paper-upload-row,
    .answer-upload-row {
        flex-direction: column;
    }
    
    .paper-buttons-col,
    .answer-buttons-col {
        flex-direction: row;
        min-width: auto;
    }

    .btn-analyze-paper,
    .btn-analyze-answer,
    .btn-question-structure,
    .btn-student-attempts {
        min-width: auto;
        flex-direction: row;
        padding: 0.8rem 1.2rem;
        flex: 1;
    }
    
    .structure-modal {
        max-height: 90vh;
    }

    .structure-tree-output {
        font-size: 0.8rem;
    }
}
