/* nozownicy.net – CSS 1:1 z globals.css (bez dyrektyw @tailwind – one psują parse) */

:root, html.dark {
  --background: #000000;
  --foreground: #f4f4f5;
  --card: #0a0a0a;
  --card-elevated: #141414;
  --border: #222222;
  --primary: #8b5cf6;
  --muted: #a1a1aa;
  --surface: #000000;
  --input-bg: #0a0a0a;
  --hover: #1a1a1a;
  --font-geist: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-geist-mono: ui-monospace, monospace;
  color-scheme: dark;
}
html.light {
  --background: #f8f8fa;
  --foreground: #09090b;
  --card: #ffffff;
  --card-elevated: #f4f4f5;
  --border: #e4e4e7;
  --primary: #7c3aed;
  --muted: #52525b;
  --surface: #ffffff;
  --input-bg: #ffffff;
  --hover: #f4f4f5;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: #000000 !important;
  background-color: var(--background) !important;
}
html.light { background-color: #f8f8fa !important; }

body {
  margin: 0 !important;
  background-color: #000000 !important;
  background-color: var(--background) !important;
  color: var(--foreground) !important;
  font-family: var(--font-geist);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.light body { background-color: #f8f8fa !important; }

button, a, input, select, label { touch-action: manipulation; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
html.light ::-webkit-scrollbar-thumb { background: #d4d4d8; }
* { scrollbar-width: thin; scrollbar-color: #3f3f46 #000; }
html.light * { scrollbar-color: #d4d4d8 #f8f8fa; }

.bg-surface { background-color: var(--surface) !important; }
.bg-surface-card { background-color: var(--card) !important; }
.bg-surface-elevated { background-color: var(--card-elevated) !important; }
.border-surface-border { border-color: var(--border) !important; }
.text-muted { color: var(--muted) !important; }
.text-white { color: var(--foreground) !important; }

html.light .text-gray-300 { color: #3f3f46 !important; }
html.dark .text-gray-300 { color: #d4d4d8 !important; }

input, select, textarea {
  background-color: var(--input-bg) !important;
  color: var(--foreground) !important;
  border-color: var(--border) !important;
}
input::placeholder, textarea::placeholder { color: var(--muted); }

.maplibregl-popup-content {
  background: var(--card) !important;
  color: var(--foreground) !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
  padding: 12px 14px !important;
}
.maplibregl-popup-tip { border-top-color: var(--card) !important; }
.maplibregl-popup-close-button { color: var(--muted) !important; font-size: 20px !important; padding: 6px 10px !important; }
.maplibregl-ctrl-group { background: var(--card) !important; border: 1px solid var(--border) !important; }
.maplibregl-ctrl-group button { background: var(--card) !important; border-color: var(--border) !important; width: 36px !important; height: 36px !important; }

/* Mapa – stała wysokość jak IncidentMap.tsx */
.map-wrap {
  position: relative !important;
  width: 100% !important;
  height: 300px !important;
  min-height: 300px !important;
  overflow: hidden !important;
  border-radius: 1rem !important;
  border: 1px solid var(--border) !important;
  background: #0a0a0a !important;
}
@media (min-width: 640px) {
  .map-wrap { height: 400px !important; min-height: 400px !important; }
}
@media (min-width: 1024px) {
  .map-wrap { height: 480px !important; min-height: 480px !important; }
}
.map-wrap #map {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.map-legend span {
  border-radius: 6px;
  background: rgba(0,0,0,0.75);
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
html.light .site-header {
  background-color: rgba(248, 248, 250, 0.95) !important;
}

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gallery-card { background: var(--card); border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; cursor: pointer; transition: transform .15s; }
.gallery-card:hover { transform: translateY(-2px); }
.gallery-card img, .gallery-card video { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #000; display: block; }
.gallery-player { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none !important; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 1.25rem 1.5rem;
}

.share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  z-index: 60;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.share-menu.hidden { display: none !important; }
.share-menu a, .share-menu button {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; padding: 0.6rem 0.75rem;
  border: none; background: transparent;
  color: var(--foreground); font-size: 0.875rem;
  border-radius: 0.5rem; cursor: pointer;
  text-decoration: none; font-family: inherit; text-align: left;
}
.share-menu a:hover, .share-menu button:hover { background: var(--hover); }

.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: rgba(133,77,14,.25); color: #fbbf24; }
.badge-approved { background: rgba(20,83,45,.3); color: #4ade80; }
.badge-rejected { background: rgba(127,29,29,.3); color: #f87171; }

/* Nadpisz Tailwind preflight – zawsze ciemne tło gdy nie light */
html:not(.light) body,
html.dark body {
  background-color: #000 !important;
  color: #f4f4f5 !important;
}

/* Leaflet dark popups */
.leaflet-container { background: #0a0a0a !important; font: inherit; }
.leaflet-popup-content-wrapper {
  background: #0a0a0a !important;
  color: #f4f4f5 !important;
  border-radius: 12px !important;
  border: 1px solid #222 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}
.leaflet-popup-tip { background: #0a0a0a !important; }
.leaflet-popup-content { margin: 12px 14px !important; }
.noz-pin { background: transparent !important; border: none !important; }
/* OSM fallback – lekko przyciemnione */
.leaflet-tile-pane .map-tiles-dark {
  filter: brightness(0.75) contrast(1.1) saturate(0.85);
}
