/* filepath: public/css/style.css */

/* ==========================================================================
   CSS VARIABLES & GLOBAL RESETS
   ========================================================================== */
:root {
    --bg-color: #0b110d; /* Deep matte British Racing Green */
    --panel-bg: #141c16; /* Sleek charcoal-green for panels */
    --panel-border: #243026;
    --text-main: #eae6df; /* Soft parchment text */
    --text-muted: #8b968f;
    
    /* Aston Martin Cognac Leather Theme */
    --gold: #c28851; /* Rich cognac tan */
    --gold-dim: #996639;
    --black: #0b110d;
    
    --terminal-green: #00ff00;
    --alert-red: #ff3333;
    
    /* Sleek modern system font */
    --font-mono: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font-mono);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Gold Scrollbars */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--gold);
    border: 1px solid var(--black);
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   CRT SCANLINE OVERLAY
   ========================================================================== */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
}

.layout-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   BUTTONS (GOLD / BLACK AESTHETIC)
   ========================================================================== */
.arcade-btn {
    display: inline-block;
    background-color: var(--black);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.arcade-btn:hover {
    background-color: var(--gold);
    color: var(--black);
}

.btn-primary {
    background-color: var(--gold);
    color: var(--black);
}

.btn-primary:hover {
    background-color: var(--gold-dim);
    border-color: var(--gold-dim);
}

.admin-edit-btn {
    background: transparent;
    color: var(--gold);
    border: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}
.admin-edit-btn:hover {
    color: var(--text-main);
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-main);
}

.brand-prompt {
    color: var(--gold);
}

.brand-badge {
    background: var(--gold);
    color: var(--black);
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-left: 5px;
}

.admin-status-badge {
    border: 1px dashed var(--terminal-green);
    color: var(--terminal-green);
    font-size: 0.75rem;
    padding: 4px 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-links-header {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font-mono);
}

.nav-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.menu-container {
    position: relative;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    min-width: 180px;
    z-index: 100;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.menu-dropdown.active {
    display: flex;
    flex-direction: column;
}

.menu-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 12px 15px;
    text-align: left;
    font-family: var(--font-mono);
    cursor: pointer;
    text-decoration: none;
}
.menu-item:last-child {
    border-bottom: none;
}
.menu-item:hover {
    background: #1a1a1a;
    color: var(--gold);
    padding-left: 20px;
    transition: padding 0.2s;
}

/* ==========================================================================
   COMMAND DECK (TOP BLURBS)
   ========================================================================== */
.command-deck {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 20px;
    margin-bottom: 30px;
}

.deck-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.deck-bio {
    border-left: 4px solid var(--gold);
}

.deck-spotlight {
    border: 1px dashed var(--panel-border);
}

.card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--terminal-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

.block-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.hero-headline {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 15px;
    font-weight: normal;
}

.block-text {
    color: var(--text-main);
    font-size: 1.05rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    font-weight: 300;
    line-height: 1.6;
}

.spotlight-tag {
    background: var(--text-main);
    color: var(--black);
    font-size: 0.7rem;
    padding: 2px 6px;
    font-weight: bold;
}

.spotlight-title {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.spotlight-footer {
    margin-top: 20px;
}

/* ==========================================================================
   OBSESSIONS STRIP
   ========================================================================== */
.obsessions-strip {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.obsession-pill {
    flex: 1;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    color: var(--text-main);
}

.obsession-icon {
    font-size: 1.8rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.obsession-body {
    flex: 1;
}

.obsession-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.obsession-label {
    font-size: 0.8rem;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: bold;
}

.obsession-text {
    font-size: 0.9rem;
    color: var(--text-main);
}

/* ==========================================================================
   MAIN WORKSPACE GRID (ARCADE & LOGS)
   ========================================================================== */
.arcade-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid var(--panel-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-header-spaced {
    margin-top: 50px;
}

.section-header h2 {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: normal;
}

.section-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ==========================================================================
   CABINETS & SYSTEMS
   ========================================================================== */
.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cabinet-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

.cabinet-screen {
    height: 140px;
    background: #050505;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

.screen-crt { color: var(--terminal-green); }
.screen-word { color: #00e5ff; }
.screen-typing { color: var(--gold); }

.cabinet-genre {
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
}

.cabinet-code {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.6rem;
    opacity: 0.5;
}

.cabinet-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cabinet-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.cabinet-info p {
    font-size: 0.85rem;
    color: #999;
    flex: 1;
    margin-bottom: 15px;
}

.cabinet-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cabinet-meta span {
    background: #222;
    border: 1px solid #444;
    font-size: 0.7rem;
    padding: 2px 6px;
    color: #ccc;
}

.cabinet-actions .arcade-btn {
    width: 100%;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.system-card {
    display: block;
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}

.system-card:hover {
    border-color: var(--gold);
}

.system-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.system-top h3 {
    font-size: 1.1rem;
    color: var(--text-main);
}

.system-badge {
    background: #222;
    color: var(--gold);
    font-size: 0.65rem;
    padding: 2px 5px;
    border: 1px solid var(--gold);
}

.system-card p {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.system-link-text {
    font-size: 0.8rem;
    color: var(--gold);
}
.system-card:hover .system-link-text {
    text-decoration: underline;
}

/* ==========================================================================
   LAB NOTES (RIGHT COLUMN)
   ========================================================================== */
.lab-notes-zone {
    border-left: 1px solid var(--panel-border);
    padding-left: 40px;
}

.admin-inline-form {
    background: var(--panel-bg);
    border: 1px dashed var(--gold);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-inline-form input,
.admin-inline-form textarea {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 8px;
    font-family: var(--font-mono);
}

.admin-inline-form input:focus,
.admin-inline-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.experiments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.experiment-item {
    border-bottom: 1px dashed var(--panel-border);
    padding-bottom: 20px;
}
.experiment-item:last-child {
    border-bottom: none;
}

.exp-date {
    font-size: 0.75rem;
    color: var(--gold);
    margin-bottom: 5px;
    display: block;
}

.exp-title {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.exp-summary {
    font-size: 0.9rem;
    color: #aaa;
}

/* ==========================================================================
   MODALS (LOGIN, EDIT, TYPING GAME)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: var(--panel-bg);
    border: 1px solid var(--gold);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.modal-box-wide {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: var(--gold);
    font-size: 1.2rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close-btn:hover {
    color: var(--alert-red);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-form input,
.modal-form textarea {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 10px;
    font-family: var(--font-mono);
}

.modal-form input:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.modal-feedback {
    font-size: 0.85rem;
    min-height: 20px;
    color: var(--alert-red);
}

/* ==========================================================================
   TYPING ARCADE STYLES
   ========================================================================== */
.typing-arcade-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.typing-stats {
    display: flex;
    justify-content: space-between;
    background: #050505;
    border: 1px solid #333;
    padding: 10px 20px;
    color: var(--gold);
    font-size: 1.1rem;
}

.typing-prompt-display {
    background: var(--bg-color);
    border: 1px solid #444;
    padding: 20px;
    font-size: 1.2rem;
    color: var(--text-main);
    min-height: 80px;
    user-select: none;
}

.typing-prompt-display span {
    transition: color 0.1s;
}
.typing-prompt-display .correct { color: var(--terminal-green); }
.typing-prompt-display .incorrect { color: var(--alert-red); background: rgba(255,51,51,0.2); }
.typing-prompt-display .current { border-bottom: 2px solid var(--gold); }

.typing-input {
    background: var(--bg-color);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 15px;
    font-size: 1.2rem;
    font-family: var(--font-mono);
}
.typing-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* ==========================================================================
   RESPONSIVE LAYOUT
   ========================================================================== */
.mobile-only { display: none; }

@media (max-width: 900px) {
    .command-deck {
        grid-template-columns: 1fr;
    }
    
    .obsessions-strip {
        flex-direction: column;
    }

    .arcade-main-grid {
        grid-template-columns: 1fr;
    }

    .lab-notes-zone {
        border-left: none;
        border-top: 2px solid var(--panel-border);
        padding-left: 0;
        padding-top: 40px;
    }
}

@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    
    .hero-headline {
        font-size: 1.5rem;
    }
}
.app-launchpad {
    margin-top: 30px;
    margin-bottom: 50px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 140px);
    justify-content: center;
    gap: 20px;
}

.app-square {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.app-square:hover {
    border-color: var(--gold);
    background: #1b261e; /* Subtle highlight on hover */
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(194, 136, 81, 0.15); /* Soft cognac glow */
}

.app-icon-wrapper {
    width: 60px;
    height: 60px;
    background: #0b110d; /* Recessed background matching page */
    border: 1px solid var(--panel-border);
    border-radius: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.app-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-icon-fallback {
    font-size: 1.8rem;
}

.app-name {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.app-type {
    color: var(--gold);
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}