/* Sector 4: ISB Headquarters - Brutalist Control Room */

/* ============================================
   CRT OVERLAY EFFECTS
   ============================================ */

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanlines-flicker 0.1s infinite;
}

@keyframes scanlines-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
}

/* ============================================
   ALERT BANNER
   ============================================ */

.alert-banner {
    background: #1a0000;
    border-bottom: 2px solid #ff0000;
    height: 28px;
    overflow: hidden;
    position: relative;
}

.alert-scroll {
    display: flex;
    gap: 80px;
    animation: scroll-left 30s linear infinite;
    white-space: nowrap;
    padding: 5px 0;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.alert-item {
    font-family: var(--font-pixel);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.alert-item.critical {
    color: #ff0000;
    animation: blink-critical 0.5s infinite;
}

.alert-item.warning {
    color: #ffaa00;
}

.alert-item.info {
    color: var(--primary-color);
}

@keyframes blink-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   STATUS BAR HEADER
   ============================================ */

.status-bar {
    background: #0a0a0a;
    border-bottom: 3px solid var(--primary-color);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-pixel);
    font-size: 14px;
}

.status-left,
.status-center,
.status-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.isb-logo {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-color);
}

.division {
    color: #666;
    letter-spacing: 2px;
}

.system-time {
    color: var(--primary-color);
    font-size: 20px;
    letter-spacing: 3px;
    text-shadow: 0 0 5px var(--primary-color);
}

.system-date {
    color: #444;
}

.node-id {
    color: #666;
}

.connection-status {
    padding: 2px 8px;
    border: 1px solid;
}

.connection-status.online {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(0, 255, 0, 0.1);
}

/* ============================================
   DASHBOARD GRID
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 15px;
    padding: 15px;
    min-height: calc(100vh - 130px);
}

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

/* ============================================
   BRUTALIST PANELS
   ============================================ */

.brutalist-panel {
    background: #0a0a0a;
    border: 3px solid var(--primary-color);
    position: relative;
    clip-path: polygon(
        0 0,
        calc(100% - 15px) 0,
        100% 15px,
        100% 100%,
        15px 100%,
        0 calc(100% - 15px)
    );
}

.brutalist-panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.brutalist-panel::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

/* ============================================
   PANEL TABS
   ============================================ */

.panel-tabs {
    display: flex;
    border-bottom: 2px solid var(--primary-color);
}

.tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #444;
    font-family: var(--font-pixel);
    font-size: 12px;
    padding: 10px 5px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
    border-right: 1px solid #222;
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    color: var(--primary-color);
    background: rgba(0, 255, 0, 0.05);
}

.tab.active {
    color: #000;
    background: var(--primary-color);
    font-weight: bold;
}

.panel-content {
    padding: 10px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   OPERATIONS LIST
   ============================================ */

.operation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #222;
    margin-bottom: 5px;
    font-family: var(--font-pixel);
    font-size: 12px;
    transition: all 0.2s;
}

.operation-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 255, 0, 0.05);
}

.operation-item.active {
    border-color: var(--primary-color);
    background: rgba(0, 255, 0, 0.1);
}

.operation-item.warning {
    border-color: #ffaa00;
}

.op-status {
    color: var(--primary-color);
    width: 15px;
    text-align: center;
}

.op-status.idle {
    color: #444;
}

.operation-item.warning .op-status {
    color: #ffaa00;
    animation: blink-critical 1s infinite;
}

.op-name {
    flex: 1;
    color: #aaa;
}

.op-code {
    color: #444;
    font-size: 10px;
}

/* ============================================
   TARGETS & ASSETS
   ============================================ */

.target-item,
.asset-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border: 1px solid #222;
    margin-bottom: 5px;
    font-family: var(--font-pixel);
    font-size: 11px;
}

.target-name,
.asset-name {
    color: #888;
}

.target-status,
.asset-type {
    color: var(--primary-color);
    font-size: 10px;
}

.target-status.critical {
    color: #ff0000;
    animation: blink-critical 1s infinite;
}

/* ============================================
   METERS
   ============================================ */

.meter-panel {
    padding: 15px;
}

.panel-header-simple {
    color: var(--primary-color);
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 2px;
    padding: 10px;
    border-bottom: 1px solid #333;
    margin: -15px -15px 15px -15px;
    background: rgba(0, 255, 0, 0.05);
}

.meter {
    margin-bottom: 15px;
}

.meter-label {
    display: block;
    font-family: var(--font-pixel);
    font-size: 10px;
    color: #666;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.meter-bar {
    height: 20px;
    background: #111;
    border: 2px solid #333;
    position: relative;
}

.meter-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.meter-fill.high {
    background: repeating-linear-gradient(
        90deg,
        #ff0000 0px,
        #ff0000 8px,
        #aa0000 8px,
        #aa0000 10px
    );
    animation: meter-pulse 1s infinite;
}

.meter-fill.medium {
    background: repeating-linear-gradient(
        90deg,
        #ffaa00 0px,
        #ffaa00 8px,
        #aa7700 8px,
        #aa7700 10px
    );
}

.meter-fill.low {
    background: repeating-linear-gradient(
        90deg,
        var(--primary-color) 0px,
        var(--primary-color) 8px,
        var(--accent-color) 8px,
        var(--accent-color) 10px
    );
}

@keyframes meter-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.meter-value {
    display: block;
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--primary-color);
    text-align: right;
    margin-top: 3px;
}

/* ============================================
   TERMINAL PANEL
   ============================================ */

.terminal-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--primary-color);
    color: #000;
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 2px;
}

.panel-title {
    font-weight: bold;
}

.panel-status {
    font-size: 10px;
}

.terminal-screen {
    flex: 1;
    background: #000;
    padding: 15px;
    font-family: var(--font-pixel);
    font-size: 14px;
    overflow-y: auto;
    min-height: 250px;
    border: 2px solid #222;
    margin: 10px;
}

.terminal-line {
    margin-bottom: 5px;
    line-height: 1.4;
}

.terminal-line.output {
    color: var(--primary-color);
}

.terminal-line.output.table {
    white-space: pre;
    font-size: 12px;
    color: #888;
}

.terminal-line.output.success {
    color: #00ff88;
}

.terminal-line.output.error {
    color: #ff0000;
}

.terminal-line.prompt {
    color: #888;
}

.prompt-symbol {
    color: var(--primary-color);
    margin-right: 8px;
}

.cursor {
    color: var(--primary-color);
    animation: cursor-blink 0.7s infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #111;
    border-top: 2px solid var(--primary-color);
}

.input-prompt {
    color: var(--primary-color);
    font-family: var(--font-pixel);
    font-size: 16px;
}

.terminal-input {
    flex: 1;
    background: #000;
    border: 2px solid #333;
    color: var(--primary-color);
    font-family: var(--font-pixel);
    font-size: 14px;
    padding: 8px 12px;
}

.terminal-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.terminal-input::placeholder {
    color: #333;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 2px;
    padding: 10px 20px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.btn-execute {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.btn-execute:hover {
    background: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.btn-secondary {
    background: transparent;
    border-color: #666;
    color: #666;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: transparent;
    border-color: #ff0000;
    color: #ff0000;
}

.btn-danger:hover {
    background: #ff0000;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* ============================================
   FORM PANEL
   ============================================ */

.form-panel {
    margin-top: auto;
}

.form-content {
    padding: 15px;
}

.form-row {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-family: var(--font-pixel);
    font-size: 10px;
    color: #666;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.form-input {
    width: 100%;
    background: #000;
    border: 2px solid #333;
    color: var(--primary-color);
    font-family: var(--font-pixel);
    font-size: 14px;
    padding: 10px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.form-input::placeholder {
    color: #333;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================
   STATUS GRID
   ============================================ */

.status-grid {
    padding: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #222;
    font-family: var(--font-pixel);
    font-size: 11px;
}

.status-item:last-child {
    border-bottom: none;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

.status-indicator.warning {
    background: #ffaa00;
    box-shadow: 0 0 8px #ffaa00;
}

.status-indicator.critical {
    background: #ff0000;
    box-shadow: 0 0 8px #ff0000;
    animation: blink-critical 1s infinite;
}

.status-label {
    flex: 1;
    color: #666;
}

.status-value {
    color: var(--primary-color);
}

/* ============================================
   LIVE FEED
   ============================================ */

.feed-display {
    height: 120px;
    background: #000;
    margin: 10px;
    border: 2px solid #333;
    position: relative;
    overflow: hidden;
}

.feed-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.15"/></svg>');
    animation: static-noise 0.2s steps(10) infinite;
}

@keyframes static-noise {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(5%, 5%); }
    30% { transform: translate(-5%, 5%); }
    40% { transform: translate(5%, -5%); }
    50% { transform: translate(-5%, 0); }
    60% { transform: translate(5%, 0); }
    70% { transform: translate(0, 5%); }
    80% { transform: translate(0, -5%); }
    90% { transform: translate(5%, 5%); }
}

.feed-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    padding: 8px;
    font-family: var(--font-pixel);
    font-size: 10px;
}

.feed-label {
    color: #666;
}

.feed-rec {
    color: #ff0000;
    animation: blink-critical 1s infinite;
}

/* ============================================
   DATA STREAM
   ============================================ */

.data-stream-display {
    padding: 10px;
    font-family: var(--font-pixel);
    font-size: 11px;
    background: #000;
    margin: 10px;
    border: 2px solid #333;
    max-height: 100px;
    overflow-y: auto;
}

.stream-line {
    color: #444;
    margin-bottom: 3px;
}

.stream-line.highlight {
    color: var(--primary-color);
    animation: blink-critical 1s infinite;
}

/* ============================================
   FOOTER BAR
   ============================================ */

.footer-bar {
    background: #0a0a0a;
    border-top: 3px solid var(--primary-color);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-pixel);
    font-size: 11px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    gap: 20px;
}

.footer-left .footer-item {
    color: var(--primary-color);
}

.footer-center .footer-item {
    color: #666;
}

.footer-right .footer-item {
    color: #444;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
    border: 1px solid #222;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border: 1px solid var(--primary-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .column-left,
    .column-right {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .column-left .brutalist-panel,
    .column-right .brutalist-panel {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .status-bar {
        flex-direction: column;
        gap: 10px;
    }

    .alert-banner {
        display: none;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Upload Zone Adapted */
.upload-zone {
    border: 2px dashed var(--muted-color);
    border-radius: 0; /* Brutalist */
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(0, 255, 0, 0.02);
    margin-bottom: 1.5rem;
    position: relative;
    font-family: var(--font-pixel);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(0, 255, 0, 0.05);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.upload-icon {
    font-size: 2rem;
    color: var(--muted-color);
    margin-bottom: 1rem;
    display: block;
}

.upload-text {
    color: var(--primary-color);
    letter-spacing: 1px;
}

input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
