/* === MAP PAGE === */
#map { height: calc(100vh - 53px); width: 100%; }

/* Stats bar */
.stats-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  padding: 10px 20px;
  display: flex;
  gap: 20px;
  z-index: 800;
  font-size: 13px;
}
.stat { display: flex; align-items: center; gap: 6px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.stat-dot.poisoning { background: #d4513b; }
.stat-dot.vehicle { background: #e89b3b; }
.stat-dot.abuse { background: #8b5cf6; }
.stat-dot.other { background: #6b6560; }
.stat-count { font-weight: 700; }

/* Side panel (report form) */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 1100;
  pointer-events: none;
}
.panel-overlay.active { display: block; }

.panel {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  z-index: 1200;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.panel.open { right: 0; }

.panel-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header h2 { font-size: 16px; font-weight: 700; }
.panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-body { padding: 24px; flex: 1; }
.panel-body p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

.coords-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'DM Mono', monospace, var(--font);
  color: var(--text-secondary);
}

.form-submit { width: 100%; padding: 12px; margin-top: 8px; }
.form-note { font-size: 11px; color: var(--text-secondary); margin-top: 12px; line-height: 1.5; }

.pick-hint {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 900;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.pick-hint.visible { display: block; }

/* Emoji markers */
.emoji-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.15s;
}
.emoji-marker:hover { transform: scale(1.15); }
.emoji-marker.poisoning { background: #d4513b; }
.emoji-marker.vehicle { background: #e89b3b; }
.emoji-marker.abuse { background: #8b5cf6; }
.emoji-marker.trap { background: #ec4899; }
.emoji-marker.unknown { background: #6b7280; }
.emoji-marker.other { background: #6b6560; }

[data-theme="dark"] .emoji-marker {
  border-color: #3a3a3e;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Popups */
.leaflet-popup-content-wrapper {
  background: var(--popup-bg) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--popup-bg) !important; }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; line-height: 1.5; color: var(--text); }
.popup-cause { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; margin-bottom: 4px; }
.popup-date { color: var(--text-secondary); font-size: 12px; }
.popup-desc { margin-top: 6px; color: var(--text-secondary); }

/* Geolocation control */
.geo-control a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}
.geo-control a:hover { background: #f4f4f4; }
.geo-control a.searching { color: #4285f4; animation: geo-pulse 1.2s ease-in-out infinite; }
.geo-control a.active { color: #4285f4; }
[data-theme="dark"] .geo-control a { background: var(--surface); color: var(--text); }
[data-theme="dark"] .geo-control a:hover { background: var(--bg); }
[data-theme="dark"] .geo-control a.active { color: #6ea8fe; }
[data-theme="dark"] .geo-control a.searching { color: #6ea8fe; }

@keyframes geo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.geo-marker-dot { filter: drop-shadow(0 0 4px rgba(66,133,244,0.5)); }

/* Filter bar */
.filter-bar {
  display: none;
  position: fixed;
  top: 53px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  z-index: 900;
  gap: 12px;
  align-items: end;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.filter-bar.visible { display: flex; }
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group label { font-size: 10px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group input, .filter-group select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
}
.filter-group input:focus, .filter-group select:focus { outline: none; border-color: var(--accent); }

/* Cookie banner */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 3000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}
.cookie-banner.visible { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cookie-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; min-width: 200px; }
.cookie-text a { color: var(--accent); text-decoration: none; font-weight: 600; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Animations */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* === DESKTOP NAV === */
.desktop-nav { display: flex; gap: 16px; align-items: center; }
.desktop-nav a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.desktop-nav a:hover { color: var(--accent); }

/* Mobile/desktop visibility */
.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

/* === MOBILE MENU === */
.mobile-menu {
  display: none;
  position: fixed;
  top: 53px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 0 var(--radius);
  box-shadow: var(--shadow);
  z-index: 1050;
  min-width: 200px;
  padding: 8px 0;
}
.mobile-menu.visible { display: block; }
.mobile-menu a {
  display: block;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.mobile-menu a:hover { background: var(--bg); }

/* === FAB (mobile only) === */
.fab {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(212,81,59,0.4);
  cursor: pointer;
  z-index: 800;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}
.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.95); }
.fab.hidden { opacity: 0; transform: scale(0.8); pointer-events: none; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header { padding: 10px 16px; }
  .header-subtitle { display: none; }
  .header-actions { gap: 6px; }
  .btn { padding: 8px 12px; font-size: 12px; }
  .btn-icon { width: 34px; height: 34px; min-width: 34px; }

  /* Show mobile elements, hide desktop */
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .desktop-nav { display: none; }
  .fab { display: flex; }

  .panel {
    width: 100vw;
    height: auto;
    max-height: 65vh;
    top: auto;
    bottom: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  }
  .panel.open { transform: translateY(0); right: 0; }
  .panel-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 12px;
  }
  .panel-body { padding: 16px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .panel-overlay { background: transparent; pointer-events: none; }

  .filter-bar { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .filter-group { flex: 1 1 auto; min-width: 100px; }
  .filter-group input, .filter-group select { font-size: 13px; }

  .stats-bar {
    bottom: 12px; left: 12px; right: 12px;
    transform: none; padding: 8px 12px; gap: 8px;
    font-size: 11px; flex-wrap: wrap; justify-content: center; max-width: 100%;
  }

  .pick-hint { top: 60px; bottom: auto; left: 12px; right: 12px; transform: none; text-align: center; }
  .toast { left: 12px; right: 12px; transform: translateY(20px); text-align: center; bottom: 24px; }
  .toast.visible { transform: translateY(0); }

  .panel-close { width: 40px; height: 40px; font-size: 20px; }
  .form-group input, .form-group select, .form-group textarea { padding: 12px; font-size: 16px; }
}

@media (max-width: 360px) {
  .logo { font-size: 16px; }
  .btn { padding: 6px 10px; font-size: 11px; }
  .stats-bar { font-size: 10px; gap: 6px; }
}
