html {
    scroll-behavior: smooth;
}

:root {
    /* Core Colors */
    --bg: #ffffff;
    --surface: #f9f9fb;
    --surface-rgb: 249, 249, 251;
    --border: #e4e4e7;
    --primary: #6366f1; /* Electric Indigo */
    --primary-rgb: 99, 102, 241;
    --success: #10b981; /* Emerald Green */
    --danger: #ef4444;
    
    /* Text */
    --text-main: #09090b;
    --text-muted: #71717a;
    --input-bg: #ffffff;
    --history-hover: #f4f4f5;
}

[data-theme="dark"] {
    --bg: #09090b;
    --surface: #121215;
    --surface-rgb: 18, 18, 21;
    --border: #27272a;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --input-bg: #18181b;
    --history-hover: #1e1e22;
}

* { margin: 0; padding: 0; box-sizing: border-box; transition: background 0.3s ease, border 0.3s ease, color 0.3s ease; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

/* --- GLOBAL VINTAGE NOISE TEXTURE --- */
.global-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.025; 
    z-index: 9998;
}

/* --- SPLASH SCREEN --- */
#splash-screen {
    position: fixed;
    inset: 0;
    background-color: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-brand {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    letter-spacing: -1.5px;
}

.splash-brand i { color: var(--primary); }

.splash-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 3rem;
    font-weight: 600;
}

.splash-loader {
    width: 70px;
    height: 70px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    border-radius: 50%;
    animation: splashSpin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: 3rem;
}

@keyframes splashSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.splash-console {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    margin-bottom: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.splash-text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    line-height: 2;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.splash-text span {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
}

.splash-text span::before {
    content: '>';
    color: var(--primary);
    font-weight: bold;
    opacity: 0;
}

.splash-text span.active { color: var(--text-main); opacity: 1; }
.splash-text span.active::before,
.splash-text span.completed::before { opacity: 1; }
.splash-text span.completed { opacity: 1; }

.skip-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 100px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.skip-btn:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

/* --- MAIN VIEW --- */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.top-nav {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background-color: rgba(var(--surface-rgb), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand {
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.nav-controls { display: flex; align-items: center; gap: 20px; }

.mode-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.mode-container:hover { background: var(--history-hover); }
.current-mode { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.dropdown-icon { font-size: 0.7rem; color: var(--text-muted); }

.dropdown-menu {
    position: absolute;
    bottom: 120%; 
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    min-width: 220px;
    z-index: 100;
}

.dropdown-item {
    padding: 10px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.dropdown-item:hover { background: var(--history-hover); color: var(--text-main); }
.theme-btn { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }

.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;   /* 🔥 push content to top */
    padding-top: 2rem;
    padding: 2rem;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -1px;
}
.input-container {
    max-width: 650px;
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0.6rem 0.8rem;   /* 🔥 reduced from 1rem */
}

textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    resize: none;
    outline: none;
    min-height: 100px;
    font-family: inherit;
}

.input-actions {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin-top: 6px;
}

.send-btn {
    background: var(--text-main);
    color: var(--bg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- LOADING UI --- */
#loading-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.4s ease;
}

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

.scan-header { text-align: center; margin-bottom: 3rem; }
.scan-header h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.scan-header p { color: var(--text-muted); font-size: 0.95rem; }

.radar-container { position: relative; width: 240px; height: 240px; margin-bottom: 4rem; }
.radar-ring {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    border: 1px solid rgba(var(--primary-rgb), 0.2); border-radius: 50%;
}
.radar-ring:nth-child(1) { width: 100%; height: 100%; }
.radar-ring:nth-child(2) { width: 60%; height: 60%; }
.radar-ring:nth-child(3) { width: 20%; height: 20%; background: rgba(var(--primary-rgb), 0.1); }

.radar-sweep {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 70%, rgba(var(--primary-rgb), 0.3) 100%);
    animation: radarSpin 2.5s linear infinite;
}
.radar-sweep::after {
    content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 50%;
    background: var(--primary); transform-origin: bottom center;
}

@keyframes radarSpin { 100% { transform: rotate(360deg); } }

.radar-node { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.node-green { background: var(--success); box-shadow: 0 0 10px var(--success); width: 8px; height: 8px; }
.node-purple {
    background: var(--primary); box-shadow: 0 0 15px var(--primary);
    width: 14px; height: 14px; animation: pulseNode 2s ease-in-out infinite;
}

@keyframes pulseNode {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.scan-console {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 1.5rem 2rem; width: 100%; max-width: 500px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
}

.scan-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; color: var(--text-muted); }
.scan-row.active { color: var(--text-main); }
.scan-label { display: flex; align-items: center; gap: 12px; }
.scan-label i { font-size: 0.6rem; color: var(--primary); }
.scan-status { font-weight: bold; }
.status-check { color: var(--success); }
.status-loading { color: var(--primary); animation: blink 1s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }

/* --- UPGRADED RESULTS UI (GLASSMORPHISM + RETRO MINIMALISM) --- */
#result-screen {
    display: none;
    width: 100%;
    max-width: 650px;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.verdict-card {
    background: rgba(var(--surface-rgb), 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .verdict-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
}

.verdict-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.v-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.v-icon.valid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.b-valid { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.b-warning { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

#verdict-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.verdict-body {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

/* Stats Section */
.verdict-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: rgba(var(--surface-rgb), 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 8px;
}

.stat-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-main-val {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Progress Bar */
.progress-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(0,0,0,0.1); /* subtle glow */
}

.fill-valid { background: var(--success); }
.fill-warning { background: var(--danger); }

.stat-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.reset-btn {
    width: 100%;
    background: var(--text-main);
    color: var(--bg);
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- VERDICT TEXT COLORS --- */
.real-text {
    color: var(--success);
}

.fake-text {
    color: var(--danger);
}

.unverified-text {
    color: var(--text-muted);
}

/* --- AI META SECTION --- */
.ai-meta {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.ai-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.ai-extra p {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

/* --- ARTICLES LIST --- */
#articles-list {
    margin-top: 10px;
    padding-left: 18px;
}

#articles-list li {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

#articles-list a {
    color: var(--primary);
    text-decoration: none;
}

#articles-list a:hover {
    text-decoration: underline;
}


@media (max-width: 768px) {

    .workspace {
        padding: 1.2rem;
        max-width: 100%;
    }

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

    .input-container {
        padding: 0.9rem;
        border-radius: 18px;
    }

    textarea {
        font-size: 1rem;
        min-height: 80px;
    }

    .verdict-card {
        padding: 1.8rem;
    }

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

    .radar-container {
        width: 180px;
        height: 180px;
    }
}

#verdict-title {
    transition: color 0.3s ease;
}

#result-screen {
    max-height: calc(100vh - 120px); /* account for navbar */
    overflow-y: auto;
    padding-right: 6px;
}


#articles-list {
    max-height: 150px;
    overflow-y: auto;
}

#loading-screen {
    min-height: 60vh;
}

/* FULL HEIGHT FIX */
html, body {
  height: 100%;
  margin: 0;
}

/* MAIN LAYOUT */
.main-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* WORKSPACE TAKES FULL SPACE */
.workspace {
  flex: 1;
  display: flex;
}

/* PERFECT CENTERING */
#default-screen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;   /* horizontal */
  align-items: center;       /* vertical */
}

/* INNER CONTENT */
.center-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* LOCK INPUT SIZE */
.input-container {
  width: 600px;
  max-width: 50vw;
}

#main-input {
    height: 75px;          /* 🔥 smaller */
    min-height: 70px;
    max-height: 100px;

    padding: 8px 12px;
    font-size: 14px;

    resize: none;
}
/* FIX BRAND TEXT CASE */
.brand-text {
  text-transform: none;
}
