/* CultureSherpa Shared Theme (Dark Futuristic) */
:root {
  --bg-0: #0b1220;
  --bg-1: #111827;
  --bg-2: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #60a5fa;
  --secondary: #22d3ee;
  --accent: #a78bfa;
  --ring: rgba(96,165,250,.45);
  --border: rgba(255,255,255,.06);

  /* Old Atlas tokens */
  --atlas-emerald: #2d5a3d;
  --atlas-gold: #d4af37;
  --atlas-parchment: #f4f1e8;
  --atlas-navy: #1a1f2e;
  --atlas-brass: #cd7f32;
  --atlas-teal: #2e7c6f;
  --atlas-violet: #5b4b8a;
  --atlas-ice: #99c7ff;
  --atlas-glow-strong: 0 0 18px rgba(212, 175, 55, 0.55);
  --atlas-glow-soft: 0 0 8px rgba(45, 90, 61, 0.5);

  /* Map line palette (enhanced light-on-dark) */
  --map-line: #8ab4ff;          /* base stroke - soft blue */
  --map-line-hover: #bcd2ff;    /* hover stroke - brighter blue */
  --map-line-active: #c4b5fd;   /* active/selected stroke - violet */
  --map-text: #e2e8f0;          /* map labels - high contrast */
  --map-text-shadow: rgba(0,0,0,0.8); /* text shadow for clarity */
}

/* Light theme (opt-in via [data-theme="light"]) */
[data-theme="light"] {
  --bg-0: #f3f4f6;
  --bg-1: #ffffff;
  --bg-2: #eef2f7;
  --text: #111827;
  --muted: #4b5563;
  --primary: #4f46e5; /* indigo-600 */
  --secondary: #0ea5e9; /* sky-600 */
  --accent: #7c3aed; /* violet-600 */
  --ring: rgba(79,70,229,.25);
  --border: rgba(17,24,39,.12);

  /* Atlas tokens stay the same between themes except parchment contrast */
  --atlas-parchment: #f4f1e8; /* ensures readable on light */
  
  /* Light theme map colors (dark-on-light) */
  --map-line: #4f46e5;          /* base stroke - indigo */
  --map-line-hover: #3730a3;    /* hover stroke - darker indigo */
  --map-line-active: #7c3aed;   /* active/selected stroke - violet */
  --map-text: #1f2937;          /* map labels - dark text */
  --map-text-shadow: rgba(255,255,255,0.8); /* light text shadow */
}

@keyframes glowShift {
  0% { transform: translate3d(0,0,0) scale(1); opacity: .6; }
  50% { transform: translate3d(2%, -1%, 0) scale(1.02); opacity: .7; }
  100% { transform: translate3d(0,0,0) scale(1); opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw -20vh -10vw;
  background: radial-gradient(50% 40% at 30% 20%, rgba(96,165,250,.25), transparent 60%),
              radial-gradient(40% 35% at 70% 30%, rgba(167,139,250,.18), transparent 60%),
              radial-gradient(55% 45% at 50% 85%, rgba(34,211,238,.15), transparent 65%);
  filter: blur(40px) saturate(120%);
  z-index: -1;
  animation: glowShift 24s ease-in-out infinite;
}

/* Subtle background for light theme */
[data-theme="light"] body::before { background: none; }

/* Focus ring */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 6px var(--ring); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 10px; border: 2px solid #0b1220; }
*::-webkit-scrollbar-track { background: #0b1220; }

/* Enhanced Card Variants */
.content-preview {
  position: absolute;
  bottom: 50px;
  left: 15px;
  right: 15px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.culture-card:hover .content-preview {
  opacity: 1;
}

.card--featured {
  grid-column: span 2;
  min-height: 320px;
}

.card--compact {
  min-height: 200px;
}

.card--compact .culture-content {
  padding: 15px;
}

.culture-teaser {
  font-size: 0.9em;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.4;
}

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

.confidence-badge {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
}

.pop-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
}

.culture-meta {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.8em;
  color: var(--muted);
  background: var(--bg-1);
  padding: 4px 8px;
  border-radius: 8px;
}

/* Modal Action Buttons */
.tier2-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 15px;
}

.action-group {
  display: flex;
  gap: 10px;
}

.btn-bookmark, .btn-share {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
}

.btn-bookmark:hover, .btn-share:hover {
  background: var(--bg-2);
  transform: translateY(-1px);
}

.btn-close, .btn-full-profile {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-close {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn-full-profile {
  background: var(--primary);
  color: white;
  border: none;
}

/* Notifications */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.notification {
  animation: slideIn 0.3s ease;
}

/* Leaflet tweaks */
.leaflet-control-zoom a { background: #0b1220 !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.leaflet-control-zoom a:hover { background: #111827 !important; }
/* Improve tap target size on touch */
.leaflet-touch .leaflet-bar a,
.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {
  min-width: 44px;
  min-height: 44px;
}

/* Also improve tap targets when device reports coarse pointer */
@media (hover: none) and (pointer: coarse) {
  .leaflet-control-zoom a {
    min-width: 44px;
    min-height: 44px;
    line-height: 44px;
    font-size: 18px;
  }
}

/* Top progress bar overlays page; no layout changes required */

/* Generic components used across pages */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
}
.btn-primary:hover { filter: brightness(1.05); }

.input, input[type="text"], select {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
}
