/**
 * Bot & Threat Detection System Documentation Styles
 * Electric Dark Blue Theme with WebGPU Animations
 * CSP-Compliant External Stylesheet
 */

:root {
    --electric-blue: #00d4ff;
    --deep-blue: #0a1929;
    --darker-blue: #050c14;
    --accent-cyan: #00ffff;
    --accent-purple: #b820ff;
    --success-color: #00ff88;
    --warning-color: #ffaa00;
    --danger-color: #ff2070;
    --text-primary: #e3f2fd;
    --text-secondary: #90caf9;
    --border-color: rgba(0, 212, 255, 0.2);
    --card-bg: rgba(10, 25, 41, 0.85);
    --code-bg: #0d1b2a;
}

/* CSP-Compliant utility classes */
.unstyled-list {
    list-style: none;
    padding-left: 0;
}

.unstyled-list-small {
    list-style: none;
    padding-left: 0;
    font-size: 0.9em;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--darker-blue);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(184, 32, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
    animation: electricPulse 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes electricPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

#webgpu-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.logo-svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 20px var(--electric-blue));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--electric-blue), var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2); }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 0;
}

.main-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

.sidebar {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 2rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    font-weight: 700;
    color: var(--electric-blue);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9375rem;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--electric-blue);
    border-color: var(--border-color);
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(184, 32, 255, 0.2));
    color: var(--electric-blue);
    border-color: var(--electric-blue);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.3),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 212, 255, 0.1);
    border: 1px solid var(--border-color);
}

.section {
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }

h2 {
    font-size: 2.25rem;
    color: var(--electric-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    font-weight: 700;
}

h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    color: var(--accent-cyan);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.architecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.layer-card {
    background: linear-gradient(135deg, rgba(10, 25, 41, 0.95), rgba(13, 27, 42, 0.95));
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.layer-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--electric-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.4s;
}

.layer-card:hover::before {
    opacity: 1;
}

.layer-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 212, 255, 0.3);
    border-color: var(--electric-blue);
}

.layer-title {
    font-weight: 700;
    color: var(--electric-blue);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.layer-tech {
    color: var(--accent-cyan);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-style: italic;
    opacity: 0.9;
}

code {
    background: var(--code-bg);
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--accent-cyan);
    border: 1px solid var(--border-color);
}

pre {
    background: var(--code-bg);
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
}

.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--electric-blue);
    color: var(--deep-blue);
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 20px currentColor;
}

.status-operational {
    background: var(--success-color);
    color: var(--deeper-blue);
}

.status-warning {
    background: var(--warning-color);
    color: var(--deeper-blue);
}

.status-critical {
    background: var(--danger-color);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(184, 32, 255, 0.1));
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--electric-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-flow {
    background: linear-gradient(135deg, rgba(10, 25, 41, 0.6), rgba(13, 27, 42, 0.6));
    border-radius: 1rem;
    padding: 2.5rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.flow-step {
    position: relative;
    padding-left: 4rem;
    padding-bottom: 2.5rem;
}

.flow-step::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--electric-blue), var(--accent-purple));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.8); }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

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

    header {
        padding: 2rem;
    }

    .content {
        padding: 2rem;
    }
}

/* Electric Cursor and Trail Styles */
body {
    cursor: none;
}

.electric-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--electric-blue);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 20px var(--electric-blue),
        inset 0 0 10px var(--electric-blue);
    animation: cursorPulse 1.5s ease-in-out infinite;
}

@keyframes cursorPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.cursor-trail {
    width: 8px;
    height: 8px;
    background: var(--electric-blue);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--electric-blue);
    opacity: 0.6;
}

a, button, .nav-link {
    cursor: none;
}

a:hover ~ .electric-cursor,
button:hover ~ .electric-cursor,
.nav-link:hover ~ .electric-cursor {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--accent-cyan);
    box-shadow:
        0 0 30px var(--accent-cyan),
        inset 0 0 15px var(--accent-cyan);
}
