/* ═══════════════════════════════════════════════
   WINDY SPOTS v2 — Base Styles & Design Tokens
   ═══════════════════════════════════════════════ */

:root {
  /* Backgrounds */
  --bg:        #0d0d12;
  --bg2:       #13131a;
  --bg3:       #1a1a24;
  --surface:   #1e1e2e;
  --surface2:  #252535;

  /* Borders */
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);

  /* Accent (purple) */
  --accent:    #8b5cf6;
  --accent2:   #a78bfa;
  --accent3:   #c4b5fd;
  --accent-bg: rgba(139,92,246,0.12);
  --accent-border: rgba(139,92,246,0.3);

  /* Text */
  --text:      #f0effe;
  --text2:     #9d9bb5;
  --text3:     #5e5c78;

  /* Semantic */
  --green:  #34d399;
  --amber:  #fbbf24;
  --red:    #f87171;

  /* Layout */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;

  /* Typography */
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Sheet */
  --sheet-z: 300;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
}

@font-face {
  font-family: 'Syne';
  src: url('/static/fonts/syne-v24-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Syne';
  src: url('/static/fonts/syne-v24-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Syne';
  src: url('/static/fonts/syne-v24-latin-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-v17-latin-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-v17-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── LEAFLET OVERRIDES ─────────────────────────────────────── */
.leaflet-control-zoom {
  display: none !important;
}
.leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(13,13,18,0.7) !important;
  color: var(--text3) !important;
  border-radius: 6px 0 0 0 !important;
}
.leaflet-control-attribution a { color: var(--text3) !important; }

/* Custom purple marker */
.ws-marker {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  border: 2px solid var(--accent3);
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(139,92,246,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ws-marker:hover {
  transform: rotate(-45deg) scale(1.12);
  box-shadow: 0 6px 18px rgba(139,92,246,0.65);
}
.ws-marker svg { transform: rotate(45deg); }

/* Location dot */
.ws-location-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.25);
}

/* ── TOPBAR ────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  background: linear-gradient(to bottom, rgba(13,13,18,0.97) 70%, transparent);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-logo {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}
.topbar-logo span { color: var(--accent2); }

.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(30,28,50,0.85);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text2);
  transition: all 0.15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.91); background: var(--surface2); }
.icon-btn.active {
  background: rgba(139,92,246,0.2);
  border-color: var(--accent);
  color: var(--accent2);
}


/* ── FAB ───────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  box-shadow: 0 8px 24px rgba(139,92,246,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  transition: all 0.2s;
  color: white;
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(0.92); box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.fab.add-mode {
  background: linear-gradient(135deg, var(--red), #b91c1c);
  box-shadow: 0 8px 24px rgba(248,113,113,0.45);
}

/* ── ADD HINT BANNER ───────────────────────────────────────── */
.add-hint {
  position: fixed;
  top: 72px;
  left: 12px;
  right: 12px;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(19,19,26,0.97);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  z-index: 210;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.add-hint.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.add-hint svg { color: var(--accent2); flex-shrink: 0; }
.add-hint-text { flex: 1; min-width: 0; }
.add-hint-cancel {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--border2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  background: var(--surface);
  transition: all 0.15s;
}
.add-hint-cancel:active { background: var(--surface2); }

/* ── PLACE POPUP ───────────────────────────────────────────── */
.place-popup {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 210;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.place-popup.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.place-popup-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(19,19,26,0.97);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 260px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.place-popup-coords {
  font-size: 12px;
  color: var(--text2);
  font-family: monospace;
  letter-spacing: 0.3px;
}
.place-popup-confirm {
  width: 100%;
  padding: 11px 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  font-size: 14px;
  font-weight: 600;
  color: white;
  transition: all 0.15s;
}
.place-popup-confirm:active { transform: scale(0.97); }

/* ── TOAST ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  left: 16px; right: 16px;
  padding: 14px 18px;
  background: rgba(19,19,26,0.97);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  z-index: 500;
  backdrop-filter: blur(20px);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.error  { border-color: rgba(248,113,113,0.3); }
.toast.show   { transform: translateY(0); opacity: 1; }

/* ── FORMS (shared) ────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  font-weight: 600;
  margin-bottom: 10px;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  /*-webkit-appearance: none;*/
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: none; min-height: 80px; line-height: 1.5; }

/* Pflichtfeld-Indikator — nur für required labels */
.form-label.required::after {
  content: ' ★';
  color: var(--accent2);
  font-size: 10px;
  vertical-align: super;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.chip.selected {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent2);
}
.chip:active { transform: scale(0.94); }

.star-row { display: flex; gap: 8px; }
.star {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 22px;
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.star.lit { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.4); color: var(--amber); }
.star:active { transform: scale(0.88); }

.section-divider {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0 20px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text3); font-weight: 600;
}
.divider-line { flex: 1; height: 1px; background: var(--border); }

.btn-primary {
  width: 100%; padding: 15px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  font-family: var(--font-head);
  font-size: 16px; font-weight: 700;
  color: white; letter-spacing: 0.3px;
  box-shadow: 0 8px 24px rgba(139,92,246,0.35);
  transition: all 0.2s;
  margin-top: 8px;
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 4px 12px rgba(139,92,246,0.2); }

.btn-ghost {
  width: 100%; padding: 13px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border2);
  font-size: 14px; font-weight: 500;
  color: var(--text2);
  transition: all 0.15s;
  margin-top: 10px;
}
.btn-ghost:active { background: var(--surface); }

/* ── COMPASS ───────────────────────────────────────────────── */
.compass-wrap { display: flex; align-items: center; gap: 20px; }

.compass-map {
  position: absolute;
  inset: 0;               /* füllt compass-outer komplett */
  border-radius: 50%;      /* optional, wenn du runde Map willst */
  overflow: hidden;        /* Map wird sauber in Kreis geschnitten */
  z-index: 0;              /* unter den Needle & Labels */
}
.compass-needle { z-index: 1; }
.compass-labels { z-index: 2; }

.compass-outer {
  width: 110px; height: 110px;  
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: none;
}
.compass-labels {
  position: absolute; inset: 0;
  pointer-events: none;
}
.cn, .cs, .ce, .cw {
  position: absolute;
  font-size: 9px; font-weight: 700;
  color: var(--text3);
}
.cn { top: 5px;   left: 50%; transform: translateX(-50%); color: var(--accent2); }
.cs { bottom: 5px; left: 50%; transform: translateX(-50%); }
.ce { right: 6px;  top: 50%;  transform: translateY(-50%); }
.cw { left: 6px;   top: 50%;  transform: translateY(-50%); }

.compass-needle {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2);
  pointer-events: none;
  transition: transform 0.1s;
}

.compass-info { flex: 1; }
.compass-angle {
  font-family: var(--font-head);
  font-size: 26px; font-weight: 700;
  color: var(--text); line-height: 1;
}
.compass-hint { font-size: 12px; color: var(--text2); margin-top: 4px; }
.compass-reset {
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--border2);
  font-size: 12px;
  color: var(--text3);
  background: var(--surface);
  transition: all 0.15s;
}
.compass-reset:active { background: var(--surface2); }

/* ── MISC ───────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── SPORT SECTIONS ────────────────────────────────────────── */
.sport-section {
  display: none;
  animation: fadeIn 0.2s ease;
  scroll-margin-top: 0;
}
.sport-section.visible { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

#sheet-add .sheet-body {
  scroll-behavior: auto;
  overscroll-behavior: contain;
}
/* Multi-select chips (mehrere wählbar) */
.chips-multi .chip { position: relative; }
.chips-multi .chip.selected::after {
  content: '✓';
  position: absolute;
  top: -5px; right: -5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

/* ── BEGINNER SLIDER ───────────────────────────────────────── */
.beginner-slider-wrap { display: flex; flex-direction: column; gap: 10px; }

.beginner-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right,
    #f87171 0%,
    #fbbf24 40%,
    #34d399 100%
  );
  outline: none;
  cursor: pointer;
}
.beginner-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.15s;
}
.beginner-slider::-webkit-slider-thumb:active { transform: scale(1.2); }
.beginner-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent);
  cursor: pointer;
}

.beginner-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
}
.beginner-badge {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  min-width: 32px;
  text-align: center;
  transition: color 0.3s;
}

/* ── DETAIL: BEGINNER BAR ──────────────────────────────────── */
.beginner-bar-wrap { margin-bottom: 16px; }
.beginner-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
}
.beginner-bar-label span:last-child {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.beginner-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface2);
  overflow: hidden;
}
.beginner-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
}

/* ── DETAIL: SPORT TAGS ────────────────────────────────────── */
.style-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; justify-content: flex-end; }
.style-tag {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent3);
}
.hazard-tag {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--red);
}

/* ── GENERAL SECTION (hidden until sport chosen) ───────────── */
.general-section {
  display: none;
  animation: fadeIn 0.25s ease;
}
.general-section.visible { display: block; }

/* ── COMPASS WITH MINIMAP ──────────────────────────────────── */
.compass-with-map { overflow: hidden; }
#compass-session-minimap {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  width: 100%;
  height: 100%;
}

.compass-with-map > div:first-child {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.compass-outer { position: relative; }
.compass-labels, .compass-needle { position: absolute; inset: 0; z-index: 2; }

/* ── ACCORDION (ausklappbare Sektionen im Detail) ──────────── */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.accordion-header:active { background: var(--surface2); }
.accordion-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.accordion-chevron {
  color: var(--text3);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.accordion.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  display: none;
  padding: 0 16px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.accordion.open .accordion-body { display: block; }
.accordion-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.accordion-row:last-child { border-bottom: none; }
.accordion-row-label { color: var(--text3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; flex-shrink: 0; margin-right: 12px; padding-top: 2px; }
.accordion-row-val { color: var(--text); text-align: right; flex: 1; }
