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

:root {
    --bg: #0a0a0f;
    --bg2: #0f0f1a;
    --surface: #141422;
    --surface2: #1a1a2e;
    --border: #2a2a4a;
    --text: #e0e0f0;
    --text-dim: #8888aa;
    --accent: #00ff88;
    --accent2: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.15);
    --cyan: #00e5ff;
    --purple: #a855f7;
    --red: #ff3366;
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --font-body: 'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

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

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

/* ========== MATRIX CANVAS ========== */
#matrix-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.25;
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 700; font-size: 1.3rem;
    color: var(--accent);
}

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

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.25s;
    cursor: pointer; border: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent2);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ========== HERO ========== */
.hero {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
}

.hero-content { max-width: 700px; }

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--cyan);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0, 255, 136, 0.08);
    margin-bottom: 1rem;
}

/* Glitch effect */
.glitch {
    position: relative;
    animation: glitch-skew 4s infinite linear alternate-reverse;
}
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
}
.glitch::before {
    color: var(--cyan);
    animation: glitch-1 3s infinite linear alternate-reverse;
    clip-path: inset(0 0 80% 0);
}
.glitch::after {
    color: var(--red);
    animation: glitch-2 2.5s infinite linear alternate-reverse;
    clip-path: inset(80% 0 0 0);
}

@keyframes glitch-1 {
    0%, 90% { transform: translate(0); }
    92% { transform: translate(-3px, 1px); }
    94% { transform: translate(3px, -1px); }
    96% { transform: translate(-2px, 2px); }
    100% { transform: translate(0); }
}
@keyframes glitch-2 {
    0%, 88% { transform: translate(0); }
    90% { transform: translate(3px, -2px); }
    93% { transform: translate(-3px, 1px); }
    96% { transform: translate(2px, 1px); }
    100% { transform: translate(0); }
}
@keyframes glitch-skew {
    0%, 95% { transform: skew(0deg); }
    96% { transform: skew(0.5deg); }
    98% { transform: skew(-0.3deg); }
    100% { transform: skew(0deg); }
}

.hero-sub {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ========== STATS BAR ========== */
.stats-bar {
    position: relative; z-index: 1;
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ========== FEATURES ========== */
.features {
    position: relative; z-index: 1;
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 3rem;
    color: var(--text);
    letter-spacing: 0.05em;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s;
}
.feature-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateY(-3px);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}
.feature-card p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ========== WORKFLOW ========== */
.workflow {
    position: relative; z-index: 1;
    padding: 4rem 2rem 6rem;
    max-width: 900px;
    margin: 0 auto;
}

.workflow-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.step {
    flex: 1;
    min-width: 180px;
    text-align: center;
    padding: 1rem;
}

.step-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.step-content h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}
.step-content p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin-top: 2.5rem;
    flex-shrink: 0;
}

/* ========== CTA ========== */
.cta {
    position: relative; z-index: 1;
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(180deg, transparent, var(--surface) 30%, var(--surface) 70%, transparent);
}

.cta h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}
.cta p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* ========== FOOTER ========== */
footer {
    position: relative; z-index: 1;
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
}

footer p { font-size: 0.8rem; color: var(--text-dim); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.8rem; }
    .stats-bar { gap: 1.5rem; }
    .stat-num { font-size: 1.5rem; }
    .step-connector { display: none; }
    .workflow-steps { flex-direction: column; align-items: center; }
    .footer-inner { justify-content: center; text-align: center; }
}

/* ========== ANALYZE PAGE ========== */
.analyze-page {
    position: relative; z-index: 1;
    min-height: 100vh;
    padding: 7rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.analyze-page h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.analyze-subtitle {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 3rem;
    font-size: 0.95rem;
}

/* Tabs */
.tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--surface);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(0, 255, 136, 0.03);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-zone p { color: var(--text-dim); margin-bottom: 0.3rem; }
.upload-zone .upload-hint { font-size: 0.8rem; color: var(--text-dim); opacity: 0.6; }

.upload-zone input[type="file"] { display: none; }

/* Hash search */
.hash-search {
    display: flex;
    gap: 0.75rem;
}

.hash-input {
    flex: 1;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.hash-input::placeholder { color: var(--text-dim); opacity: 0.5; }
.hash-input:focus { border-color: var(--accent); }

.hash-search .btn { white-space: nowrap; }

/* Results */
.result-area {
    margin-top: 2.5rem;
    display: none;
}
.result-area.visible { display: block; }

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.result-verdict {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}
.verdict-clean { background: rgba(0, 255, 136, 0.15); color: var(--accent); }
.verdict-malicious { background: rgba(255, 51, 102, 0.15); color: var(--red); }
.verdict-analyzing { background: rgba(0, 229, 255, 0.15); color: var(--cyan); }

.result-filename {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-all;
}

.result-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}
.meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.meta-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
    word-break: break-all;
}

.detection-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}
.detection-bar h3 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.bar-track {
    height: 8px;
    background: var(--surface2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}
.bar-fill.safe { background: var(--accent); }
.bar-fill.danger { background: var(--red); }

.detection-score {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Spinner */
.spinner {
    display: none;
    text-align: center;
    padding: 3rem;
}
.spinner.visible { display: block; }

.spinner-ring {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner p {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
}
