/* ============================================================
   FEATURES.CSS
   New feature styles for World Superpowers Interactive Map
   Uses existing theme variables:
     --gold, --gold-dim, --ink, --panel, --text, --text-dim
   ============================================================ */


/* ------------------------------------------------------------
   1. KEYBOARD SHORTCUTS HELP OVERLAY
   Modal triggered by '?' key, listing all keyboard shortcuts.
   ------------------------------------------------------------ */

#shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#shortcuts-overlay.open {
  display: flex;
}

#shortcuts-box {
  background: rgba(10,10,15,0.97);
  border: 1px solid rgba(201,168,76,0.2);
  padding: 28px 36px;
  max-width: 400px;
  width: 90%;
}

#shortcuts-box h3 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.sc-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.sc-key {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
  background: rgba(201,168,76,0.08);
  padding: 1px 8px;
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 2px;
  min-width: 60px;
  text-align: center;
}

.sc-desc {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

#shortcuts-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}




/* ------------------------------------------------------------
   3. LIVE STATS BAR
   Subtle stats readout (empire count, largest empire) at top-right.
   ------------------------------------------------------------ */

#live-stats {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 800;
  background: rgba(10,10,15,0.85);
  border: 1px solid rgba(201,168,76,0.1);
  padding: 6px 12px;
  backdrop-filter: blur(8px);
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: flex;
  gap: 16px;
  align-items: center;
}

.ls-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.ls-val {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0;
}

.ls-label {
  font-size: 7px;
  letter-spacing: 1.5px;
}

.ls-sep {
  width: 1px;
  height: 20px;
  background: rgba(201,168,76,0.1);
}


/* ------------------------------------------------------------
   4. SELECTED EMPIRE GLOW EFFECT
   Animated pulse/glow on the currently selected empire territory.
   ------------------------------------------------------------ */

.territory-selected {
  animation: empireGlow 2s ease-in-out infinite;
}

@keyframes empireGlow {
  0%, 100% {
    stroke-opacity: 0.8;
    stroke-width: 3;
  }
  50% {
    stroke-opacity: 1;
    stroke-width: 4;
  }
}


/* ------------------------------------------------------------
   5. QUICK-JUMP YEAR BUTTONS
   Small buttons on the timeline for jumping to key historical years.
   ------------------------------------------------------------ */

#quick-jumps {
  display: flex;
  gap: 4px;
  align-items: center;
}

.qj-btn {
  background: none;
  border: 1px solid rgba(201,168,76,0.12);
  color: var(--text-dim);
  font-family: 'Oswald', sans-serif;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 1px;
  transition: all 0.15s;
  white-space: nowrap;
}

.qj-btn:hover {
  border-color: rgba(201,168,76,0.3);
  color: var(--gold);
}



/* ------------------------------------------------------------
   7. EMPIRE COMPARISON PANEL
   Floating panel for comparing two empires' power curves.
   ------------------------------------------------------------ */

#compare-panel {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 320px;
  background: rgba(10,10,15,0.92);
  border: 1px solid rgba(201,168,76,0.15);
  z-index: 800;
  backdrop-filter: blur(10px);
  display: none;
  padding: 12px;
}

#compare-panel.open {
  display: block;
}

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

#compare-header span {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold-dim);
  text-transform: uppercase;
}

#compare-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

#compare-canvas {
  width: 100%;
  height: 100px;
}

#compare-legend {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.cl-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.cl-dot {
  width: 8px;
  height: 2px;
  flex-shrink: 0;
}


/* ------------------------------------------------------------
   8. MOBILE IMPROVEMENTS
   Better responsive layout with larger touch targets.
   ------------------------------------------------------------ */

@media (max-width: 700px) {
  #live-stats {
    top: auto;
    bottom: 60px;
    right: 8px;
    padding: 4px 8px;
    gap: 10px;
  }

  .ls-val {
    font-size: 12px;
  }

  #quick-jumps {
    display: none;
  }

  #compare-panel {
    width: calc(100% - 24px);
    left: 12px;
    right: 12px;
    bottom: 60px;
  }

  #toggles {
    gap: 4px;
  }

  #toggles label {
    font-size: 8px;
  }

  #shortcuts-box {
    padding: 20px 24px;
  }

  #power-panel {
    width: 200px;
  }
}
