/* =========================================
   PROJECT BLACK-TAPE: CORE ARCHITECTURE
   ========================================= */

:root {
    --bg-dark: #0b0c10;
    --bg-panel: #111318;
    --bg-surface: #1a1d24;
    --accent-toxic: #39ff14;
    --accent-blue: #6ea8ff;
    --accent-purple: #bc13fe;
    --accent-red: #ff4444;
    --text-primary: #e5e5e5;
    --text-dim: #949494;
    --border-dim: #2b2f36;
}

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

body,
html {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* App handles its own scrolling */
}

#appContainer {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* =========================================
   SIDEBAR: SLIM ICONIC NAVIGATION
   ========================================= */

#sidebar {
    flex: 0 0 70px;
    height: 100vh;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 100;
}

#brand-logo {
    margin-bottom: 40px;
    font-size: 2rem;
    filter: drop-shadow(0 0 5px var(--accent-toxic));
    cursor: default;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: center;
}

.nav-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    color: var(--accent-toxic);
    background: rgba(57, 255, 20, 0.05);
}

.nav-item.active {
    color: var(--accent-toxic);
    background: rgba(57, 255, 20, 0.1);
    box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.2);
    border: 1px solid rgba(57, 255, 20, 0.2);
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding-bottom: 20px;
}

#btn-purge {
    font-size: 1.4rem;
    color: var(--accent-red);
    opacity: 0.4;
    cursor: pointer;
    transition: 0.2s;
}

#btn-purge:hover {
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--accent-red));
}

/* =========================================
   MAIN VIEWPORT & HEADERS
   ========================================= */

#mainView {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 30px;
    background: var(--bg-dark);
}

#viewHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-dim);
}

#currentViewTitle {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--accent-blue);
}

/* =========================================
   DASHBOARD COMPONENTS
   ========================================= */

.view {
    display: none;
}

.activeView {
    display: block !important;
}

h2 {
    color: var(--accent-blue);
    font-size: 1rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.corrosion-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 20px;
    margin-bottom: 20px;
}

#statsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-item label {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.stat-item span {
    font-size: 24px;
    font-weight: 900;
}

/* =========================================
   CHAT MODULE: MASTER-DETAIL VIEW
   ========================================= */

.chat-layout {
    display: flex;
    height: 70vh;
    border: 1px solid var(--border-dim);
}

.contact-sidebar {
    flex: 0 0 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-dim);
}

.contact-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.contact-item.active {
    background: var(--bg-surface) !important;
    border-left: 4px solid var(--accent-toxic);
}

.message-pane {
    flex: 1;
    background: #000;
    display: flex;
    flex-direction: column;
}

/* Message Bubbles */
.msg-bubble {
    margin-bottom: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
    max-width: 80%;
}

/* =========================================
   INGESTION STREAM (TERMINAL STYLE)
   ========================================= */

.terminal-box {
    background: #000;
    border: 1px solid var(--border-dim);
    padding: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    height: 250px;
    overflow-y: auto;
}

.feed-entry {
    border-left: 2px solid var(--accent-toxic);
    padding-left: 10px;
    margin-bottom: 5px;
    color: var(--text-dim);
}

/* =========================================
   SCROLLBARS & UTILS
   ========================================= */

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dim);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}
