/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Lucida Console', 'Consolas', monospace;
    background: #000000;
    color: #00ff00;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* ===== SCANLINE ===== */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03) 0px,
        rgba(0, 255, 0, 0.03) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9997;
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

/* ===== CRT FLICKER ===== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

/* ===== MATRIX CANVAS ===== */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.2;
    pointer-events: none;
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== ASCII BANNER ===== */
.ascii-banner {
    color: #00ff00;
    font-size: 0.45rem;
    line-height: 1.05;
    text-align: center;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 8px #00ff00, 0 0 20px #00ff00;
    opacity: 0.75;
    letter-spacing: 1px;
    user-select: none;
    word-break: break-all;
}

/* ===== DOX CARD ===== */
.dox-card {
    background: rgba(0, 10, 0, 0.9);
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.25), inset 0 0 20px rgba(0, 255, 0, 0.03);
    border-radius: 4px;
    padding: 1.75rem 1.5rem;
    width: 100%;
    backdrop-filter: blur(2px);
}

/* ===== HEADER ===== */
.dox-header {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 3px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 30px #00ff00;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blink-cursor {
    animation: blink 0.7s step-end infinite;
}

/* ===== SEPARATOR ===== */
.dox-separator {
    text-align: center;
    color: #008800;
    font-size: 0.6rem;
    letter-spacing: 1px;
    opacity: 0.5;
    margin: 0.4rem 0;
    user-select: none;
}

/* ===== QUERY BAR ===== */
.dox-query {
    background: rgba(0, 255, 0, 0.04);
    border: 1px solid #004400;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #00cc00;
    margin: 0.5rem 0;
    word-break: break-all;
}

.prompt {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
}

/* ===== STATUS BAR ===== */
.status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.75rem;
    color: #00aa00;
}

.status-dot {
    color: #00ff00;
    text-shadow: 0 0 8px #00ff00;
    animation: pulse 2s ease-in-out infinite;
}

.status-text {
    color: #00ff00;
    font-weight: bold;
    letter-spacing: 2px;
}

.status-info {
    color: #006600;
    font-size: 0.7rem;
}

/* ===== SECTION TITLE ===== */
.section-title {
    color: #00ff00;
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 2px;
    padding: 0.5rem 0 0.3rem 0;
    border-bottom: 1px dashed #004400;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 5px #00ff00;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== FIELD ===== */
.dox-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.45rem 0 0.45rem 0.5rem;
    font-size: 0.85rem;
    border-left: 2px solid transparent;
    transition: all 0.3s;
}

.dox-field:hover {
    border-left-color: #00ff00;
    background: rgba(0, 255, 0, 0.03);
}

.tag {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
}

.arrow {
    color: #006600;
    font-weight: bold;
}

.dox-field .value {
    color: #00dd00;
}

.dox-field .value a {
    color: #00ff00;
    text-decoration: none;
    border-bottom: 1px dotted #006600;
    transition: all 0.2s;
}

.dox-field .value a:hover {
    text-shadow: 0 0 8px #00ff00;
    border-bottom-color: #00ff00;
}

.leaked {
    color: #ff6600 !important;
    text-shadow: 0 0 8px #ff6600;
    font-weight: bold;
}

/* ===== BADGES ===== */
.badge-primary {
    display: inline-block;
    background: #003300;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-size: 0.55rem;
    padding: 1px 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 5px #00ff00;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.badge-secondary {
    display: inline-block;
    background: #331100;
    border: 1px solid #ff6600;
    color: #ff6600;
    font-size: 0.55rem;
    padding: 1px 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 5px #ff6600;
}

.badge-age {
    display: inline-block;
    background: #001a00;
    border: 1px solid #006600;
    color: #008800;
    font-size: 0.55rem;
    padding: 1px 6px;
    letter-spacing: 1px;
}

.badge-sensitive {
    display: inline-block;
    background: #330000;
    border: 1px solid #ff0000;
    color: #ff3333;
    font-size: 0.55rem;
    padding: 1px 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #ff0000;
    animation: pulse 1.5s ease-in-out infinite;
}

.badge-gallery {
    display: inline-block;
    background: #001133;
    border: 1px solid #0066ff;
    color: #3388ff;
    font-size: 0.55rem;
    padding: 1px 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #0066ff;
}

/* ===== GLITCH ===== */
.glitch {
    position: relative;
    color: #00ff00;
    text-shadow: 0 0 8px #00ff00;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch::before {
    color: #ff00ff;
    z-index: -1;
    animation: glitchShift 3s infinite linear alternate-reverse;
}

.glitch::after {
    color: #00ffff;
    z-index: -2;
    animation: glitchShift 2s infinite linear alternate-reverse;
}

@keyframes glitchShift {
    0% { transform: translate(0); opacity: 0; }
    1% { transform: translate(-2px, 2px); opacity: 0.8; }
    2% { transform: translate(2px, -1px); opacity: 0.6; }
    3% { transform: translate(0); opacity: 0; }
    100% { transform: translate(0); opacity: 0; }
}

/* ===== PULSE ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== ASSOCIATED CARD ===== */
.assoc-card {
    background: rgba(255, 102, 0, 0.04);
    border: 1px solid #442200;
    border-left: 3px solid #ff6600;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 2px;
}

.assoc-header {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.assoc-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.8rem;
}

.assoc-label {
    color: #886600;
    min-width: 70px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.assoc-value {
    color: #ddbb00;
}

/* ===== GALLERY ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem 0;
}

.gallery-item {
    border: 1px solid #004400;
    background: rgba(0, 20, 0, 0.6);
    padding: 0.5rem;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
    transform: translateY(-3px);
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border: 1px solid #002200;
    filter: grayscale(30%) contrast(1.1);
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    filter: grayscale(0%) contrast(1);
    border-color: #00ff00;
}

.gallery-filename {
    text-align: center;
    font-size: 0.6rem;
    color: #006600;
    padding-top: 0.4rem;
    letter-spacing: 1px;
    text-transform: lowercase;
    font-family: 'Courier New', monospace;
}

.gallery-item:hover .gallery-filename {
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

/* ===== COPY BUTTON ===== */
.copy-btn {
    background: transparent;
    border: 1px solid #004400;
    color: #006600;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    padding: 1px 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.copy-btn:hover {
    background: #00ff00;
    color: #000000;
    border-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.copy-btn.copied {
    background: #00ff00;
    color: #000;
    border-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
    animation: lightboxIn 0.3s ease;
}

@keyframes lightboxIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #00ff00;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 0 10px #00ff00;
    z-index: 10001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ffffff;
    text-shadow: 0 0 20px #00ff00;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    color: #00ff00;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
    text-align: center;
    width: 100%;
    padding: 0.5rem;
}

/* ===== FOOTER ===== */
.dox-footer {
    margin-top: 1rem;
    text-align: center;
}

.footer-line {
    font-size: 0.7rem;
    padding: 0.15rem 0;
    color: #006600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.footer-tag {
    color: #ff6600;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 5px #ff6600;
}

.footer-info {
    color: #004400;
}

.footer-warn {
    color: #ff0000;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #ff0000;
    font-size: 0.6rem;
}

.cursor-line {
    color: #008800;
    margin-top: 0.3rem;
}

/* ===== JSON PANEL ===== */
.json-panel {
    background: #0a0a0a;
    border: 1px solid #003300;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.05);
}

.json-header {
    background: #111111;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid #003300;
}

.json-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.json-dot.red { background: #ff5f56; }
.json-dot.yellow { background: #ffbd2e; }
.json-dot.green { background: #27c93f; }

.json-title {
    color: #006600;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    letter-spacing: 1px;
}

.json-body {
    padding: 0.75rem;
    overflow-x: auto;
}

.json-body pre {
    color: #00aa00;
    font-size: 0.65rem;
    line-height: 1.3;
    white-space: pre;
    tab-size: 2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .dox-card {
        padding: 1rem 0.75rem;
    }

    .dox-header {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .dox-field {
        font-size: 0.75rem;
        padding: 0.35rem 0 0.35rem 0.3rem;
    }

    .ascii-banner {
        font-size: 0.28rem;
    }

    .status-bar {
        font-size: 0.65rem;
    }

    .json-body pre {
        font-size: 0.5rem;
    }

    .dox-query {
        font-size: 0.65rem;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-item img {
        height: 220px;
    }
}

@media (max-width: 450px) {
    .dox-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .ascii-banner {
        font-size: 0.2rem;
    }

    .assoc-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }

    .gallery-item img {
        height: 180px;
    }
}