/* =========================================================
   Franzi's Gewürzekammer – Interaktive Weltkarte
   All-in-One Stylesheet (ohne Abhängigkeit zu style.css)
   ========================================================= */

/* ---------- 1. Reset & Variablen ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #1a1613;
  --bg-secondary: #241d18;
  --bg-tertiary: #2e251e;
  --accent: #c9955a;
  --accent-hover: #e0ab6d;
  --accent-muted: #8a6a44;
  --text-light: #f4ede4;
  --text-muted: #a89787;
  --border: #3a2f26;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --radius: 8px;

  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- 2. Layout & Body ---------- */
body.map-body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Container für die Hauptkarte */
.map-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 600px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background-color: var(--bg-primary);
}

/* Hauptkarte */
#world-map {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 0 0;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---------- 3. Inaktive & Aktive Länder (Fallback-Styles) ---------- */
.country.inactive,
g.country.inactive path,
svg path {
  fill: #14110f !important;
  stroke: #2a221b !important;
  stroke-width: 0.5px;
  cursor: default;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

path.country.active,
path.active,
svg path.country.active,
svg path.active {
  fill: #c9955a !important;
  stroke: #e0ab6d !important;
  stroke-width: 0.8px !important;
  cursor: pointer !important;
  transition: all 0.25s ease;
}

path.country.active:hover,
path.active:hover,
svg path.country.active:hover,
svg path.active:hover {
  fill: #e0ab6d !important;
  stroke: #ffffff !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(0px 0px 8px #c9955a) !important;
}

.country.is-hovered,
path.is-hovered {
  fill: #f5c184 !important;
  stroke: #ffffff !important;
  stroke-width: 2px !important;
  filter: drop-shadow(0px 0px 12px rgba(255, 255, 255, 0.9)) drop-shadow(0px 0px 20px #c9955a) !important;
}

/* ---------- 4. Tooltip ---------- */
.map-tooltip {
  position: fixed;
  display: none;
  padding: 6px 14px;
  background-color: var(--bg-secondary);
  color: var(--text-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 9999;
  white-space: nowrap;
}

/* ---------- 5. Legende ---------- */
.map-legend {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(36, 29, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 180px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.map-legend h3 {
  margin: 0 0 12px 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(201, 149, 90, 0.3);
  padding-bottom: 6px;
}

.map-legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Legenden-Container (Overflow angepasst, damit Glow nicht abgeschnitten wird) */
.map-legend {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(36, 29, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 190px;
  /* KEIN overflow: hidden / auto mehr am Hauptcontainer! */
  overflow: visible; 
  box-shadow: var(--shadow);
}

.map-legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Styling für gehoverte & hervorgehobene Legenden-Einträge */
.map-legend li:hover,
.map-legend li.highlighted {
  position: relative;
  z-index: 2; /* Erhöht die Ebene, damit der Glow über allen anderen Zeilen liegt */
  background: rgba(201, 149, 90, 0.45) !important;
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 6px;
  
  /* Weißer, strahlender Rahmen direkt als Inset-Border / Box-Shadow */
  border: 1px solid #ffffff !important;
  
  /* Mehrstufiger Glow-Effekt */
  box-shadow: 
    0 0 12px rgba(255, 255, 255, 0.9),
    0 0 20px rgba(224, 171, 109, 0.8),
    inset 0 0 10px rgba(255, 255, 255, 0.4) !important;

  /* Strahlender Text-Glow */
  text-shadow: 0 0 8px #ffffff, 0 0 12px #c9955a !important;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.map-legend .flag {
  width: 20px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-legend .flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

/* Perfekte Ausrichtung für die Flaggen in der Legende */
.map-legend li {
  display: flex;
  align-items: center;
  gap: 10px; /* Abstand zwischen Flagge und Text */
  padding: 6px 10px;
  cursor: pointer;
}

.map-legend li img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px; /* Leicht abgerundete Ecken für die Flaggen */
  flex-shrink: 0;   /* Verhindert, dass die Flagge gestaucht wird */
}

/* ---------- 6. Mini-Map Radar ---------- */
.minimap-box {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 180px;
  height: 120px;
  z-index: 100;
  background: rgba(45, 36, 30, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#minimap-svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  opacity: 1;
  pointer-events: none; /* Verschluckt keine Events mehr */
}

#minimap-viewport {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px solid #ffffff;
  background: rgba(201, 149, 90, 0.35);
  box-shadow: 0 0 8px rgba(201, 149, 90, 0.8);
  border-radius: 3px;
  pointer-events: none; /* Lässt Klicks durch auf das Overlay */
  transition: transform 0.1s ease-out; /* Reaktionsschnell beim Drags */
}

/* Das unsichtbare Drag-Shield für butterweiches Ziehen */
.minimap-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: grab;
  pointer-events: auto;
}

.minimap-overlay:active {
  cursor: grabbing;
}