@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Professional Cyber-Security Palette: #B6FF3B & #0C1A2B */
    --primary: #B6FF3B;
    --primary-dim: rgba(182, 255, 59, 0.1);
    --primary-glow: rgba(182, 255, 59, 0.25);

    --bg-dark: #0C1A2B;
    --bg-surface: #112235;
    --bg-card: #162B44;

    --text-main: #FFFFFF;
    --text-muted: #A0AEC0;
    --text-dim: #4A5568;

    --success: #00FF9D;
    --warning: #FFB344;
    --danger: #FF4444;
    --info: #00D1FF;

    --border: rgba(255, 255, 255, 0.05);
    --border-bright: rgba(182, 255, 59, 0.2);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.navbar {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Dashboard Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 4px;
    position: relative;
    border-top: 2px solid transparent;
    transition: var(--transition);
}

.stat-card:hover {
    border-top-color: var(--primary);
    background: var(--bg-card);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    display: block;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tables & Lists */
.surface {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.table-header {
    display: grid;
    grid-template-columns: 100px 1fr 200px 150px 50px;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

.case-row {
    display: grid;
    grid-template-columns: 100px 1fr 200px 150px 50px;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.case-row:hover {
    background: rgba(182, 255, 59, 0.03);
}

.case-row:last-child {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-critical {
    background: var(--danger);
    color: white;
}

.badge-high {
    background: rgba(255, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge-medium {
    background: rgba(255, 179, 68, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-low {
    background: rgba(0, 255, 157, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

/* Typography */
h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Timeline */
.timeline {
    border-left: 2px solid var(--border);
    margin-left: 1rem;
    padding-left: 2.5rem;
    position: relative;
}

.timeline-event {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -3.05rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--primary);
    border-radius: 50%;
}

/* Animations */
.animate-in {
    opacity: 0;
    transform: translateY(15px);
    animation: reveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- CYBER-SMOOTH ANIMATIONS (V4) --- */

/* Subtle Static Grid with Light Pulse */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(182, 255, 59, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(182, 255, 59, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
    animation: gridAura 10s ease-in-out infinite alternate;
}

@keyframes gridAura {
    from {
        opacity: 0.3;
    }

    to {
        opacity: 0.7;
    }
}

/* Ambient Deep-Space Orbs */
.bg-orb {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    z-index: -2;
    filter: blur(120px);
    pointer-events: none;
    opacity: 0.3;
    animation: orbDrift 30s infinite alternate ease-in-out;
}

.orb-1 {
    top: -20%;
    left: -10%;
    background: radial-gradient(circle, rgba(182, 255, 59, 0.12) 0%, transparent 75%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    background: radial-gradient(circle, rgba(0, 209, 255, 0.12) 0%, transparent 75%);
    animation-delay: -10s;
}

@keyframes orbDrift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(100px, 50px);
    }
}

/* Sophisticated Scanline */
.bg-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent,
            rgba(182, 255, 59, 0.02) 50%,
            transparent);
    background-size: 100% 200%;
    z-index: -1;
    pointer-events: none;
    animation: scanSmooth 15s linear infinite;
}

@keyframes scanSmooth {
    0% {
        background-position: 0 0%;
    }

    100% {
        background-position: 0 200%;
    }
}

/* --- KINETIC PIPELINE ANIMATIONS (V5) --- */

/* Sequential Line Flow */
.arch-flow-line {
    width: 120px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: visible;
}

.arch-packet {
    position: absolute;
    width: 6px;
    height: 2px;
    background: var(--primary);
    top: -0.5px;
    box-shadow: 0 0 10px var(--primary);
    animation: pipelineTravel 2s infinite linear;
}

@keyframes pipelineTravel {
    0% {
        left: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* 1. Signal Animation: Incoming Logs */
.signal-node {
    position: relative;
}

.signal-node::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--info) 0%, transparent 60%);
    opacity: 0.2;
    animation: signalPulse 2s infinite;
}

@keyframes signalPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.3;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.1;
    }
}

/* 2. Logic Engine: Intensive Processing */
.engine-node {
    position: relative;
}

.engine-core {
    animation: engineProcessing 4s infinite linear;
}

@keyframes engineProcessing {
    0% {
        filter: drop-shadow(0 0 5px var(--primary));
    }

    25% {
        filter: drop-shadow(0 0 20px var(--primary)) brightness(1.2);
    }

    50% {
        filter: drop-shadow(0 0 5px var(--primary));
    }

    75% {
        filter: drop-shadow(0 0 20px var(--info)) brightness(1.2);
    }

    100% {
        filter: drop-shadow(0 0 5px var(--primary));
    }
}

/* 3. Mitigation: Neutralization Flash */
.mitigation-node {
    position: relative;
}

.mitigation-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: var(--success);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    animation: neutralization 2s infinite ease-out;
    animation-delay: 1.5s;
    /* Sync with packet flow */
}

@keyframes neutralization {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Hero Shimmer */
.shimmer-text {
    position: relative;
    color: var(--text-main);
    background: linear-gradient(90deg, #fff, var(--primary), #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.pulse-aura {
    animation: auraPulse 4s infinite ease-in-out;
}

@keyframes auraPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(182, 255, 59, 0.1), inset 0 0 10px rgba(182, 255, 59, 0.05);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 40px rgba(182, 255, 59, 0.3), inset 0 0 20px rgba(182, 255, 59, 0.1);
        transform: scale(1.02);
    }
}

/* --- AEGIS MODAL SYSTEM --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 26, 43, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: rgba(13, 25, 41, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(182, 255, 59, 0.2);
    width: 100%;
    max-width: 550px;
    padding: 3.5rem;
    position: relative;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5), 0 0 30px rgba(182, 255, 59, 0.05);
    animation: modalReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--primary), transparent, var(--info));
    z-index: -1;
    opacity: 0.3;
}

@keyframes modalReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--primary);
    background: rgba(182, 255, 59, 0.1);
    transform: rotate(90deg);
}

.success-state {
    text-align: center;
    display: none;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(182, 255, 59, 0.1);
    border: 1px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: var(--primary);
    box-shadow: 0 0 20px rgba(182, 255, 59, 0.2);
}

.guide-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
    font-family: inherit;
}

.guide-tab.active {
    background: var(--info);
    color: var(--bg-dark);
    border-color: var(--info);
}

.guide-tab:hover:not(.active) {
    border-color: var(--info);
    color: var(--info);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.form-input,
.form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(255, 255, 255, 0.05);
}

.sandbox-terminal {
    background: #000;
    border: 1px solid var(--border);
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--success);
    height: 300px;
    overflow-y: auto;
    margin-top: 1.5rem;
    display: none;
}

.terminal-line {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.75rem;
}

.terminal-prompt {
    color: var(--primary);
}