/* =========================================================
   Dark World Archives - styles.css (with broken-light flicker)
   ========================================================= */

/* === Font === */
@font-face {
    font-family: 'VT323';
    src: url('./font/VT323-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* === Reset Defaults === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'VT323', Courier, monospace;
}

/* === Entry Paragraphs === */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
    line-height: 1;
}

/* === Base Styles === */
body {
    background-color: #000;
    color: #00ff99;
    line-height: 2;
    font-size: 22px;
    font-family: 'VT323', 'Courier New', Courier, monospace;
}

a {
    color: #00ff99;
    text-decoration: none;
}

a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.disabled,
.inactive-link {
    color: #555;
    pointer-events: none;
}

/* === Layout Wrappers === */
.site-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* === Body Layout === */
.body-area {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* === Header === */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

/* === Social Icons === */
.social-icons img {
    width: 64px;
    margin: 0 5px;
    vertical-align: middle;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.social-icons a.disabled img {
    filter: grayscale(100%) brightness(0.5);
    opacity: 0.6;
    cursor: not-allowed;
}

.social-icons a.disabled {
    pointer-events: none;
}

/* === Global Image Rendering === */
img {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* === Sidebar === */
.sidebar {
    background-color: rgba(0, 0, 0, 0.6);
    border: 4px solid #00ff99;
    padding: 10px;
    flex: 0 0 20%;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin: 10px 0;
}

/* === Main Content === */
.content-panel {
    background-color: rgba(0, 0, 0, 0.6);
    border: 4px solid #00ff99;
    padding: 20px;
    flex: 1 1 auto;
}

.featured,
.recent-posts {
    margin-bottom: 20px;
}

/* === Widgets === */
.widget {
    border: 4px solid #00ff99;
    padding: 10px;
    margin-bottom: 20px;
}

/* === Database Panel === */
.database-panel {
    display: flex;
}

/* === Terminal Header === */
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* === Blinking Cursor === */
.cursor {
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* === Enlarged Planet Scan GIF === */
.terminal-scan {
    width: 25rem;
    height: 15rem;
    display: block;
    transform: translateY(-10px);
    margin-left: auto;
    image-rendering: pixelated;
}

.world-map-scan {
    display: block;
    margin: 0 auto;
    width: 98%;                 /* fills almost the entire width */
    max-width: 60rem;           /* adjust as needed */
    height: auto;
    transform: translateY(-10px);
    image-rendering: pixelated;
}

/* === Database Links === */
.database-links {
    display: flex;
    flex-direction: column;
}

.db-entry {
    display: block;
    margin: 5px 0;
    color: #00ff99;
}

/* =========================================================
   REDACTED TEXT - BROKEN LIGHT FLICKER EFFECT
   ========================================================= */

.db-entry.redacted {
    position: relative;
    display: inline-block;
    color: #00ff99;
    opacity: 1;
    animation: redacted-flicker 4s infinite steps(1, end);
}

/* FLICKER KEYFRAMES */
@keyframes redacted-flicker {
    0%, 3%, 5%, 10%, 13%, 17%, 25%, 26%, 30%, 32%, 40%, 41%, 43%, 47%, 50%, 53%, 60%, 65%, 70%, 72%, 75%, 77%, 85%, 90%, 95%, 100% {
        opacity: 1;
    }
    4%, 11%, 18%, 27%, 31%, 42%, 46%, 51%, 61%, 66%, 71%, 76%, 86%, 91%, 96% {
        opacity: 0.15;
    }
    6%, 28%, 33%, 44%, 55%, 73%, 78%, 88%, 93%, 98% {
        opacity: 0;
    }
}

/* Each redacted line flickers asynchronously */
.db-entry.redacted:nth-child(1) { animation-delay: 0s; }
.db-entry.redacted:nth-child(2) { animation-delay: 1.2s; }
.db-entry.redacted:nth-child(3) { animation-delay: 2.4s; }
.db-entry.redacted:nth-child(4) { animation-delay: 3.6s; }
.db-entry.redacted:nth-child(5) { animation-delay: 0.8s; }

/* ========================================================= */

/* === Footer === */
footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}

/* === Grid Background Overlay === */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(#00ff33 1px, transparent 1px),
                      linear-gradient(90deg, #00ff33 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* === Responsive === */
@media only screen and (max-width: 600px) {
    .database-panel {
        flex-direction: column-reverse;
    }
}
