/* CallerHub (c) 2026 - Simon Bernhard
   Weltkarte der Anrufanalyse auf der Website (weltkarte-demo.js, 10.11.2026). Die Karte selbst (weltkarte/webmap.js, aus der App) liest ihre
   Farben aus den Variablen unten (gleiche Namen wie in der App); die Website bleibt im dunklen Design. Nur auf Seiten mit der Karte laden. */
:root { --surface: #0f172b; --alt: #131c33; --border: rgba(255, 255, 255, .14); --text: #eef2fb; --muted: #a3aec4; --accent: #5b8def; --accent-text: #8fb0ff;
  --success: #34d399; --warning: #f5c451; --danger: #fb7185; --neutral: #94a3b8; --header: #0b1020; }

.wm-demo { position: relative; max-width: 100%; text-align: left; }
.wm-demo .wm-fallback { display: block; width: 100%; height: auto; border-radius: 12px; }
.wm-demo.wm-live .wm-fallback { display: none; }
.wm-holder { position: relative; }
/* Platz schon vor dem Laden reservieren (kein Springen der Seite) */
.wm-holder.wm-wait { aspect-ratio: 1000 / 452; max-height: 520px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #0b1b30 0%, #060d19 55%, #020409 100%); }
.wm-holder.wm-wait::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(100deg, transparent, rgba(56, 214, 245, .07) 50%, transparent); transform: translateX(-100%); }
@media (prefers-reduced-motion: no-preference) { .wm-holder.wm-wait::after { animation: wm-load 1.6s linear infinite; } }
@keyframes wm-load { from { transform: translateX(-100%); } to { transform: translateX(230%); } } /* transform statt background-position (Simon 16.11.2026: Ruckeln) */
.wm-demo .worldmap { position: relative; }
.wm-demo .wm-stage { box-shadow: inset 0 0 0 1px rgba(56, 214, 245, .12); }
/* Handy: Karte etwas hoeher (ganze Erde sichtbar, mehr Flaeche zum Tippen) */
@media (max-width: 600px) {
  .wm-demo .wm-stage svg { height: min(58vw, 280px) !important; }
  .wm-holder.wm-wait { aspect-ratio: auto; height: calc(min(58vw, 280px) + 46px); }
}

/* Legende und Schalter (wie in der Browser-Auswertung der App) */
.wm-demo .legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.3; }
.wm-demo .legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; background: var(--c); vertical-align: -1px; }
.wm-demo button.toggle { font: inherit; font-size: 12px; font-weight: 600; background: transparent; color: var(--muted); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; min-height: 30px; padding: 4px 12px; cursor: pointer; }
.wm-demo button.toggle:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.wm-demo button.toggle:focus-visible { outline: 2px solid var(--cyan, #38d6f5); outline-offset: 2px; }
.wm-demo .hint { font-size: 12px; color: var(--muted); }

/* Infofenster und Kurzhinweis (gleich aufgebaut wie in der App) */
#mapinfo { position: fixed; pointer-events: none; z-index: 70; display: none; width: 260px; max-width: calc(100vw - 16px); box-sizing: border-box; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .16); padding: 12px; font-size: 12px; line-height: 1.35; text-align: left; }
#mapinfo .mi-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
#mapinfo .mi-mark { flex: none; width: 30px; height: 22px; border: 1.5px solid var(--c); border-radius: 4px; color: var(--c); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
#mapinfo .mi-mark.site { width: 30px; height: 30px; border-radius: 50%; font-size: 15px; font-weight: 400; }
#mapinfo .mi-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mapinfo .mi-sub, #mapinfo .mi-label, #mapinfo .mi-note { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mapinfo .mi-kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; }
#mapinfo .mi-kpis b { display: block; font-size: 18px; font-weight: 600; line-height: 1.25; }
#mapinfo .mi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#mapinfo .mi-row b { font-size: 14px; font-weight: 600; }
#mapinfo .mi-bar { height: 4px; border-radius: 2px; background: var(--border); margin: 6px 0 10px; overflow: hidden; }
#mapinfo .mi-bar i { display: block; height: 100%; border-radius: 2px; }
#mapinfo .mi-note { margin-top: 8px; white-space: normal; }
.wm-tip { position: fixed; pointer-events: none; background: #0b1020; color: #fff; border: 1px solid rgba(56, 214, 245, .35); border-radius: 6px; padding: 6px 9px; font-size: 12px; display: none; white-space: nowrap; z-index: 71; }

/* Zoomen ohne Mausrad (in der Leiste unter der Karte) und Hinweis "Strg + Mausrad" */
.wm-zoom { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.wm-demo .legend .wm-zoom::before { display: none; }
.wm-zoom button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid rgba(56, 214, 245, .45); background: rgba(4, 9, 20, .62); color: #e6f6ff; font: 600 17px/1 var(--sans, system-ui, sans-serif); cursor: pointer; }
.wm-zoom button:hover { background: rgba(56, 214, 245, .16); }
.wm-zoom button:focus-visible { outline: 2px solid var(--cyan, #38d6f5); outline-offset: 2px; }
.wm-flash { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 90%; padding: .55rem .9rem; border-radius: 999px; background: rgba(4, 9, 20, .84); border: 1px solid rgba(56, 214, 245, .4);
  color: #e9eefb; font-size: .9rem; line-height: 1.3; text-align: center; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 3; }
.wm-flash.on { opacity: 1; }

/* Hinweise wie in der App-Vorschau: pulsierender Punkt, Erklaerung beim Zeigen, Tippen oder mit der Tabulatortaste */
.wm-hints { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; z-index: 4; }
.wm-hint { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 0; background: transparent; cursor: help; pointer-events: auto; font: inherit; color: inherit; line-height: 1.4; }
.wm-hint::before { content: ""; position: absolute; left: 9px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan, #38d6f5); box-shadow: 0 0 0 .3rem rgba(56, 214, 245, .25), 0 0 14px rgba(56, 214, 245, .55); }
@media (prefers-reduced-motion: no-preference) { .wm-hint::before { animation: wm-pulse 2.4s ease-in-out infinite; } }
@keyframes wm-pulse { 50% { transform: scale(1.3); } }
.wm-hint-label { position: absolute; top: 100%; left: 0; width: 280px; margin-top: .35rem; padding: .55rem .75rem; border-radius: 10px; background: #0b1020; border: 1px solid var(--cyan, #38d6f5); color: #e9eefb;
  font-size: .9rem; text-align: left; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .85); }
.wm-hint.up .wm-hint-label { top: auto; bottom: 100%; margin: 0 0 .35rem; transform: translateY(4px); }
.wm-hint:hover, .wm-hint:focus { outline: none; z-index: 2; }
.wm-hint:hover .wm-hint-label, .wm-hint:focus .wm-hint-label { opacity: 1; transform: none; }
.wm-hint:hover::before, .wm-hint:focus::before { animation: none; background: #fff; }
.wm-hint:focus-visible::before { outline: 2px solid #fff; outline-offset: 4px; }
.wm-hints.zoomed .anchored { display: none; }
@media (max-width: 720px) { .wm-hint-label { font-size: .85rem; } }

/* Filter wie in der App: Klick auf Land oder Anlage */
.wm-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; margin: .7rem 0 0; padding: .5rem .8rem; border: 1px solid rgba(56, 214, 245, .35); border-radius: 12px;
  background: rgba(56, 214, 245, .06); font-size: .9rem; line-height: 1.4; color: var(--text); }
.wm-filter[hidden] { display: none; }
.wm-filter b { color: #fff; font-weight: 650; }
.wm-filter button { margin-inline-start: auto; font: inherit; font-size: .85rem; padding: .3rem .75rem; border-radius: 999px; border: 1px solid rgba(56, 214, 245, .5); background: transparent; color: #e6f6ff; cursor: pointer; }
.wm-filter button:hover { background: rgba(56, 214, 245, .14); }
.wm-filter button:focus-visible { outline: 2px solid var(--cyan, #38d6f5); outline-offset: 2px; }
.wm-line { margin: .6rem 0 0; font-size: .85rem; color: var(--ink-faint, #8692a9); text-align: center; line-height: 1.4; }

@media print {
  .wm-demo.wm-live .wm-fallback { display: block; }
  .wm-holder, .wm-filter, .wm-line, #mapinfo, .wm-tip { display: none !important; }
}
