/* ═══════════════════════════════════════════════════════════════════
   AI Misinformation Detector — Premium Dark UI
   Vercel Frontend · Endee Vector DB
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Tokens ─────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #06060b;
    --bg-secondary: #0c0c14;
    --bg-card: #12121c;
    --bg-elevated: #1a1a28;
    --bg-input: #15152140;

    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-glow: rgba(124, 58, 237, 0.25);
    --accent-soft: rgba(124, 58, 237, 0.10);

    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.20);
    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.20);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.20);

    --text-primary: #f1f0ff;
    --text-secondary: #9ca3b0;
    --text-muted: #5a6070;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(124, 58, 237, 0.40);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: #c4b5fd;
}

/* ── Aurora Background ──────────────────────────────────────────── */
.aurora {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: auroraDrift 18s ease-in-out infinite alternate;
}

.aurora-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 70%);
    top: -10%;
    left: 30%;
    animation-delay: 0s;
}

.aurora-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.3), transparent 70%);
    top: 50%;
    right: -5%;
    animation-delay: -6s;
}

.aurora-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
    bottom: -5%;
    left: -5%;
    animation-delay: -12s;
}

@keyframes auroraDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    100% {
        transform: translate(10px, -10px) scale(1.05);
    }
}

/* ── App Container ──────────────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 3rem;
}

/* App Content Wrapper */
.app-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
    position: relative;
    z-index: 10;
}

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 6, 11, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    font-size: 1.4rem;
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e2d9ff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-version {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background var(--transition);
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 8px var(--green-glow);
}

.status-dot.offline {
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber-glow);
}

.status-dot.error {
    background: var(--red);
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-soft);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius-full);
    padding: 5px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.badge-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-light);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    font-weight: 900;
    line-height: 1.12;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(-60deg, #c4b5fd 0%, #7c3aed 25%, #22d3ee 50%, #7c3aed 75%, #c4b5fd 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 6s linear infinite;
}

@keyframes shine {
    to {
        background-position: 300% center;
    }
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 1rem auto 0;
    line-height: 1.7;
}

.accent-text {
    color: var(--accent-light);
    font-weight: 600;
}

/* ── Pipeline ────────────────────────────────────────────────────── */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 1rem 0 1.5rem;
    overflow-x: auto;
}

.pipe-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: default;
    flex-shrink: 0;
}

.pipe-step:hover {
    background: var(--accent-soft);
}

.pipe-step.active {
    background: rgba(124, 58, 237, 0.25);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: scale(1.08) translateY(-2px);
    border: 1px solid rgba(124, 58, 237, 0.4);
}

.pipe-icon {
    font-size: 1.1rem;
}

.pipe-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.pipe-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ── Stats Row ───────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: border-color var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-light);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-top: 4px;
    font-weight: 500;
}

/* ── Section Header ──────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1rem;
}

.section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Examples ────────────────────────────────────────────────────── */
.examples-section {
    margin-bottom: 2rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.example-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.example-chip:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.example-chip:active {
    transform: translateY(0);
}

.example-arrow {
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.example-chip:hover .example-arrow {
    transform: translateX(2px);
}

/* ── Input Section ───────────────────────────────────────────────── */
.input-section {
    margin-bottom: 2rem;
}

.input-wrapper {
    position: relative;
    margin-bottom: 12px;
}

#claim-input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-primary);
    resize: vertical;
    min-height: 110px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
}

#claim-input:focus {
    border-color: var(--accent);
    background: rgba(21, 21, 33, 0.6);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

#claim-input::placeholder {
    color: var(--text-muted);
}

.input-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.char-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Verify Button ───────────────────────────────────────────────── */
.verify-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.verify-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.verify-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.verify-btn:hover::before {
    opacity: 1;
}

.verify-btn:active {
    transform: translateY(0);
}

.verify-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.verify-btn.loading .btn-text {
    display: none;
}

.verify-btn.loading .btn-icon {
    display: none;
}

.verify-btn.loading .btn-loader {
    display: inline-block;
}

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

/* ── Results Section ─────────────────────────────────────────────── */
.results-section {
    animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Verdict Banner ──────────────────────────────────────────────── */
.verdict-banner {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 2px solid;
    overflow: hidden;
    animation: verdictPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes verdictPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.verdict-banner.true {
    background: rgba(5, 46, 22, 0.65);
    border-color: rgba(34, 197, 94, 0.6);
}

.verdict-banner.misleading {
    background: rgba(28, 16, 7, 0.65);
    border-color: rgba(245, 158, 11, 0.6);
}

.verdict-banner.false {
    background: rgba(28, 10, 10, 0.65);
    border-color: rgba(239, 68, 68, 0.6);
}

.verdict-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
}

.verdict-banner.true .verdict-glow {
    background: var(--green);
}

.verdict-banner.misleading .verdict-glow {
    background: var(--amber);
}

.verdict-banner.false .verdict-glow {
    background: var(--red);
}

.verdict-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.verdict-emoji {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.verdict-label {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.verdict-desc {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-top: 2px;
    line-height: 1.5;
}

/* ── Metrics Row ─────────────────────────────────────────────────── */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 0.6rem;
    text-align: center;
    transition: border-color var(--transition);
}

.metric-card:hover {
    border-color: var(--border-hover);
}

.metric-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
}

/* ── Similarity Bar ──────────────────────────────────────────────── */
.sim-bar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.sim-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.sim-bar-pct {
    font-family: var(--font-mono);
    font-weight: 600;
}

.sim-bar-track {
    position: relative;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: visible;
}

.sim-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    width: 0;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.sim-bar-threshold {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    z-index: 2;
}

.sim-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 5px;
    position: relative;
}

.thresh-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Explanation Card ────────────────────────────────────────────── */
.explanation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s ease 0.2s both;
}

.explanation-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.explanation-text {
    font-size: 0.95rem;
    color: #d1d5db;
    line-height: 1.7;
}

.negation-badge {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--amber);
    padding: 4px 10px;
    background: var(--amber-glow);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ── Evidence Section ────────────────────────────────────────────── */
.evidence-section {
    margin-bottom: 1.5rem;
}

.evidence-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-light);
    background: var(--accent-soft);
    border: 1px solid rgba(124, 58, 237, 0.25);
    padding: 1px 8px;
    border-radius: var(--radius-full);
    margin-left: 4px;
}

.evidence-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fact-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    transition: all var(--transition);
    animation: slideInUp 0.35s ease both;
}

.fact-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fact-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.fact-rank {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.fact-body {
    flex: 1;
}

.fact-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.65;
}

.fact-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.category-tag {
    background: var(--accent-soft);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--accent-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.score-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.score-mini-bar {
    flex: 1;
    max-width: 130px;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.score-mini-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
}

.score-match-label {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.match-strong {
    color: var(--green);
    background: var(--green-glow);
}

.match-partial {
    color: var(--amber);
    background: var(--amber-glow);
}

.match-weak {
    color: var(--red);
    background: var(--red-glow);
}

/* ── Result Footer ───────────────────────────────────────────────── */
.result-footer {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    animation: fadeInUp 0.6s ease both;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.empty-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.app-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Upload Section ──────────────────────────────────────────────── */
.upload-section {
    margin-bottom: 2rem;
}

.upload-zone {
    border: 2px dashed rgba(124, 58, 237, 0.4);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(124, 58, 237, 0.02);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.upload-zone.drag-over {
    border-color: var(--accent-light);
    box-shadow: inset 0 0 0 2px var(--accent-glow), 0 8px 32px rgba(124, 58, 237, 0.3);
    background: rgba(124, 58, 237, 0.1);
}

.upload-content {
    pointer-events: none;
}

.upload-content .upload-browse {
    pointer-events: auto;
}

.upload-icon {
    color: var(--accent-light);
    margin-bottom: 0.8rem;
    opacity: 0.7;
}

.upload-primary {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.upload-secondary {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-browse {
    color: var(--accent-light);
    cursor: pointer;
    font-weight: 600;
    transition: color var(--transition);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-browse:hover {
    color: #c4b5fd;
}

.upload-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.upload-badge {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.badge-pdf {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.badge-image {
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.badge-video {
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.upload-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    opacity: 0.7;
}

/* File Preview */
.file-preview {
    text-align: left;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-preview-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.file-preview-details {
    flex: 1;
}

.file-preview-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.file-preview-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.file-remove-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.file-remove-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

.file-thumb-wrap {
    margin-top: 12px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    max-height: 200px;
}

.file-thumb {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    background: #0a0a14;
}

.upload-verify-btn {
    margin-top: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.35);
}

.upload-verify-btn:hover {
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.50);
}

/* ── File Results Section ────────────────────────────────────────── */
.file-results-section {
    animation: fadeInUp 0.5s ease both;
}

.file-meta-banner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.file-meta-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.75rem;
}

.file-meta-icon {
    font-size: 2rem;
}

.file-meta-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.file-meta-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.file-meta-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-meta-stats span {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* Extracted Text Card */
.extracted-text-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.extracted-text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background var(--transition);
}

.extracted-text-header:hover {
    background: var(--bg-elevated);
}

.extracted-toggle {
    font-size: 0.7rem;
    transition: transform var(--transition);
}

.extracted-toggle.open {
    transform: rotate(180deg);
}

.extracted-text-body {
    border-top: 1px solid var(--border);
    padding: 1rem;
}

.extracted-text-content {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 250px;
    overflow-y: auto;
    line-height: 1.7;
}

/* File Claim Cards */
.file-claims-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.claim-result-card {
    background: rgba(18, 18, 28, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: slideInUp 0.4s ease both;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.claim-result-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    opacity: 0.9;
}

.claim-result-card.card-true::before {
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

.claim-result-card.card-misleading::before {
    background: var(--amber);
    box-shadow: 0 0 12px var(--amber);
}

.claim-result-card.card-false::before {
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.claim-result-card.card-unverified::before {
    background: var(--slate-400, #94a3b8);
    box-shadow: 0 0 12px var(--slate-400, #94a3b8);
}

.claim-result-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.claim-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.6rem;
}

.claim-card-number {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-family: var(--font-mono);
    margin-top: 2px;
}

.claim-card-text {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.claim-card-verdict {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.claim-verdict-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-true {
    background: var(--green-glow);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-misleading {
    background: var(--amber-glow);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-false {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-unverified {
    background: rgba(148, 163, 184, 0.15);
    color: var(--slate-400, #94a3b8);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.claim-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.claim-card-meta .mini-score-bar {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.claim-card-meta .mini-score-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

.claim-card-explanation {
    margin-top: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: #a0a8b8;
    line-height: 1.6;
}

.claim-card-evidence {
    margin-top: 0.6rem;
}

.claim-card-evidence-toggle {
    font-size: 0.72rem;
    color: var(--accent-light);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition);
}

.claim-card-evidence-toggle:hover {
    color: #c4b5fd;
}

.claim-card-evidence-body {
    margin-top: 0.5rem;
}

.mini-fact {
    padding: 0.4rem 0.6rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mini-fact-score {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Source Attribution Badge ────────────────────────────────────── */
.source-tag {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.source-tag::before {
    content: "🏛️";
}

/* ── Navbar Dropdown History Section ─────────────────────────────────────────────── */
.nav-history-container {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-history-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

.nav-history-btn:hover,
.nav-history-container:focus-within .nav-history-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-history-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 12px;
    min-width: 320px;
    max-width: 400px;
    width: max-content;
    z-index: 999;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
}

.nav-history-container:hover .nav-history-dropdown,
.nav-history-container:focus-within .nav-history-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* History block inside dropdown */
.history-section {
    background: rgba(18, 18, 28, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(124, 58, 237, 0.1);
    padding: 1rem 1.25rem;
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
    margin: 0 -0.8rem;
    /* Offsets item padding for perfect text alignment */
}

/* Custom Scrollbar for Dropdown */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    transition: all var(--transition);
    cursor: pointer;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.history-claim {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}

.history-item:hover .history-claim {
    color: var(--text-primary);
}

.history-verdict-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.history-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.history-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    opacity: 0;
    outline: none;
}

.history-item:hover .history-menu-btn,
.history-menu-btn:focus {
    opacity: 1;
}

.history-menu-btn:hover,
.history-menu-btn:focus {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.history-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 140px;
    padding: 6px;
    z-index: 100;

    /* CSS driven dropdown */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
}

/* Show dropdown on hover or focus within the container Container */
.history-menu-container:hover .history-dropdown,
.history-menu-container:focus-within .history-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.history-dropdown-item {
    font-size: 0.85rem;
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    transition: background var(--transition);
}

.history-dropdown-item.delete-option {
    color: var(--red);
}

.history-dropdown-item.delete-option:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ── Tooltips ────────────────────────────────────────────────────── */
.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: normal;
    min-width: 250px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    text-align: center;
    line-height: 1.5;
    pointer-events: none;
    animation: fadeInUp 0.2s ease both;
}

.tooltip-hint {
    color: var(--text-muted);
    font-size: 0.8em;
    vertical-align: super;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .app-container {
        padding: 0 16px 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

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

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

    .pipeline {
        gap: 3px;
        padding: 0.8rem;
    }

    .pipe-label {
        font-size: 0.6rem;
    }

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

    .verdict-content {
        flex-direction: column;
        text-align: center;
    }

    .verdict-label {
        font-size: 1.4rem;
    }

    .result-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .navbar {
        gap: 8px;
        align-items: flex-start;
    }
}

/* ── Image Authentication Forensics ───────────────────────── */
.signal-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--transition), border-color var(--transition);
}

.signal-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.signal-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signal-icon {
    font-size: 1.15rem;
}

.signal-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-grow: 1;
}

.signal-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border-width: 1px;
    border-style: solid;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.signal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}