@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   THEME VARIABLES (Matching Dropout Predictor)
   ============================================ */

/* Dark Theme (Default) - Deep slate with indigo/purple accents */
:root,
body.theme-dark {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-tertiary: #a855f7;
    --border-color: rgba(255, 255, 255, 0.08);
    --button-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --button-text: #ffffff;
    --button-hover-shadow: rgba(99, 102, 241, 0.4);
    --glow-color: rgba(99, 102, 241, 0.4);
}

/* Light Theme - Clean white with professional blue accents */
body.theme-light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-tertiary: #2563eb;
    --border-color: rgba(0, 0, 0, 0.1);
    --button-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    --button-text: #ffffff;
    --button-hover-shadow: rgba(59, 130, 246, 0.3);
    --glow-color: rgba(59, 130, 246, 0.3);
}

/* Forest Theme - Deep forest green with emerald accents */
body.theme-forest {
    --bg-primary: #0d1a0d;
    --bg-secondary: #132013;
    --bg-tertiary: #1a2b1a;
    --text-primary: #e8f5e8;
    --text-secondary: #a3d9a3;
    --text-muted: #7bc97b;
    --accent-primary: #22c55e;
    --accent-secondary: #4ade80;
    --accent-tertiary: #16a34a;
    --border-color: rgba(34, 197, 94, 0.15);
    --button-bg: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    --button-text: #ffffff;
    --button-hover-shadow: rgba(34, 197, 94, 0.4);
    --glow-color: rgba(34, 197, 94, 0.4);
}

/* Cream Theme - Warm beige with amber/orange accents */
body.theme-cream {
    --bg-primary: #faf8f3;
    --bg-secondary: #fff9ed;
    --bg-tertiary: #fef3c7;
    --text-primary: #451a03;
    --text-secondary: #78350f;
    --text-muted: #b45309;
    --accent-primary: #f59e0b;
    --accent-secondary: #fbbf24;
    --accent-tertiary: #d97706;
    --border-color: rgba(245, 158, 11, 0.2);
    --button-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    --button-text: #ffffff;
    --button-hover-shadow: rgba(245, 158, 11, 0.3);
    --glow-color: rgba(245, 158, 11, 0.3);
}

/* Ocean Theme - Deep ocean blue with cyan accents */
body.theme-ocean {
    --bg-primary: #0c1929;
    --bg-secondary: #0f2337;
    --bg-tertiary: #132d46;
    --text-primary: #e0f2fe;
    --text-secondary: #7dd3fc;
    --text-muted: #38bdf8;
    --accent-primary: #06b6d4;
    --accent-secondary: #22d3ee;
    --accent-tertiary: #0891b2;
    --border-color: rgba(6, 182, 212, 0.15);
    --button-bg: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%);
    --button-text: #ffffff;
    --button-hover-shadow: rgba(6, 182, 212, 0.4);
    --glow-color: rgba(6, 182, 212, 0.4);
}

/* Apply theme variables to body */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-link {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 8px 0;
    display: inline-block;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Gradient underline effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Theme Switcher in Navbar */
.theme-switcher-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--text-muted);
}

.theme-btn.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--button-hover-shadow);
}

.theme-dark-btn {
    background: linear-gradient(135deg, #0f172a, #334155);
}

.theme-ocean-btn {
    background: linear-gradient(135deg, #0c2f4d, #1f618d);
}

.theme-forest-btn {
    background: linear-gradient(135deg, #1a3a2e, #2d6a4f);
}

.theme-cream-btn {
    background: linear-gradient(135deg, #f5f3e7, #d4cdb0);
    border: 1px solid #c9bd9e;
}

.theme-light-btn {
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    border: 1px solid #cbd5e1;
}

/* Mobile menu button - Hamburger with animation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1001;
}

.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger to Cross animation */
.mobile-menu-btn.active .hamburger-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: var(--button-bg);
    color: var(--button-text);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--button-hover-shadow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: var(--button-text);
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* ============================================
   UPLOAD AREA
   ============================================ */

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.upload-area.drag-over {
    border-color: var(--accent-secondary);
    background: var(--accent-primary);
    opacity: 0.8;
}

/* ============================================
   RESULTS & BADGES
   ============================================ */

.result-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 20px;
}

.badge-real {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid #4ade80;
}

.badge-fake {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid #f87171;
}

.badge-uncertain {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
    border: 1px solid #facc15;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 20px auto;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* ============================================
   FAQ SECTION
   ============================================ */

.faq-section {
    padding: 60px 20px;
    background: var(--bg-primary);
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--accent-primary);
}

.faq-question {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: var(--accent-primary);
}

.faq-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 24px 20px 24px;
}

/* ============================================
   ICON BOX
   ============================================ */

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--button-bg);
}

/* ============================================
   STAKEHOLDER BADGE
   ============================================ */

.stakeholder-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    margin: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline {
    position: relative;
    padding-left: 40px;
    margin-top: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
}

/* ============================================
   STATS
   ============================================ */

.stat-box {
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   LANDING PAGE SPECIFIC STYLES
   ============================================ */

.landing-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c4a6e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.section {
    padding: 60px 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 800px;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   FLOATING THEME TOGGLE
   ============================================ */

.floating-theme-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--button-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--button-hover-shadow);
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px var(--button-hover-shadow);
}

.floating-theme-btn svg {
    width: 24px;
    height: 24px;
    color: white;
}

.floating-theme-menu {
    position: fixed;
    bottom: 90px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.floating-theme-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.floating-theme-option:hover {
    background: var(--bg-tertiary);
}

.floating-theme-option.active {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   ENHANCED LOADING STATES
   ============================================ */

.analysis-loading {
    padding: 30px;
    text-align: center;
}

.loading-steps {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.loading-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.loading-step.active {
    opacity: 1;
}

.loading-step.completed {
    opacity: 1;
}

.loading-step.completed .step-icon {
    background: #4ade80;
    border-color: #4ade80;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.loading-step.active .step-icon {
    border-color: var(--accent-primary);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.loading-step.active .step-label {
    color: var(--accent-primary);
}

.loading-step.completed .step-label {
    color: #4ade80;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 var(--glow-color);
    }

    50% {
        box-shadow: 0 0 20px 5px var(--glow-color);
    }
}

.loading-progress {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: var(--button-bg);
    border-radius: 3px;
    transition: width 0.5s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   ANIMATED GAUGE (REPLACES SCORE CIRCLE)
   ============================================ */

.animated-gauge {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 12;
}

.gauge-fill {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 0.5s ease;
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 42px;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.gauge-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   SCORE CARDS (BERT/LLM/WEB)
   ============================================ */

.score-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.score-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.score-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.score-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.score-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.score-card-value {
    font-size: 24px;
    font-weight: 700;
    background: var(--button-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-card-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--button-bg);
    transition: width 0.8s ease-out;
}

/* Tooltip for score cards */
.score-card[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* ============================================
   MICRO-ANIMATIONS
   ============================================ */

/* Pulse effect for buttons during processing */
.btn-processing {
    animation: btn-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btn-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px var(--button-hover-shadow);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px var(--button-hover-shadow);
    }
}

/* Slide-in animation for results */
.result-slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Particle burst for verified verdicts */
.verdict-particles {
    position: absolute;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(0);
    }
}

/* Checkmark animation */
.checkmark-animated {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.5s ease-out 0.3s forwards;
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   VERIFICATION HISTORY SIDEBAR
   ============================================ */

.history-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 16px 12px;
    cursor: pointer;
    z-index: 998;
    transition: all 0.3s ease;
}

.history-toggle:hover {
    background: var(--bg-tertiary);
    padding-left: 16px;
}

.history-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.history-sidebar.active {
    transform: translateX(0);
}

.history-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title {
    font-size: 18px;
    font-weight: 700;
}

.history-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.history-item-text {
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.history-score {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.history-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
    }

    .card,
    .score-card,
    .history-item {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .floating-theme-btn {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .floating-theme-menu {
        bottom: 74px;
        right: 16px;
    }

    .loading-steps {
        gap: 12px;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .step-label {
        font-size: 10px;
    }

    .score-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .animated-gauge {
        width: 150px;
        height: 150px;
    }

    .gauge-value {
        font-size: 32px;
    }

    .history-sidebar {
        width: 100%;
    }

    .history-toggle {
        display: none;
    }
}