/* ========================================
   PROTOCOLO ARIA - STYLE SYSTEM
   Classified Document: ARIA-CSS-001
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --bg-terminal: #050505;
    --green-primary: #00ff41;
    --green-dim: #00aa2a;
    --green-glow: rgba(0, 255, 65, 0.3);
    --amber-primary: #ffb000;
    --amber-dim: #cc8800;
    --amber-glow: rgba(255, 176, 0, 0.3);
    --red-alert: #ff3333;
    --text-dim: #444444;
    --scanline-opacity: 0.03;
}

/* === BODY & CONTAINER === */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'VT323', 'Courier New', Courier, monospace;
    background-color: var(--bg-primary);
    color: var(--green-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.4;
    font-size: 1.25rem;
}

/* === CRT EFFECTS === */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 9999;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 90%,
        rgba(0, 0, 0, 0.6) 100%
    );
    pointer-events: none;
    z-index: 9998;
}

/* === MAIN CONTAINER === */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* === TERMINAL SCREEN === */
.terminal {
    background-color: var(--bg-terminal);
    border: 2px solid var(--green-dim);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow:
        0 0 20px var(--green-glow),
        inset 0 0 60px rgba(0, 255, 65, 0.05);
}

.terminal.amber {
    border-color: var(--amber-dim);
    box-shadow:
        0 0 20px var(--amber-glow),
        inset 0 0 60px rgba(255, 176, 0, 0.05);
}

.terminal.amber .terminal-text,
.terminal.amber .prompt {
    color: var(--amber-primary);
}

/* === TERMINAL TEXT === */
.terminal-text {
    color: var(--green-primary);
    margin-bottom: 0.5rem;
}

.prompt {
    color: var(--green-primary);
}

.prompt::before {
    content: "> ";
}

/* === BLINKING CURSOR === */
.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--green-primary);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

.amber .cursor {
    background-color: var(--amber-primary);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* === TYPEWRITER EFFECT === */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--green-primary);
    animation:
        typing 2s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--green-primary); }
}

/* === HEADER === */
.header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--green-dim);
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    text-shadow: 0 0 10px var(--green-glow);
    letter-spacing: 4px;
}

.header .subtitle {
    color: var(--green-dim);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* === NAVIGATION === */
.nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav a {
    color: var(--green-dim);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav a:hover,
.nav a.active {
    color: var(--green-primary);
    border-color: var(--green-primary);
    text-shadow: 0 0 10px var(--green-glow);
    box-shadow: 0 0 10px var(--green-glow);
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: transparent;
    border: 2px solid var(--green-primary);
    color: var(--green-primary);
    font-family: inherit;
    font-size: 1.2rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn:hover {
    background-color: var(--green-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--green-glow);
}

.btn.amber {
    border-color: var(--amber-primary);
    color: var(--amber-primary);
}

.btn.amber:hover {
    background-color: var(--amber-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--amber-glow);
}

/* === WARNING BOX === */
.warning {
    border: 2px solid var(--red-alert);
    padding: 1rem;
    margin: 1.5rem 0;
    background-color: rgba(255, 51, 51, 0.1);
    animation: warning-pulse 2s ease-in-out infinite;
}

.warning-text {
    color: var(--red-alert);
}

@keyframes warning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === DOCUMENT CARDS === */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.document-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--green-dim);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    border-color: var(--green-primary);
    box-shadow: 0 0 15px var(--green-glow);
    transform: translateY(-2px);
}

.document-card .doc-id {
    color: var(--amber-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.document-card .doc-title {
    color: var(--green-primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.document-card .doc-date {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.document-card .doc-classification {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background-color: var(--red-alert);
    color: var(--bg-primary);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* === YEAR SECTIONS === */
.year-section {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--green-dim);
}

.year-section h2 {
    color: var(--amber-primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px var(--amber-glow);
}

/* === GALLERY === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.gallery-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--green-dim);
    padding: 1rem;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: var(--green-primary);
    box-shadow: 0 0 20px var(--green-glow);
}

.gallery-item .image-placeholder {
    width: 100%;
    height: 200px;
    background:
        linear-gradient(45deg, var(--bg-terminal) 25%, transparent 25%),
        linear-gradient(-45deg, var(--bg-terminal) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--bg-terminal) 75%),
        linear-gradient(-45deg, transparent 75%, var(--bg-terminal) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border: 1px solid var(--green-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.gallery-item .image-placeholder::after {
    content: "[IMAGE DATA]";
    color: var(--green-dim);
    font-size: 0.9rem;
}

.gallery-item .output-id {
    color: var(--amber-primary);
    font-size: 0.85rem;
}

.gallery-item .output-title {
    color: var(--green-primary);
    font-size: 1.1rem;
    margin: 0.3rem 0;
}

.gallery-item .output-date {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* === ASCII ART CONTAINER === */
.ascii-art {
    font-size: 0.6rem;
    line-height: 1;
    color: var(--green-dim);
    text-align: center;
    margin: 2rem 0;
    white-space: pre;
    overflow-x: auto;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--green-dim);
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* === GLITCH EFFECT === */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite;
    color: var(--red-alert);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite;
    color: var(--amber-primary);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(60% 0 20% 0); transform: translate(-1px, 1px); }
    80% { clip-path: inset(80% 0 0% 0); transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(60% 0 20% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 0% 0); transform: translate(1px, -1px); }
    80% { clip-path: inset(0% 0 80% 0); transform: translate(-1px, 1px); }
}

/* === FLICKER ANIMATION === */
.flicker {
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* === LOADING BAR === */
.loading-bar {
    width: 100%;
    height: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--green-dim);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.loading-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--green-primary);
    animation: loading 3s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .terminal {
        padding: 1rem;
        margin: 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .document-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .ascii-art {
        font-size: 0.4rem;
    }
}

/* === HIDDEN TEXT REVEAL === */
.classified {
    background-color: var(--green-primary);
    color: var(--green-primary);
    transition: all 0.3s ease;
    padding: 0 0.3rem;
}

.classified:hover {
    background-color: transparent;
    color: var(--red-alert);
}

/* === STATIC NOISE OVERLAY === */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
