@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Rg.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-It.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Lt.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-LtIt.woff2') format('woff2');
    font-weight: 300;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Bk.woff2') format('woff2');
    font-weight: 350;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-BkIt.woff2') format('woff2');
    font-weight: 350;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Md.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-MdIt.woff2') format('woff2');
    font-weight: 500;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Smbd.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-SmbdIt.woff2') format('woff2');
    font-weight: 600;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Bd.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-BdIt.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Xbd.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-XbdIt.woff2') format('woff2');
    font-weight: 800;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Xlt.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-XltIt.woff2') format('woff2');
    font-weight: 200;
    font-style: italic;
}

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

body {
    font-family: 'ES Klarheit Kurrent', sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    zoom: 1.3;  /* Scale up 150% for better visibility */
}

header {
    background: #252526;
    padding: 10px 20px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    gap: 20px;
}

h1 {
    font-size: 18px;
    font-weight: 600;
    color: #cccccc;
}

/* =============================================================================
   C2 Header — Command and Control Centre
   ============================================================================= */

.c2-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 8px 20px;
}

.c2-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #cccccc;
    white-space: nowrap;
}

.c2-header-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
}

.c2-header-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.c2-header-label {
    font-size: 10px;
    font-weight: 600;
    color: #858585;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.c2-header-sublabel {
    font-size: 9px;
    color: #858585;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.c2-header-value {
    font-size: 13px;
    font-weight: 600;
    color: #d4d4d4;
}

.c2-defcon-badge {
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #4caf50;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.c2-defcon-badge.defcon-5 { background: #4caf50; }
.c2-defcon-badge.defcon-4 { background: #2196f3; }
.c2-defcon-badge.defcon-3 { background: #ff9800; }
.c2-defcon-badge.defcon-2 { background: #f44336; }
.c2-defcon-badge.defcon-1 { background: #d32f2f; }

#c2-defense-categories {
    display: flex;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.c2-defense-category {
    display: flex;
    align-items: center;
    gap: 6px;
}

.c2-defense-category-label {
    font-size: 10px;
    font-weight: 600;
    color: #858585;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.c2-defense-category-count {
    font-size: 12px;
    font-weight: 600;
    color: #d4d4d4;
}

.c2-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    white-space: nowrap;
}

.c2-status-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    color: #858585;
}

.c2-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.c2-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.c2-legend-dot.active { background: #4ec9b0; }
.c2-legend-dot.ready { background: #dcdcaa; }
.c2-legend-dot.offline { background: #f48771; }

/* Panel headers (Radar Detection Grid, Alert Center) */
.c2-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    flex-shrink: 0;
}

.c2-panel-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
}

.c2-panel-header-left svg {
    color: #569cd6;
}

.c2-panel-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #858585;
}

.c2-panel-stat {
    color: #858585;
}

.c2-panel-stat span {
    color: #d4d4d4;
    font-weight: 600;
}

.c2-panel-stat.critical span {
    color: #f48771;
}

.c2-panel-stat-sep {
    color: #3e3e42;
}

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

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #858585;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #4ec9b0;
}

.status-indicator.disconnected {
    background: #f48771;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.controls {
    background: #252526;
    padding: 10px 20px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    background: #0e639c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

button:hover {
    background: #1177bb;
}

button:active {
    background: #0d5a8f;
}

button.secondary {
    background: #3e3e42;
}

button.secondary:hover {
    background: #4e4e52;
}

/* Legacy stats (kept for compatibility but hidden via new panel header) */
.stats {
    display: none;
}

/* Two-column layout container */
.radar-monitor-container {
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
    background: #1e1e1e;
}

.radar-monitor-column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.radar-list-column {
    flex: 1;
    min-width: 400px;
    border-right: 1px solid #3e3e42;
}

.alert-column {
    flex: 2;
    min-width: 300px;
    position: relative;
    background: #1e1e1e;
}

/* Resize handle on left edge of alert column */
.alert-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: ew-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.2s;
}

.alert-resize-handle:hover,
.alert-resize-handle.dragging {
    background: rgba(78, 201, 176, 0.5);
}

.alert-resize-handle::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 40px;
    background: #4e4e52;
    border-radius: 1px;
    transition: background 0.2s;
}

.alert-resize-handle:hover::before,
.alert-resize-handle.dragging::before {
    background: #4ec9b0;
}

/* Responsive: Stack columns on narrow screens */
@media (max-width: 1200px) {
    .radar-monitor-container {
        flex-direction: column;
    }

    .alert-column {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 50vh;
    }

    .alert-resize-handle {
        display: none;
    }

    .radar-list-column {
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid #3e3e42;
    }
}

#radar-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    align-content: start;
}

#alert-center-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Override alert center styles for radar monitor two-column layout */
#alert-center-container #alert-center {
    border-radius: 0;
    border-left: none;
    border-top: none;
}

#alert-center-container .alert-header {
    border-radius: 0;
}

.radar-card {
    background: #252526;
    border-radius: 6px;
    border: 1px solid #3e3e42;
}

.radar-header {
    padding: 12px 15px;
    background: #2d2d30;
    border-bottom: 2px solid #4ec9b0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.radar-card.radar-RAD-ALPHA .radar-header { border-bottom-color: #4ec9b0; }
.radar-card.radar-RAD-BRAVO .radar-header { border-bottom-color: #c586c0; }
.radar-card.radar-RAD-CHARLIE .radar-header { border-bottom-color: #dcdcaa; }
.radar-card.radar-RAD-DELTA .radar-header { border-bottom-color: #ce9178; }
.radar-card.radar-RAD-ECHO .radar-header { border-bottom-color: #9cdcfe; }

.radar-title {
    color: #569cd6;
    font-weight: 600;
    font-size: 14px;
}

.radar-count {
    color: #858585;
    font-size: 12px;
}

.radar-count .count-value {
    color: #4ec9b0;
    font-weight: 600;
}

.entity-list {
    padding: 10px;
}

.entity-card {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    transition: border-color 0.3s;
}

.entity-card:last-child {
    margin-bottom: 0;
}

.entity-card.fresh {
    border-left: 3px solid #4ec9b0;
}

.entity-card.stale {
    border-left: 3px solid #dcdcaa;
    opacity: 0.7;
}

.entity-card.old {
    border-left: 3px solid #858585;
    opacity: 0.4;
}

.entity-card.selected {
    border-color: #786179;
    background: rgba(120, 97, 121, 0.1);
    box-shadow: 0 0 0 2px #786179;
    cursor: pointer;
}

.entity-card {
    cursor: pointer;
}

.entity-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

.entity-id {
    color: #ce9178;
    font-weight: 600;
    font-size: 13px;
}

.entity-time {
    color: #858585;
    font-size: 11px;
}

.entity-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 60px;
    font-size: 12px;
    position: relative;
}

.entity-data::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #3e3e42;
    transform: translateX(-50%);
}

.data-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.data-label {
    color: #858585;
    margin-right: auto;
}

.data-value {
    color: #b5cea8;
    font-weight: 500;
    white-space: nowrap;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: #858585;
    font-size: 12px;
}

/* Swarm sub-cards within radar cards */
.swarm-card {
    border-left-color: #569cd6 !important;
}

.swarm-details {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.swarm-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(86, 156, 214, 0.15);
    border-radius: 3px;
    font-size: 10px;
    color: #9cdcfe;
}

.swarm-tag.eta-tag {
    background: rgba(220, 220, 170, 0.15);
    color: #dcdcaa;
}

.swarm-entities {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.swarm-entity-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    padding: 1px 0;
    color: #858585;
}

.swarm-entity-id {
    color: #ce9178;
    font-weight: 500;
}

.swarm-entity-data {
    color: #b5cea8;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #3e3e42;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}
