@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,200;0,300;0,400;0,500;0,600;1,300&display=swap');

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

:root {
  --black: #000;
  --surface: #111;
  --surface2: #1a1a1a;
  --border: rgba(255,255,255,0.08);
  --text: #f5f5f7;
  --muted: rgba(255,255,255,0.4);
  --hint: rgba(255,255,255,0.2);
  --blue: #0071e3;
  --red: #E24B4A;
  --orange: #EF9F27;
  --green: #1D9E75;
  --teal: #378ADD;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 52px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border);
}
.nav-logo { font-size: 14px; font-weight: 600; letter-spacing: -0.3px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
  font-weight: 400;
}
.nav-link:hover, .nav-link.active { color: var(--text); }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px 72px;
  overflow: hidden;
  background: var(--black);
}
.hero-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(0,113,227,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-title {
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -3px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 18px;
}
.hero-title em {
  font-style: italic;
  font-weight: 200;
  color: var(--muted);
}
.hero-sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: -0.3px;
  line-height: 1.6;
  margin: 0 auto 32px;
  max-width: 420px;
}
.hero-cta { display: flex; gap: 16px; align-items: center; justify-content: center; }
.btn-prim {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.2px;
  font-family: 'Inter', sans-serif;
  transition: opacity .15s;
}
.btn-prim:hover { opacity: .85; }
.btn-sec {
  color: var(--blue);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: -0.2px;
}
.btn-sec::after { content: ' →'; }

/* ── STATS BAND ── */
.stats-band {
  display: flex;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.stat {
  flex: 1;
  text-align: center;
  padding: 22px 16px;
  border-right: 0.5px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-num { font-size: 30px; font-weight: 600; letter-spacing: -1px; color: var(--text); }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 400; }

/* ── FILTERS ── */
.filters {
  padding: 14px 40px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 0.5px solid var(--border);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 52px;
  z-index: 90;
}
.pill {
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background .15s, color .15s;
}
.pill:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.pill.on { background: var(--text); color: var(--black); border-color: var(--text); }
.pill-sel {
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
}
.pill-sel:focus { border-color: rgba(255,255,255,0.3); }
.filter-search input {
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  outline: none;
  width: 180px;
  transition: border-color .15s;
}
.filter-search input::placeholder { color: var(--muted); }
.filter-search input:focus { border-color: rgba(255,255,255,0.3); }

/* ── GALLERY ── */
.count-bar {
  padding: 16px 40px 8px;
  font-size: 11px;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.05);
  margin: 0 0 1px;
}
.photo-card {
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition: opacity .2s;
}
.photo-card:hover { opacity: .8; }
.photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}
.card-body { padding: 12px 16px 16px; }
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.tag-trottoir       { background: rgba(226,75,74,0.15); color: #f4807f; }
.tag-passage_pieton { background: rgba(239,159,39,0.15); color: #f0b85a; }
.tag-piste_cyclable { background: rgba(29,158,117,0.15); color: #4dcba0; }
.tag-double_file    { background: rgba(55,138,221,0.15); color: #6fb0f0; }
.tag-autre          { background: rgba(255,255,255,0.07); color: var(--muted); }
.card-ville { font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: -0.2px; }
.card-rue { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-date { font-size: 11px; color: var(--hint); margin-top: 5px; }

/* ── STATES ── */
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--muted); font-size: 14px; }
.loading { display: flex; justify-content: center; padding: 5rem; }
.spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  cursor: pointer;
}
.lightbox-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2.5rem;
  max-width: 860px;
  width: 100%;
  align-items: flex-start;
}
.lightbox-inner img {
  width: 58%;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--surface2);
}
.lb-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-info { flex: 1; padding-top: 4px; }
.lb-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 99px; margin-bottom: 12px; }
.lb-info h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.8px; color: var(--text); margin-bottom: 6px; }
.lb-info p { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ── MAP ── */
.map-page {
  display: flex;
  height: calc(100vh - 52px);
}
.map-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
}
.sidebar-section { padding: 0 20px 20px; border-bottom: 0.5px solid var(--border); margin-bottom: 20px; }
.sidebar-section:last-child { border-bottom: none; }
.sidebar-title { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 14px; }
.hotspot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: opacity .15s;
}
.hotspot-row:hover { opacity: .7; }
.hotspot-row:last-child { border-bottom: none; }
.hs-left { display: flex; align-items: center; gap: 10px; }
.hs-rank { font-size: 11px; font-weight: 600; color: var(--hint); width: 14px; }
.hs-info strong { font-size: 12px; font-weight: 500; color: var(--text); display: block; letter-spacing: -0.2px; }
.hs-info span { font-size: 11px; color: var(--muted); }
.hs-count { font-size: 13px; font-weight: 600; color: #f4807f; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
  cursor: pointer;
}
.recent-row:last-child { border-bottom: none; }
.recent-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.recent-info { flex: 1; }
.recent-info strong { font-size: 12px; font-weight: 500; color: var(--text); display: block; }
.recent-info span { font-size: 11px; color: var(--muted); }
.recent-time { font-size: 10px; color: var(--hint); white-space: nowrap; }
#map { flex: 1; }
.leaflet-container { background: #0a0f1a !important; }

/* ── STATS PAGE ── */
.stats-page { max-width: 900px; margin: 0 auto; padding: 3rem 40px; }
.stats-hero { margin-bottom: 2.5rem; }
.page-title { font-size: 40px; font-weight: 600; letter-spacing: -1.5px; color: var(--text); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2.5rem; }
.stat-card { background: var(--surface); padding: 20px 24px; }
.stat-card-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-card-num { font-size: 32px; font-weight: 600; letter-spacing: -1px; color: var(--text); }
.chart-section { margin-bottom: 2rem; }
.chart-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 14px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { font-size: 12px; color: var(--text); width: 130px; flex-shrink: 0; }
.bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.bar-val { font-size: 12px; color: var(--muted); width: 30px; text-align: right; }

/* ── ADMIN ── */
.site-header { background: var(--surface); padding: 0 40px; height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 0.5px solid var(--border); }
.site-header .nav-logo { font-size: 14px; font-weight: 600; }
.btn-admin { background: transparent; border: 0.5px solid var(--border); color: var(--text); padding: 6px 14px; border-radius: 99px; font-size: 12px; text-decoration: none; font-family: 'Inter', sans-serif; transition: background .15s; }
.btn-admin:hover { background: rgba(255,255,255,0.06); }
.admin-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 40px; }
.admin-section { background: var(--surface); border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 1.25rem; border: 0.5px solid var(--border); }
.admin-section h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; color: var(--text); margin-bottom: 1.25rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.form-group label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 500; }
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue); }
.drop-zone {
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-size: 13px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--blue); background: rgba(0,113,227,0.04); color: var(--text); }
.drop-zone input[type="file"] { display: none; }
.drop-zone .drop-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.preview-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); margin-top: 1rem; display: none; }
.btn-submit {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
  transition: opacity .15s;
}
.btn-submit:hover { opacity: .85; }
.btn-submit:disabled { opacity: .35; cursor: not-allowed; }
.msg { font-size: 12px; margin-top: 0.75rem; padding: 8px 12px; border-radius: var(--radius); }
.msg-ok { background: rgba(29,158,117,0.12); color: #4dcba0; }
.msg-err { background: rgba(226,75,74,0.12); color: #f4807f; }
.admin-photo-list { display: flex; flex-direction: column; gap: 8px; }
.admin-photo-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.03); border-radius: var(--radius); padding: 10px 12px; border: 0.5px solid var(--border); }
.admin-photo-item img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; background: var(--surface2); }
.admin-photo-info { flex: 1; }
.admin-photo-info strong { font-size: 12px; color: var(--text); display: block; }
.admin-photo-info span { font-size: 11px; color: var(--muted); }
.btn-delete { background: transparent; border: 0.5px solid rgba(226,75,74,0.4); color: #f4807f; padding: 5px 12px; border-radius: 99px; font-size: 11px; cursor: pointer; font-family: 'Inter', sans-serif; transition: background .15s; }
.btn-delete:hover { background: rgba(226,75,74,0.12); }
.login-box { max-width: 380px; margin: 6rem auto; background: var(--surface); border-radius: var(--radius-lg); padding: 2.5rem; border: 0.5px solid var(--border); }
.login-box h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 1.5rem; }

@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .hero { padding: 60px 24px 52px; }
  .hero-title { font-size: 42px; letter-spacing: -2px; }
  .stats-band { flex-wrap: wrap; }
  .stat { min-width: 50%; }
  .filters { padding: 12px 20px; }
  .count-bar { padding: 12px 20px 6px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .lightbox-inner { flex-direction: column; }
  .lightbox-inner img { width: 100%; }
  .map-page { flex-direction: column; }
  .map-sidebar { width: 100%; height: 200px; overflow-x: auto; }
  #map { height: calc(100vh - 400px); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-wrap { padding: 1.5rem 20px; }
}
