/* Import design system */
@import 'design-system.css';

/* ============================================================================
   TOP COMMAND BAR
   ============================================================================ */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.visitor-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--severity-low);
  animation: pulse 2s infinite;
}

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

.last-update {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-cyan);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ============================================================================
   MAIN LAYOUT
   ============================================================================ */

.app-container {
  display: flex;
  height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
  overflow: hidden;
}

/* ============================================================================
   LEFT CONTEXT PANEL
   ============================================================================ */

.left-panel {
  width: var(--left-panel-width);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.filter-section {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-filter-bar {
  display: none;
}

.filter-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.filter-chip {
  padding: var(--space-1) var(--space-2);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.filter-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

/* Country specific colors */
.filter-chip[data-country="uae"].active { border-color: #ff4444; }
.filter-chip[data-country="israel"].active { border-color: #4a9eff; }
.filter-chip[data-country="iran"].active { border-color: #44ff88; }
.filter-chip[data-country="saudi"].active { border-color: #ffcc00; }

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  height: 100%;
}

.section-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-4);
}

.tab-btn {
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.section-content {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  position: relative;
  height: 100%;
  -webkit-overflow-scrolling: touch;
}

/* All sections hidden by default; JS shows the active one */
.section {
  display: none;
}

.section[data-section="monitor"] {
  display: block;
}

#ragnarok-section {
  min-height: 600px;
  overflow-y: auto;
}

/* ============================================================================
   INCIDENT FEED
   ============================================================================ */

.incident-feed {
  height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-3);
}

.incident-feed::-webkit-scrollbar {
  width: 6px;
}

.incident-feed::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.incident-feed::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.incident-feed::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.incident-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  -ms-touch-action: pan-y;
}

.incident-card:hover,
.incident-card:active {
  background: var(--bg-hover);
  border-color: var(--border-active);
  transform: translateX(4px);
  color: inherit;
}

.incident-card.active {
  border-color: var(--accent-cyan);
  background: var(--bg-active);
}

.incident-card.new {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.incident-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.incident-flag {
  font-size: var(--text-base);
}

.incident-severity {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.incident-severity.critical { 
  background: var(--severity-critical);
  box-shadow: 0 0 8px var(--severity-critical);
}
.incident-severity.high { 
  background: var(--severity-high);
  box-shadow: 0 0 6px var(--severity-high);
}
.incident-severity.medium { 
  background: var(--severity-medium);
  box-shadow: 0 0 4px var(--severity-medium);
}
.incident-severity.low { 
  background: var(--severity-low);
}

.incident-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.incident-type {
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  min-width: 24px;
  text-align: center;
  display: inline-block;
  color: var(--accent-cyan);
}

.incident-type.type-missile { color: #ff4444; }
.incident-type.type-air_defense { color: #00d4ff; }
.incident-type.type-attack { color: #ff8800; }
.incident-type.type-security { color: #44ff88; }
.incident-type.type-alert { color: #ffcc00; }
.incident-type.type-drone { color: #ff6b9d; }
.incident-type.type-airstrike { color: #ff8800; }

.incident-confidence {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.incident-gov {
  font-size: var(--text-xs);
  color: var(--accent-cyan);
}

.incident-title {
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.incident-source {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Verification badges */
.verification-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

.verification-badge.verified {
  background: rgba(157, 78, 221, 0.2);
  color: #9d4edd;
}

.verification-badge.likely {
  background: rgba(74, 158, 255, 0.2);
  color: #4a9eff;
}

.verification-badge.partial {
  background: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
}

.verification-badge.unconfirmed {
  background: rgba(100, 116, 139, 0.2);
  color: #64748b;
}

/* Incident detail expansion */
.incident-detail {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: none;
}

.incident-card.expanded .incident-detail {
  display: block;
}

.incident-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.incident-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ============================================================================
   RIGHT INTELLIGENCE RAIL
   ============================================================================ */

.right-rail {
  width: var(--right-panel-width);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-module {
  border-bottom: 1px solid var(--border-subtle);
}

.rail-module.collapsed .rail-content {
  display: none;
}

.rail-header {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.rail-header:hover {
  background: var(--bg-hover);
}

.rail-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.rail-toggle {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.rail-module.collapsed .rail-toggle {
  transform: rotate(-90deg);
}

.rail-content {
  padding: 0 var(--space-4) var(--space-4);
}

/* Finance Panel */
.finance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.finance-name {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.finance-price {
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-mono);
}

.finance-change {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

.finance-change.positive {
  color: var(--severity-low);
}

.finance-change.negative {
  color: var(--severity-critical);
}

/* Casualty Counter */
.casualty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.casualty-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}

.casualty-number {
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.casualty-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Airspace Summary */
.airspace-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-xs);
}

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

.airspace-status.normal {
  background: var(--severity-low);
}

.airspace-status.restricted {
  background: var(--severity-medium);
}

.airspace-status.closed {
  background: var(--severity-critical);
}

/* Conflict Intensity */
.intensity-meter {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--space-2);
}

.intensity-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--severity-low), var(--severity-medium), var(--severity-critical));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ============================================================================
   MAP SECTION
   ============================================================================ */

.map-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
}

/* Leaflet Customizations */
.leaflet-container {
  background: var(--bg-primary) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.leaflet-popup-tip {
  background: var(--bg-tertiary);
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.layer-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--transition-fast);
}

.layer-toggle:hover {
  background: var(--bg-hover);
}

.layer-toggle.active {
  background: var(--bg-active);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.layer-toggle input[type="checkbox"] {
  accent-color: var(--accent-cyan);
}

/* ============================================================================
   ANALYSIS SECTION
   ============================================================================ */

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: var(--space-4);
  overflow-y: auto;
  height: 100%;
}

.analysis-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.analysis-card-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-4);
}

/* ============================================================================
   DATA SECTION
   ============================================================================ */

.data-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.data-tab {
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.data-tab:hover {
  background: var(--bg-hover);
}

.data-tab.active {
  background: var(--bg-active);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.data-content {
  padding: var(--space-4);
  overflow-y: auto;
  height: calc(100% - 50px);
}

.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-x: auto;
}

/* ============================================================================
   REPORTS SECTION
   ============================================================================ */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  padding: var(--space-4);
  height: 100%;
  overflow-y: auto;
}

.report-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ============================================================================
   MISSILE DEFENSE DASHBOARD
   ============================================================================ */

.missile-defense-container {
    padding: var(--space-4);
    height: 100%;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
}

.missile-defense-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
}

.country-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.country-selector label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.country-selector select {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    min-width: 280px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.country-selector select:focus {
    border-color: var(--accent-cyan);
}

.missile-defense-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Main Metrics Grid */
.missile-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.missile-metric-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.missile-metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-active);
}

.missile-metric-card.detected {
    border-top: 4px solid #ff8800;
}

.missile-metric-card.intercepted {
    border-top: 4px solid #44ff88;
}

.missile-metric-card.impacted {
    border-top: 4px solid #ffcc00;
}

.metric-icon {
    font-size: 32px;
    margin-bottom: var(--space-3);
}

.metric-value {
    font-size: 48px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.missile-metric-card.detected .metric-value {
    color: #ff8800;
}

.missile-metric-card.intercepted .metric-value {
    color: #44ff88;
}

.missile-metric-card.impacted .metric-value {
    color: #ffcc00;
}

.metric-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* Stats Breakdown Grid */
.missile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.missile-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.stat-icon {
    font-size: 20px;
}

.stat-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.stat-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.stat-value {
    font-size: var(--text-lg);
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-value.detected {
    color: #ff8800;
}

.stat-value.intercepted {
    color: #44ff88;
}

/* Success Rate Circle */
.success-rate-card {
    display: flex;
    flex-direction: column;
}

.success-rate-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.success-rate-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.success-rate-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 3;
}

.circle-progress {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.success-rate-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.success-rate-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-2);
    text-align: center;
}

/* Country Table */
.missile-country-table-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.table-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.table-icon {
    font-size: 20px;
}

.table-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.missile-country-table {
    width: 100%;
    border-collapse: collapse;
}

.missile-country-table th {
    text-align: left;
    padding: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.missile-country-table td {
    padding: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.missile-country-table tr:last-child td {
    border-bottom: none;
}

.missile-country-table tbody tr:hover {
    background: var(--bg-hover);
}

.value-detected {
    color: #ff8800;
    font-weight: 600;
    font-family: var(--font-mono);
}

.value-intercepted {
    color: #44ff88;
    font-weight: 600;
    font-family: var(--font-mono);
}

.value-impacted {
    color: #ffcc00;
    font-weight: 600;
    font-family: var(--font-mono);
}

.success-rate-high {
    color: #44ff88;
    font-weight: 600;
}

.success-rate-medium {
    color: #ffcc00;
    font-weight: 600;
}

.success-rate-low {
    color: #ff4444;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-6) !important;
}

/* Source Attribution */
.missile-source-attribution {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.source-icon {
    font-size: 24px;
}

.source-text {
    flex: 1;
}

.source-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-value {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-left: var(--space-2);
}

.last-updated {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

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

@media (max-width: 1200px) {
  .left-panel {
    width: 200px;
  }
  
  .right-rail {
    width: 240px;
  }
}

@media (max-width: 992px) {
  :root {
    --left-panel-width: 180px;
    --right-panel-width: 200px;
  }

  .analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .missile-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .missile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--header-height);
    padding-bottom: 60px;
  }

  .left-panel,
  .right-rail {
    display: none;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    z-index: 1000;
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
  }

  .mobile-nav-btn.active {
    color: var(--accent-cyan);
  }

  .main-content {
    overflow: visible;
  }

  .section-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 0;
  }

  .section-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4);
    font-size: 13px;
  }

  .section-content {
    overflow: visible;
    padding: 0;
    height: auto;
  }

  .section {
    height: auto;
    overflow: visible;
    display: none;
  }

  .section.active {
    display: block;
  }

  #monitor-section,
  #analysis-section,
  #data-section,
  #reports-section,
  #ragnarok-section {
    display: none;
    height: auto;
  }
  
  #argus-section {
    display: block;
    height: auto;
  }

  #monitor-section.active,
  #analysis-section.active,
  #data-section.active,
  #reports-section.active,
  #ragnarok-section.active,
  #argus-section.active {
    display: block;
  }

  .incident-feed {
    display: block;
    height: auto;
    overflow: visible;
    padding: var(--space-3);
    padding-bottom: var(--space-10);
  }

  /* Missile Defense Mobile Styles */
  .missile-defense-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .country-selector {
    width: 100%;
  }

  .country-selector select {
    min-width: 100%;
    flex: 1;
  }

  .missile-defense-title {
    font-size: var(--text-lg);
    width: 100%;
    text-align: center;
    margin-top: var(--space-3);
  }

  .missile-metrics-grid {
    grid-template-columns: 1fr;
  }

  .missile-stats-grid {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 36px;
  }

  .missile-country-table {
    font-size: var(--text-xs);
  }

  .missile-country-table th,
  .missile-country-table td {
    padding: var(--space-2);
  }

  .missile-source-attribution {
    flex-direction: column;
    text-align: center;
  }

  .source-text {
    text-align: center;
  }
}

/* Mobile nav hidden on desktop */
.mobile-nav {
  display: none;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-sm);
  max-width: 300px;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4);
}

.modal-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-cyan);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

.btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-cyan-hover, #00b8d4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ============================================================================
   TRANSLATION MODAL
   ============================================================================ */

.translate-source,
.translate-target {
  margin-bottom: var(--space-4);
}

.translate-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.translate-text {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-primary);
  min-height: 60px;
}

.translate-loading {
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================================
   INCIDENT ACTION BUTTONS
   ============================================================================ */

.incident-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.incident-action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.incident-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.incident-action-btn.report:hover {
  border-color: var(--severity-critical);
  color: var(--severity-critical);
}

.incident-action-btn.translate:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.incident-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Incident coordinates */
.incident-coords {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: var(--space-2);
}

/* Action buttons - used in JS */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.action-btn.report-btn:hover {
  border-color: var(--severity-critical);
  color: var(--severity-critical);
}

/* Verified badge fixes */
.verification-badge.verified {
  background: rgba(68, 255, 136, 0.2);
  color: #44ff88;
}

.verification-badge.likely {
  background: rgba(74, 158, 255, 0.2);
  color: #4a9eff;
}

.verification-badge.partial {
  background: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
}

.verification-badge.unconfirmed {
  background: rgba(100, 116, 139, 0.2);
  color: #64748b;
}

/* Make incident card clickable but allow action buttons to work */
.incident-card {
  position: relative;
}

.incident-card .incident-actions {
  position: relative;
  z-index: 2;
}

.incident-action-btn {
  position: relative;
  z-index: 3;
}

/* Aircraft, Satellite, Maritime Markers */
.aircraft-marker div {
  animation: pulse-cyan 2s infinite;
}

.satellite-marker div {
  animation: pulse-gold 3s infinite;
}

.vessel-marker div {
  animation: pulse-orange 2.5s infinite;
}

@keyframes pulse-cyan {
  0%, 100% { box-shadow: 0 0 10px #00d4ff; }
  50% { box-shadow: 0 0 20px #00d4ff, 0 0 30px #00d4ff; }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 12px #ffd700; }
  50% { box-shadow: 0 0 24px #ffd700, 0 0 36px #ffd700; }
}

@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 10px #ff6b35; }
  50% { box-shadow: 0 0 20px #ff6b35, 0 0 30px #ff6b35; }
}

/* ============================================================================
   ANALYSIS CHARTS
   ============================================================================ */

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Timeline Chart */
.chart-timeline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 160px;
  gap: 4px;
  padding: var(--space-2) 0;
}

.timeline-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.timeline-bar {
  width: 100%;
  min-width: 8px;
  background: linear-gradient(to top, var(--accent-blue), var(--accent-cyan));
  border-radius: 2px 2px 0 0;
  transition: opacity 0.2s;
}

.timeline-bar:hover {
  opacity: 0.8;
}

.timeline-label {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Heatmap Chart */
.chart-heatmap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.heatmap-country {
  width: 80px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.heatmap-bar-wrapper {
  flex: 1;
  height: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.heatmap-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.heatmap-count {
  width: 30px;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
}

/* Finance Chart */
.chart-finance {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.finance-metric {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.finance-metric-icon {
  font-size: var(--text-xl);
}

.finance-metric-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.finance-metric-name {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.finance-metric-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.finance-metric-change {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.finance-metric-change.positive {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.finance-metric-change.negative {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Casualty Chart */
.casualty-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.casualty-chart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.casualty-chart-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.casualty-chart-value.critical {
  color: var(--severity-critical);
}

.casualty-chart-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Reliability Chart */
.chart-reliability {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.reliability-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.reliability-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reliability-source {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.reliability-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.reliability-score-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reliability-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.reliability-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.reliability-bar.high {
  background: var(--severity-low);
}

.reliability-bar.medium {
  background: var(--severity-medium);
}

.reliability-bar.low {
  background: var(--severity-critical);
}

.reliability-score {
  width: 35px;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Intensity Chart */
.chart-intensity {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2) 0;
}

.intensity-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-4);
}

.intensity-value {
  font-size: 48px;
  font-weight: 700;
}

.intensity-value.critical {
  color: var(--severity-critical);
}

.intensity-value.high {
  color: var(--severity-high);
}

.intensity-value.medium {
  color: var(--severity-medium);
}

.intensity-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.intensity-breakdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.intensity-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.intensity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.intensity-dot.critical {
  background: var(--severity-critical);
}

.intensity-dot.high {
  background: var(--severity-high);
}

.intensity-dot.medium {
  background: var(--severity-medium);
}

.intensity-dot.low {
  background: var(--severity-low);
}

.intensity-severity {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: capitalize;
}

.intensity-percentage {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================================
   CESIUMJS MAP STYLES
   ============================================================================ */

.cesium-container {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height) - 50px);
  background: #000;
}

#cesiumContainer {
  width: 100%;
  height: 100%;
}

/* Custom Cesium styling */
.cesium-viewer {
  font-family: 'Inter', sans-serif;
}

.cesium-viewer-toolbar {
  z-index: 100;
}

.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer {
  display: none; /* Hide default timeline */
}

/* Visual Mode Controls */
.visual-mode-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  background: rgba(15, 23, 42, 0.9);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  z-index: 1000;
}

.visual-mode-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.visual-mode-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.visual-mode-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* CRT Effect */
.crt-mode {
  position: relative;
}

.crt-mode::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10000;
  animation: scanlines 0.1s linear infinite;
}

.crt-mode::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.4) 90%
  );
  pointer-events: none;
  z-index: 10001;
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

/* Night Vision Effect */
.nvg-mode {
  filter: grayscale(100%) sepia(100%) hue-rotate(50deg) saturate(400%) contrast(1.2);
}

.nvg-mode::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 50, 0, 0.3) 70%,
    rgba(0, 30, 0, 0.8) 100%
  );
  pointer-events: none;
  z-index: 10000;
}

/* FLIR/Thermal Effect */
.flir-mode {
  filter: contrast(1.3) saturate(0);
}

.flir-mode::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 0, 0, 0.1),
    rgba(255, 255, 0, 0.1),
    rgba(0, 255, 0, 0.1)
  );
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: overlay;
}

/* Heat Map Legend */
.heatmap-legend {
  position: absolute;
  bottom: 80px;
  right: 20px;
  background: rgba(15, 23, 42, 0.9);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  z-index: 1000;
}

.heatmap-legend-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.heatmap-legend-gradient {
  width: 150px;
  height: 12px;
  background: linear-gradient(to right, 
    rgba(0, 255, 0, 0.3),
    rgba(255, 255, 0, 0.5),
    rgba(255, 165, 0, 0.7),
    rgba(255, 0, 0, 0.9)
  );
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
}

.heatmap-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

/* Entity Info Panel */
.entity-info-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  min-width: 250px;
  z-index: 1000;
  display: none;
}

.entity-info-panel.active {
  display: block;
}

.entity-info-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.entity-info-icon {
  font-size: var(--text-2xl);
}

.entity-info-title {
  font-weight: 600;
  color: var(--text-primary);
}

.entity-info-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.entity-info-label {
  color: var(--text-muted);
}

.entity-info-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Layer Toggle Active State */
.layer-toggle input:checked + span {
  color: var(--accent-cyan);
}

/* Cesium Selection Indicator */
.cesium-selection-wrapper {
  border: 2px solid var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5) !important;
}

/* Custom Cesium Tooltip */
.cesium-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  padding: var(--space-2) var(--space-3) !important;
}

/* ============================================================================
   PREDICTION ENGINE STYLES
   ============================================================================ */

.prediction-container {
  padding: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
}

.prediction-header {
  text-align: center;
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.prediction-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.prediction-title svg {
  color: var(--accent-cyan);
}

.prediction-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Scenario Builder */
.scenario-builder {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  border: 1px solid var(--border-subtle);
}

.scenario-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.scenario-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.scenario-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.scenario-field label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scenario-field select {
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.scenario-field select:hover,
.scenario-field select:focus {
  border-color: var(--accent-blue);
  outline: none;
}

.prediction-run-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.prediction-run-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.prediction-run-btn:active {
  transform: translateY(0);
}

/* Prediction Results */
.prediction-results {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.results-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.results-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.predictions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}

.prediction-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  animation: slideIn 0.4s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prediction-card.high {
  border-left: 3px solid var(--severity-critical);
}

.prediction-card.medium {
  border-left: 3px solid var(--severity-high);
}

.prediction-card.low {
  border-left: 3px solid var(--severity-low);
}

.prediction-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.prediction-icon {
  font-size: var(--text-xl);
}

.prediction-category {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prediction-outcome {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.prediction-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.prediction-probability {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.probability-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.probability-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.probability-fill.high {
  background: var(--severity-critical);
}

.probability-fill.medium {
  background: var(--severity-high);
}

.probability-fill.low {
  background: var(--severity-low);
}

.probability-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
}

.prediction-timeframe {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.prediction-confidence {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* Empty State */
.prediction-empty {
  text-align: center;
  padding: var(--space-8);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-subtle);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.empty-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Info Section */
.prediction-info {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.info-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

.info-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.info-number {
  width: 28px;
  height: 28px;
  background: var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-text strong {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.info-text span {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .mobile-filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .mobile-filter-select {
    flex: 1;
    min-width: 140px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
  }
  
  .mobile-filter-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
  }
  
  .scenario-inputs {
    grid-template-columns: 1fr;
  }
  
  .predictions-grid {
    grid-template-columns: 1fr;
  }
  
  .prediction-title {
    font-size: var(--text-xl);
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* Desktop: Ragnarok section follows standard tab visibility */
