/* ============================================================
   GEOINT Dashboard v5.0 — Feature Styles
   Conflicts, Climate, Maritime, API Health, SSE, Export, Briefings
   ============================================================ */

/* ---- Conflict Events ---- */
.conflict-card {
    background: var(--card-bg, #1a1f2e);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent, #3b82f6);
    transition: transform 0.2s ease;
}
.conflict-card:hover { transform: translateX(4px); }
.conflict-card.severity-critical { border-left-color: #ef4444; }
.conflict-card.severity-high { border-left-color: #f97316; }
.conflict-card.severity-medium { border-left-color: #eab308; }
.conflict-card.severity-low { border-left-color: #22c55e; }

.conflict-actors {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    margin-bottom: 8px;
}
.conflict-actors .vs {
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.conflict-type-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(59,130,246,0.15);
    color: var(--accent, #3b82f6);
    font-weight: 600;
    text-transform: uppercase;
}
.goldstein-bar {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #ef4444, #eab308, #22c55e);
    position: relative;
    margin-top: 6px;
}
.goldstein-marker {
    position: absolute;
    top: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent);
    transform: translateX(-50%);
}

/* ---- Climate Security ---- */
.climate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.climate-card {
    background: var(--card-bg, #1a1f2e);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    overflow: hidden;
}
.climate-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.climate-card.heat::before { background: linear-gradient(90deg, #f97316, #ef4444); }
.climate-card.cold::before { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.climate-card.flood::before { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.climate-card.drought::before { background: linear-gradient(90deg, #eab308, #f97316); }
.climate-card.storm::before { background: linear-gradient(90deg, #6b7280, #374151); }

.temp-display {
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
}
.temp-display.extreme-hot { color: #ef4444; }
.temp-display.hot { color: #f97316; }
.temp-display.warm { color: #eab308; }
.temp-display.mild { color: #22c55e; }
.temp-display.cold { color: #06b6d4; }
.temp-display.extreme-cold { color: #3b82f6; }

.climate-severity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}
.climate-severity.critical { background: rgba(239,68,68,0.2); color: #ef4444; }
.climate-severity.high { background: rgba(249,115,22,0.2); color: #f97316; }
.climate-severity.medium { background: rgba(234,179,8,0.2); color: #eab308; }
.climate-severity.low { background: rgba(34,197,94,0.2); color: #22c55e; }

/* ---- Maritime Intelligence ---- */
.maritime-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.maritime-incident {
    background: var(--card-bg, #1a1f2e);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}
.maritime-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    background: rgba(59,130,246,0.15);
}
.maritime-icon.piracy { background: rgba(239,68,68,0.15); }
.maritime-icon.seizure { background: rgba(249,115,22,0.15); }
.maritime-icon.disruption { background: rgba(234,179,8,0.15); }
.maritime-icon.naval { background: rgba(59,130,246,0.15); }

.chokepoint-status {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.chokepoint-card {
    background: var(--card-bg, #1a1f2e);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.chokepoint-card .status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.chokepoint-card .status-dot.normal { background: #22c55e; }
.chokepoint-card .status-dot.elevated { background: #eab308; }
.chokepoint-card .status-dot.high { background: #f97316; }
.chokepoint-card .status-dot.critical { background: #ef4444; animation: pulse-dot 1.5s infinite; }

/* ---- API Health Monitor ---- */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.health-card {
    background: var(--card-bg, #1a1f2e);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    position: relative;
}
.health-card .api-name {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 8px;
}
.health-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}
.health-indicator.healthy {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
    animation: pulse-health 2s infinite;
}
.health-indicator.degraded {
    background: #eab308;
    box-shadow: 0 0 8px rgba(234,179,8,0.5);
}
.health-indicator.unhealthy {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239,68,68,0.5);
    animation: pulse-health 1s infinite;
}
.health-indicator.unknown {
    background: #6b7280;
}

.response-time {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}
.response-time .unit {
    font-size: 0.4em;
    font-weight: 400;
    color: var(--text-secondary, #94a3b8);
}
.uptime-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.uptime-bar .fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.uptime-bar .fill.good { background: #22c55e; }
.uptime-bar .fill.ok { background: #eab308; }
.uptime-bar .fill.bad { background: #ef4444; }

@keyframes pulse-health {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

/* ---- SSE Connection Status ---- */
.sse-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
.sse-indicator.disconnected {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}
.sse-indicator.connecting {
    background: rgba(234,179,8,0.15);
    color: #eab308;
}
.sse-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-health 2s infinite;
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}
.toast {
    background: var(--card-bg, #1e293b);
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 4px solid var(--accent, #3b82f6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: toast-in 0.3s ease forwards;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.toast.toast-out { animation: toast-out 0.3s ease forwards; }
.toast.critical { border-left-color: #ef4444; }
.toast.high { border-left-color: #f97316; }
.toast.medium { border-left-color: #eab308; }
.toast.low { border-left-color: #22c55e; }
.toast .toast-close {
    cursor: pointer;
    opacity: 0.5;
    font-size: 1.1em;
    margin-left: auto;
}
.toast .toast-close:hover { opacity: 1; }
.toast .toast-title {
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 2px;
}
.toast .toast-body {
    font-size: 0.8em;
    color: var(--text-secondary, #94a3b8);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ---- Daily Briefing ---- */
.briefing-panel {
    background: var(--card-bg, #1a1f2e);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(59,130,246,0.2);
}
.briefing-panel .briefing-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent, #3b82f6);
}
.briefing-panel .briefing-summary {
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 12px;
}
.briefing-developments {
    list-style: none;
    padding: 0;
}
.briefing-developments li {
    padding: 6px 0;
    padding-left: 16px;
    position: relative;
    font-size: 0.85em;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.briefing-developments li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent, #3b82f6);
}

/* ---- Export UI ---- */
.export-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.export-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--card-bg, #1a1f2e);
    color: var(--text-primary, #e2e8f0);
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}
.export-btn:hover {
    background: var(--accent, #3b82f6);
    border-color: var(--accent, #3b82f6);
    color: #fff;
}

/* ---- Correlation Badges ---- */
.correlation-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    background: rgba(139,92,246,0.15);
    color: #8b5cf6;
}
.correlation-confidence {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 700;
}
.correlation-confidence.high { background: rgba(34,197,94,0.2); color: #22c55e; }
.correlation-confidence.medium { background: rgba(234,179,8,0.2); color: #eab308; }
.correlation-confidence.low { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .climate-grid { grid-template-columns: 1fr; }
    .health-grid { grid-template-columns: repeat(2, 1fr); }
    .chokepoint-status { grid-template-columns: repeat(2, 1fr); }
    .toast-container { left: 10px; right: 10px; max-width: 100%; }
}
