/* =========================================================
   GLOBAL TERMINAL THEME VARIABLES
========================================================= */
:root {
    --primary-color: #00FF41;
    --secondary-color: #008000;
    --background-color: #000000;
    --text-color: var(--primary-color);
    --border-color: var(--secondary-color);
}

/* =========================================================
   BASE LAYOUT
========================================================= */
/* CRITICAL SAFETY: Ensure no image ever exceeds the main content width */
img {
    max-width: 100%;
    height: auto;
    display: block; /* Prevents weird spacing issues */
}
body {
    position: relative;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'VT323', monospace;
    font-size: 1.1em;
    overflow-x: hidden; 
    animation: crt-flicker 0.15s infinite;
}

/* -------------------------------------------
   VHS TRACKING/NOISE BAR (HIGH VISIBILITY)
------------------------------------------- */

/* Keyframes for the Tracking Bar Animation (UPDATED OPACITY) */
@keyframes tracking-noise {
    0%   { opacity: 0; top: 0; }
    1%   { opacity: 0.2; top: 20%; } 
    3%   { opacity: 0; } 
    50%  { opacity: 0; top: 80%; }
    51%  { opacity: 0.3; top: 75%; } 
    53%  { opacity: 0; }
    100% { opacity: 0; }
}

/* body::before: Persistent noise layer (white static) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.2) 50%
    ), 
    repeating-linear-gradient(
        90deg, 
        rgba(255, 0, 0, 0.02), 
        rgba(0, 255, 0, 0.01), 
        rgba(0, 0, 255, 0.02)
    );
    background-size: 100% 4px, 3px 100%;
    z-index: 9999;
    pointer-events: none; /* VERY IMPORTANT: keeps nav clickable */
}

/* body::after: The animated tracking bar (UPDATED HEIGHT) */
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 30px; 
    top: 0; 
    background: rgba(255, 255, 255, 0.1); 
    opacity: 0;
    filter: blur(5px); 
    animation: tracking-noise 8s infinite ease-out; 
    pointer-events: none;
    z-index: 10000; 
}
@keyframes crt-flicker {
    0% { opacity: 0.99; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* -------------------------------------------
   VHS JITTER ANIMATION (SUBDUED)
------------------------------------------- */
@keyframes vhs-jitter {
    0% {
        transform: translate(0, 0);
        box-shadow:
            0 0 10px var(--secondary-color),
            0 0 20px var(--secondary-color) inset;
    }
    30% {
        transform: translate(-0.2px, 0.2px); 
    }
    60% {
        transform: translate(0.2px, -0.2px); 
    }
    100% {
        transform: translate(0, 0);
        box-shadow:
            0 0 15px rgba(0, 255, 65, 0.8),
            0 0 25px var(--secondary-color) inset;
    }
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--secondary-color);
    min-height: 80vh;
    border-radius: 5px;
    
    box-shadow:
        0 0 10px var(--secondary-color),
        0 0 20px var(--secondary-color) inset,
        0 0 40px rgba(0, 255, 65, 0.1);
    
    animation: vhs-jitter 1s infinite alternate; 
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

/* -------------------------------------------
   STABLE HEART-MONITOR PULSE (60 BPM)
------------------------------------------- */
@keyframes flicker {
    /* LUB: First sharp surge */
    0% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
        opacity: 0.8;
    }
    4% {
        text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
        opacity: 1;
    }
    8% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
        opacity: 0.8;
    }

    /* DUB: Second, slightly smaller surge */
    14% {
        text-shadow: 0 0 15px var(--primary-color), 0 0 20px var(--primary-color);
        opacity: 1;
    }
    18% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
        opacity: 0.8;
    }

    /* RESTING: Long, stable plateau */
    100% {
        text-shadow: 0 0 5px var(--primary-color);
        opacity: 0.7;
    }
}

.flicker-text {
    /* 2s = 60 BPM (Resting Heart Rate). 
       Cubic-bezier creates a smooth "muscle" contraction feel. */
    animation: flicker 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    display: inline-block;
}

h1, h2, h3 {
    color: var(--primary-color);
    text-transform: uppercase;
    border-bottom: 1px dashed var(--secondary-color);
    text-shadow:
        0 0 8px var(--primary-color),
        0 0 15px rgba(0, 255, 65, 0.5); 
}
.retro-header h1, 
.retro-footer .footer-title {
    animation: flicker 3s linear infinite alternate;
}

p, ul, li, a {
    line-height: 1.6;
}

/* =========================================================
   EXTERN_LINK: OUTBOUND SIGNAL STYLING
========================================================= */

/* Use this class for generic links in text or footers */
.external-link, 
.post-content a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 2px 4px;
    border-bottom: 1px dashed var(--secondary-color);
    transition: all 0.1s ease-in-out;
    display: inline-block;
}

.external-link:hover, 
.post-content a:hover {
    background: var(--primary-color);
    color: var(--background-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Optional: Add a small "arrow" prefix to show it's an outbound link */
.external-link::before,
.post-content a::before {
    content: ">> ";
    font-size: 0.8em;
    opacity: 0.7;
}

/* =========================================================
   RETRO HEADER
========================================================= */
/* ... (Header styles remain unchanged) ... */
.retro-header,
.retro-header * {
    all: revert;
    box-sizing: border-box;
}
.retro-header {
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
    position: relative;
    z-index: 50;
    pointer-events: auto;
}
.retro-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed var(--secondary-color);
}
.retro-header h1 {
    margin: 0;
    padding: 0;
    font-size: 1.6em;
    line-height: 1;
    color: var(--primary-color);
    border: none;
    text-shadow: 0 0 5px var(--primary-color);
}
.retro-header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 0;
}
.retro-header nav a:not(.retro-button) {
    color: var(--primary-color);
    text-decoration: none;
    padding: 4px 8px;
    font-size: 1.05em;
}
.retro-header nav a:not(.retro-button):hover {
    background: var(--primary-color);
    color: var(--background-color);
}
/* Admin buttons in header */
.retro-header .retro-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 0.8em;
    line-height: 1;
    border: 1px dashed var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
}
/* Disconnect button override */
.retro-header .admin-disconnect-btn,
.admin-disconnect-btn { 
    background-color: darkred; 
    border-color: red;
    color: var(--primary-color); 
}

/* =========================================================
   RETRO FOOTER
========================================================= */
.retro-footer {
    width: 100%;
    margin-top: 30px; 
    padding: 10px 0 20px 0;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9em;
}
.retro-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 20px;
    border-top: 1px dashed var(--secondary-color);
}
.footer-title {
    margin: 5px 0;
    font-size: 1.1em;
    color: var(--primary-color);
}
.retro-footer .social-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}
.retro-footer .social-links a:hover {
    color: var(--primary-color);
}
.copyright-info {
    margin-top: 5px;
    font-size: 0.8em;
}

/* =========================================================
   BUTTONS & FORMS
========================================================= */
.retro-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer; /* Ensure buttons are clickable */
    box-shadow: 0 0 5px var(--primary-color);
    transition: all 0.1s;
}
.retro-button:hover {
    background: var(--primary-color);
    color: var(--background-color);
}

/* --- NEW RETRO INPUT STYLES --- */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.retro-input,
.retro-textarea,
.retro-select {
    width: 100%;
    padding: 8px 10px;
    
    /* Terminal Look */
    background-color: var(--background-color); 
    color: var(--primary-color);
    font-family: 'VT323', monospace;
    font-size: 1.1em;
    
    /* Retro Border */
    border: 1px dashed var(--secondary-color);
    box-shadow: none; /* Remove default shadow */
    box-sizing: border-box; 
}
.retro-input:focus,
.retro-textarea:focus,
.retro-select:focus {
    /* Focus state */
    outline: none;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}
.retro-textarea {
    resize: vertical; /* Allow resizing only vertically */
}

/* =========================================================
   BUTTON ALIGNMENT FIX
========================================================= */
.action-buttons {
    display: flex;
    gap: 15px;           /* Precise spacing between buttons */
    align-items: center; /* Vertically centers them */
    flex-wrap: wrap;     /* Allows them to stack on mobile */
    margin-top: 30px;
}

.action-buttons .retro-button {
    flex: 0 1 auto;      /* Prevents buttons from stretching weirdly */
    height: 100%;        /* Forces equal height if one has more text */
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
/* =========================================================
   NEWS & ARCHIVE ELEMENTS
========================================================= */
.secondary-text {
    color: var(--secondary-color);
    font-size: 0.8em;
}
.news-item-preview {
    border-left: 3px solid var(--secondary-color);
    padding-left: 15px;
    margin-bottom: 25px;
}
.full-archive-item {
    border-left: 3px solid var(--secondary-color);
    padding-left: 15px;
    margin-bottom: 30px;
    padding-bottom: 10px;
}
.full-archive-item .post-date {
    border-bottom: 1px dotted var(--secondary-color);
    padding-bottom: 5px;
    margin-bottom: 5px;
    display: block; 
}
.empty-feed-message {
    color: var(--secondary-color);
}
.archive-header-controls {
    margin-bottom: 20px;
}
.news-feed-footer {
    text-align: right;
    margin-top: 20px;
}

/* =========================================================
   MUSIC PAGE GALLERY
========================================================= */
.album-gallery {
    display: grid;
    /* Force exactly 3 columns, distributing space evenly */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; 
    justify-content: space-between; 
    justify-items: center; 
    padding: 20px 0;
}
.album-card {
    display: block; 
    text-align: center;
    text-decoration: none;
    color: var(--primary-color); 
    transition: all 0.2s ease-out;
    max-width: 250px; 
    width: 100%;
}
.album-card:hover {
    color: var(--primary-color);
    opacity: 0.8;
}
.album-cover-gallery {
    width: 100%;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    line-height: 0; 
    padding: 1px; 
    margin-left: auto;
    margin-right: auto;
}
.album-card img {
    display: block;
    width: 100%; 
    height: auto;
    transition: transform 0.3s ease-in-out;
}
.album-card:hover img {
    transform: scale(1.05);
}
.retro-frame {
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
    box-sizing: border-box;
}
.album-type {
    margin: 2px 0 0 0;
    font-size: 0.9em;
    color: var(--secondary-color);
}
@media (max-width: 850px) {
    .album-gallery {
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
    }
}
@media (max-width: 600px) {
    .album-gallery {
        grid-template-columns: 1fr;
    }
}

/* Ensure the album links don't break the gallery styling */
.album-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.album-card-link:hover {
    transform: scale(1.02);
    filter: brightness(1.2);
}
/* =========================================================
   ALBUM DETAIL PAGE
========================================================= */
.album-detail-view {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 20px 0;
}
.album-detail-view .album-cover {
    flex-shrink: 0;
    width: 250px; 
}
.album-detail-view .album-cover img {
    width: 100%;
    height: auto;
}
.release-type-badge {
    color: var(--secondary-color);
    font-size: 0.8em;
    text-transform: uppercase;
    padding-left: 5px;
}

/* =========================================================
   ALBUM DETAIL: INFO BLOCK (WIKI/LORE)
========================================================= */
.info-content {
    /* The New Line Fix */
    white-space: pre-wrap; 
    word-wrap: break-word; 

    /* The Box Styling */
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 65, 0.02); /* Very subtle green tint */
    
    /* Hardware-style "Inset" Border */
    border-top: 1px solid var(--secondary-color);
    border-left: 1px solid var(--secondary-color);
    border-right: 1px solid var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
    
    /* Terminal Typography */
    font-family: 'VT323', monospace;
    font-size: 1em;
    color: var(--primary-color);
    line-height: 1.5;
    
    /* CRT Scanline Effect for this box specifically */
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
}

.info-header {
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================================
   ADMIN PANEL STYLES (Final Migration)
========================================================= */

/* General Layout & Containers */
.admin-header-controls {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px dotted var(--secondary-color); 
    margin-bottom: 15px;
}
.admin-welcome-message {
    margin-bottom: 30px;
}
.admin-task-container {
    padding: 30px; 
    text-align: center;
}
.task-mode-grid {
    display: flex; 
    justify-content: space-around; 
    gap: 20px; 
    margin-top: 30px;
}
/* Task Mode Link (Styles were merged into this class) */
.task-mode-link {
    font-size: 1.2em; 
    padding: 15px 30px; 
    flex-grow: 1;
    border-color: var(--primary-color);
}
.admin-list-container,
.admin-form-wrapper {
    padding: 20px;
}

/* Forms and Messages */
.error-box {
    padding: 10px; 
    margin-bottom: 20px; 
    border: 1px dashed red; 
    background-color: rgba(255, 0, 0, 0.1);
    color: var(--primary-color);
}
.admin-login-form {
    padding: 20px; 
    max-width: 400px; 
    margin: 30px auto;
}
.admin-submit-button {
    margin-top: 15px;
}
.admin-save-controls {
    margin-top: 20px; 
    text-align: right;
}
.success-box {
    padding: 10px; 
    margin-bottom: 20px; 
    background-color: var(--secondary-color); 
    color: var(--background-color);
}
.admin-no-data {
    text-align: center; 
    padding: 10px; 
    color: red;
}
.admin-login-footer-text {
    text-align: center; 
    font-size: 0.8em; 
    color: var(--secondary-color); 
    margin-top: 30px;
}

/* Tables (Discography Admin) */
.admin-table-row {
    border-bottom: 1px dotted var(--secondary-color);
}
.admin-table-row td {
    padding: 8px;
}
.admin-table-id {
    color: var(--secondary-color);
}
.admin-table-title {
    font-weight: bold;
}
.admin-table-actions {
    text-align: right;
}
.admin-edit-btn {
    font-size: 0.8em; 
    padding: 3px 8px;
}
.admin-delete-btn {
    font-size: 0.8em; 
    padding: 3px 8px; 
    background-color: darkred; 
    border-color: red;
}

/* News Admin List */
.admin-list-reset {
    list-style-type: none; 
    padding-left: 0;
}
.admin-list-item {
    margin-bottom: 15px; 
    border-bottom: 1px dotted var(--secondary-color); 
    padding-bottom: 5px;
}
.admin-list-bold {
    font-weight: bold;
}
.admin-list-title {
    color: var(--primary-color);
}
.admin-list-content {
    margin-top: 5px; 
    font-size: 0.9em; 
    padding-left: 10px; 
    border-left: 1px solid var(--secondary-color);
}

/* =========================================================
   RETRO HARDWARE AUDIO PLAYER (XP STYLE + YOUR THEME)
========================================================= */
.news-audio-container {
    margin: 15px 0;
    padding: 10px;
    background: #000; /* Solid black background */
    /* Outset Border: Light top/left, Dark bottom/right creates 3D effect */
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    border-right: 2px solid var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
    box-shadow: 2px 2px 0px #000;
}

.audio-status-text {
    display: block;
    font-size: 0.7em;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    /* Inset "LCD" look for the title */
    background: rgba(0, 255, 65, 0.05);
    padding: 2px 8px;
    border: 1px inset var(--secondary-color);
    width: fit-content;
}

/* Customizing the Player appearance */
.news-audio-container audio {
    width: 100%;
    height: 30px;
    /* This filter makes the standard player look like a green terminal interface */
    filter: invert(1) hue-rotate(90deg) brightness(1.5) contrast(1.2);
    border-radius: 0; /* Square edges for the older look */
    outline: none;
}

/* Optional: Small "Screws" in the corners for the hardware feel */
.news-audio-container {
    position: relative;
}

.news-audio-container::before {
    content: "::";
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 10px;
    color: var(--secondary-color);
}

/* =========================================================
   CUSTOM RETRO AUDIO CONTROLS (XP / CRT STYLE)
========================================================= */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #000;
    padding: 5px;
    border: 1px inset var(--secondary-color);
}

.audio-btn {
    background: var(--background-color);
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    border-right: 2px solid var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
    color: var(--primary-color);
    font-family: 'VT323', monospace;
    cursor: pointer;
    padding: 2px 10px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.audio-btn:active {
    border-top: 2px solid var(--secondary-color);
    border-left: 2px solid var(--secondary-color);
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: translate(1px, 1px);
}

.audio-progress-container {
    flex-grow: 1;
    height: 12px;
    background: #001a00;
    border: 1px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.audio-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* =========================================================
   MECHANICAL BANDCAMP RACK-MOUNT WRAPPER
========================================================= */
.bandcamp-embed-container {
    margin: 20px 0;
    padding: 8px;
    /* Ensure the container itself is transparent */
    background: transparent !important;
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    border-right: 2px solid var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
    box-shadow: 3px 3px 0px #000;
}

.bandcamp-player {
    
    /* Since the player content might be dark, we add a filter to 
       make the green buttons pop against your dark background */
    filter: brightness(1.5) contrast(1.2);
    display: block;
}

/* Optional: Hardware label for the album player */
.bandcamp-embed-container::before {
    content: "ALBUM_STREAM_LINK: ACTIVE";
    display: block;
    font-size: 0.65em;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}