/* FAHRAO Shared Styles — eingebunden auf allen Seiten */

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
}

/* === Light Mode (default) === */
:root {
  --bg: #F5F0E8;
  --surface: #ffffff;
  --surface2: #f8f7f4;
  --border: #e0ddd6;
  --text: #0E2A2B;
  --text2: #7a7a72;
  --green: #2e7d32;
  --yellow: #E8A24A;
  --orange: #e65100;
  --red: #c62828;
  --accent: #0E2A2B;
  --radius: 12px;
  --map-bg: #F5F0E8;
  --hover: #f0ebe0;
  --shadow: rgba(14,42,43,0.08);
  --map-tiles: 'light';
}

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface2: #1a1a25;
    --border: #252530;
    --text: #e8e8f0;
    --text2: #888898;
    --green: #00e676;
    --yellow: #ffd600;
    --orange: #ff9100;
    --red: #ff1744;
    --accent: #448aff;
    --map-bg: #0a0a0f;
    --hover: #2a2a35;
    --shadow: rgba(0,0,0,0.3);
    --map-tiles: 'dark';
  }
}

/* === Manual Theme Override === */
html.dark-override {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a25;
  --border: #252530;
  --text: #e8e8f0;
  --text2: #888898;
  --green: #00e676;
  --yellow: #ffd600;
  --orange: #ff9100;
  --red: #ff1744;
  --accent: #448aff;
  --map-bg: #0a0a0f;
  --hover: #2a2a35;
  --shadow: rgba(0,0,0,0.3);
}

html.light-override {
  --bg: #F5F0E8;
  --surface: #ffffff;
  --surface2: #f8f7f4;
  --border: #e0ddd6;
  --text: #0E2A2B;
  --text2: #7a7a72;
  --green: #2e7d32;
  --yellow: #E8A24A;
  --orange: #e65100;
  --red: #c62828;
  --accent: #0E2A2B;
  --map-bg: #F5F0E8;
  --hover: #f0ebe0;
  --shadow: rgba(14,42,43,0.08);
}

/* === Logo Colors — nur im Dark Mode invertieren === */
.logo-main { fill: #0E2A2B; }
path.logo-main { fill: none; stroke: #0E2A2B; }
.logo-accent { fill: #E8A24A; }

@media (prefers-color-scheme: dark) {
  .logo-main { fill: #e8e8f0; }
  path.logo-main { fill: none; stroke: #e8e8f0; }
  .logo-accent { fill: #ffd600; }
}
html.dark-override .logo-main { fill: #e8e8f0; }
html.dark-override path.logo-main { fill: none; stroke: #e8e8f0; }
html.dark-override .logo-accent { fill: #ffd600; }
html.light-override .logo-main { fill: #0E2A2B; }
html.light-override path.logo-main { fill: none; stroke: #0E2A2B; }
html.light-override .logo-accent { fill: #E8A24A; }

/* Aliases (compat mit auswertung/hilfe shorthand vars) */
:root {
  --sf: var(--surface);
  --sf2: var(--surface2);
  --bd: var(--border);
  --tx: var(--text);
  --tx2: var(--text2);
  --g: var(--green);
  --y: var(--yellow);
  --o: var(--orange);
  --r: var(--red);
  --b: var(--accent);
}

/* === Tab Bar (bottom, mobile-style) === */
.tab-bar {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-bar a {
  flex: 1;
  text-align: center;
  padding: 8px 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  border-top: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  -webkit-tap-highlight-color: transparent;
}

.tab-bar a.active {
  color: var(--accent);
  border-top-color: var(--accent);
}

.tab-bar a:not(.active):active {
  background: var(--surface2);
}

.tab-bar svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* === Fullscreen Button === */
.fullscreen-btn {
  position: absolute;
  top: 80px;
  right: 10px;
  z-index: 501;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px var(--shadow);
}

.fullscreen-btn:hover {
  background: var(--surface2);
}

/* === Leaflet Overrides === */
.leaflet-container {
  background: var(--bg) !important;
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
