/* ============================================================================
   diplomatic.bar - Operations Console Stylesheet
   Navy-metallic dashboard, chamfered panels, network-node hero, scale-hover
   ============================================================================ */

:root {
    /* Palette - exact values from DESIGN.md */
    --c-base:        #0B1622;  /* Deep Navy Base */
    --c-panel:       #1B2838;  /* Panel Surface */
    --c-border:      #3A4A5E;  /* Border Accent */
    --c-gold:        #D4AF37;  /* Diplomatic Gold */
    --c-blue:        #7EB8DA;  /* Ice Blue */
    --c-text:        #E8E4DD;  /* Warm White */
    --c-amber:       #E8943A;  /* Alert Amber */
    --c-sage:        #5A7A6B;  /* Muted Sage */
    --c-text-dim:    #8A95A4;
    --c-white:       #FFFFFF;

    /* Type */
    --f-display: 'Space Grotesk', sans-serif;
    --f-body:    'Inter', sans-serif;
    --f-mono:    'IBM Plex Mono', monospace;

    /* Easing */
    --ease-panel: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html, body {
    width: 100%;
    height: 100%;
    background: var(--c-base);
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.4;
    overflow: hidden;
    font-feature-settings: 'tnum';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-image:
        radial-gradient(circle, var(--c-border) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: 0 0;
}

.mono {
    font-family: var(--f-mono);
    color: var(--c-blue);
    font-size: 12px;
    letter-spacing: 0.02em;
}

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

.dashboard {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 55vh 1fr 48px;
    gap: 1px;
    padding: 16px;
    background: var(--c-base);
}

/* ============================================================================
   PANEL BASE STYLE
   ============================================================================ */

.panel {
    position: relative;
    background: var(--c-panel);
    border: 1px solid var(--c-border);
    /* Chamfered corners - top-left and bottom-right cut at 8px */
    clip-path: polygon(
        8px 0,
        100% 0,
        100% calc(100% - 8px),
        calc(100% - 8px) 100%,
        0 100%,
        0 8px
    );
    transition:
        transform 400ms var(--ease-panel),
        border-color 300ms ease,
        box-shadow 400ms ease;
    cursor: pointer;
    overflow: hidden;
    background-image:
        radial-gradient(circle, rgba(58, 74, 94, 0.5) 1px, transparent 1px);
    background-size: 24px 24px;
    background-color: var(--c-panel);
}

.panel:hover {
    transform: scale(1.02);
    border-color: var(--c-gold);
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.15);
    z-index: 5;
}

.panel:hover .header-accent {
    background: var(--c-gold);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
}

/* Panel header bar */
.panel-header-bar {
    height: 28px;
    background: var(--c-base);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    position: relative;
}

.header-accent {
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--c-gold);
    flex-shrink: 0;
    transition: background 300ms ease, box-shadow 300ms ease;
}

.panel-category {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(0.62rem, 1vw, 0.72rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c-text);
    flex-grow: 1;
}

.panel-meta {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--c-blue);
    letter-spacing: 0.05em;
}

.panel-body {
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 28px);
    gap: 10px;
}

/* ============================================================================
   HERO PANEL
   ============================================================================ */

.hero-panel {
    grid-column: 1 / 9;
    grid-row: 1;
    position: relative;
    overflow: hidden;
}

.network-diagram {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100%;
    height: calc(100% - 28px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.65;
}

.network-diagram .net-edge {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 1;
    stroke-dasharray: 6 12;
    transition: stroke 300ms ease;
}

.network-diagram .net-edge.active {
    stroke: var(--c-blue);
}

.network-diagram .net-node {
    fill: var(--c-blue);
    stroke: transparent;
    stroke-width: 0;
    transition: stroke 300ms ease, stroke-width 300ms ease, fill 300ms ease;
    pointer-events: auto;
    cursor: crosshair;
}

.network-diagram .net-node:hover,
.network-diagram .net-node.active {
    stroke: var(--c-gold);
    stroke-width: 2;
    fill: var(--c-gold);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: calc(100% - 28px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 32px;
    gap: 16px;
    pointer-events: none;
}

.hero-emblem {
    pointer-events: auto;
    animation: emblemFloat 8s ease-in-out infinite;
}

.hero-emblem svg {
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.35));
}

@keyframes emblemFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

.hero-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--c-text);
    text-shadow: 0 2px 24px rgba(11, 22, 34, 0.8);
}

.hero-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--c-gold);
    margin-right: 12px;
    transform: translateY(-12px);
}

.hero-subtitle {
    font-family: var(--f-body);
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-blue);
}

.hero-coords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--c-text-dim);
}

.coord-sep {
    color: var(--c-border);
    font-family: var(--f-mono);
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    grid-column: 9 / 13;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 8px;
    min-height: 0;
}

.sidebar-panel {
    overflow: hidden;
}

.sidebar-panel .panel-body {
    padding: 12px 14px;
}

/* Connection panel */
.connection-body {
    gap: 8px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-display);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: dotPulse 2s ease-in-out infinite;
}

.status-secure { background: var(--c-sage); box-shadow: 0 0 8px rgba(90, 122, 107, 0.6); }
.status-active { background: var(--c-blue); box-shadow: 0 0 8px rgba(126, 184, 218, 0.5); animation-delay: 0.3s; }
.status-amber  { background: var(--c-amber); box-shadow: 0 0 8px rgba(232, 148, 58, 0.6); animation-delay: 0.6s; }

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* Clocks panel */
.clocks-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.clock-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid transparent;
    transition: border-color 200ms ease, background 200ms ease;
}

.clock-item:hover {
    border-color: var(--c-border);
    background: rgba(11, 22, 34, 0.4);
}

.clock-dial {
    flex-shrink: 0;
}

.clock-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
}

.clock-label {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--c-text);
}

.clock-time {
    font-size: 11px;
    color: var(--c-blue);
    letter-spacing: 0.05em;
}

/* Ticker panel */
.ticker-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ticker-window {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 10px 14px;
    mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 88%, transparent 100%);
}

.ticker-track {
    display: flex;
    flex-direction: column;
    gap: 12px;
    will-change: transform;
    animation: tickerScroll 28s linear infinite;
}

.ticker-panel:hover .ticker-track {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.ticker-item {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    color: var(--c-text);
    padding-left: 10px;
    border-left: 2px solid var(--c-border);
    transition: border-color 200ms ease, color 200ms ease;
    flex-shrink: 0;
}

.ticker-item:hover {
    border-left-color: var(--c-gold);
    color: var(--c-gold);
}

.ticker-item .ticker-tag {
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--c-amber);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 2px;
}

/* ============================================================================
   INFO PANELS (bottom row)
   ============================================================================ */

.info-panel {
    grid-row: 2;
}

#panel-accords           { grid-column: 1 / 4; }
#panel-dispatches-info   { grid-column: 4 / 7; }
#panel-jurisdictions     { grid-column: 7 / 10; }
#panel-signatures        { grid-column: 10 / 13; }

.info-panel .panel-body {
    padding: 18px 20px;
    gap: 12px;
    justify-content: space-between;
}

.panel-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 300ms ease;
}

.info-panel:hover .panel-icon {
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.panel-title {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--c-text);
    line-height: 1.2;
}

.panel-text {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--c-text-dim);
    flex-grow: 1;
}

/* Bar indicator */
.bar-indicator {
    position: relative;
    height: 4px;
    background: var(--c-border);
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.bar-fill {
    display: block;
    height: 100%;
    width: var(--fill, 50%);
    background: var(--c-blue);
    transition: width 600ms var(--ease-panel);
}

.bar-fill-amber { background: var(--c-amber); }

.bar-label {
    position: absolute;
    right: 0;
    top: -16px;
    font-size: 10px;
    color: var(--c-text-dim);
}

/* Ring indicator */
.ring-indicator {
    position: relative;
    width: 60px;
    height: 60px;
    align-self: flex-start;
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--c-blue);
    letter-spacing: 0.05em;
}

/* Sparkline */
.sparkline {
    width: 100%;
    height: 30px;
    margin-top: 4px;
}

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

.status-bar {
    grid-column: 1 / 13;
    grid-row: 3;
    height: 48px;
    background: var(--c-panel);
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 24px;
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text);
    clip-path: polygon(
        8px 0,
        100% 0,
        100% calc(100% - 8px),
        calc(100% - 8px) 100%,
        0 100%,
        0 8px
    );
}

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

.status-bar-left  { flex: 1; }
.status-bar-center { flex: 1; justify-content: center; }
.status-bar-right { flex: 1; justify-content: flex-end; }

.brand {
    font-family: var(--f-mono);
    color: var(--c-gold);
    font-size: 13px;
    letter-spacing: 0.18em;
}

.brand-sep {
    color: var(--c-border);
}

.brand-meta {
    color: var(--c-text-dim);
    font-size: 11px;
}

.status-text {
    color: var(--c-text);
}

.signal-dots {
    display: inline-flex;
    gap: 4px;
}

.signal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-blue);
    animation: signalPulse 2s ease-in-out infinite;
}

.signal-dot:nth-child(1) { animation-delay: 0s; }
.signal-dot:nth-child(2) { animation-delay: 0.3s; }
.signal-dot:nth-child(3) { animation-delay: 0.6s; }
.signal-dot:nth-child(4) { animation-delay: 0.9s; }
.signal-dot:nth-child(5) { animation-delay: 1.2s; background: var(--c-gold); }

@keyframes signalPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.8); }
}

/* ============================================================================
   MODAL OVERLAY
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 22, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 500ms ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-panel {
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    background: var(--c-panel);
    border: 1px solid var(--c-gold);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 32px rgba(212, 175, 55, 0.2);
    clip-path: polygon(
        12px 0,
        100% 0,
        100% calc(100% - 12px),
        calc(100% - 12px) 100%,
        0 100%,
        0 12px
    );
    transform: scale(0.95);
    transition: transform 500ms var(--ease-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-image:
        radial-gradient(circle, rgba(58, 74, 94, 0.4) 1px, transparent 1px);
    background-size: 24px 24px;
    background-color: var(--c-panel);
}

.modal-overlay.open .modal-panel {
    transform: scale(1);
}

.modal-header {
    height: 40px;
    background: var(--c-base);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.modal-close {
    background: transparent;
    border: 1px solid var(--c-border);
    color: var(--c-text);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease;
}

.modal-close:hover {
    border-color: var(--c-gold);
    color: var(--c-gold);
}

.modal-body {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-content: start;
}

.modal-body > * {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.modal-overlay.open .modal-body > * {
    opacity: 1;
    transform: translateY(0);
}

.modal-overlay.open .modal-body > *:nth-child(1) { transition-delay: 200ms; }
.modal-overlay.open .modal-body > *:nth-child(2) { transition-delay: 320ms; }
.modal-overlay.open .modal-body > *:nth-child(3) { transition-delay: 440ms; }
.modal-overlay.open .modal-body > *:nth-child(4) { transition-delay: 560ms; }

.modal-section h2 {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    color: var(--c-gold);
    margin-bottom: 12px;
}

.modal-section p {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--c-text);
    margin-bottom: 12px;
}

.modal-data-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-data-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    background: rgba(11, 22, 34, 0.5);
    font-family: var(--f-mono);
    font-size: 12px;
}

.modal-data-list .data-key   { color: var(--c-text-dim); letter-spacing: 0.08em; }
.modal-data-list .data-value { color: var(--c-blue); }

/* ============================================================================
   RESPONSIVE - mobile/tablet
   ============================================================================ */

@media (max-width: 1024px) {
    html, body {
        overflow-y: auto;
        height: auto;
    }

    .dashboard {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
    }

    .hero-panel        { grid-column: 1; grid-row: auto; height: 60vh; min-height: 400px; }
    .sidebar           { grid-column: 1; grid-row: auto; grid-template-rows: auto; gap: 12px; }
    .info-panel        { grid-column: 1 !important; grid-row: auto; min-height: 220px; }
    .status-bar        { grid-column: 1; grid-row: auto; }

    .ticker-panel      { min-height: 200px; }

    .modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .modal-panel {
        width: 92vw;
        height: 88vh;
    }
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .ticker-track,
    .status-dot,
    .signal-dot,
    .hero-emblem {
        animation: none !important;
    }
}
