/* =====================================================
   ANNUAIRE CARTOGRAPHIQUE EFH — RESONANTIA DESIGN
   ===================================================== */

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

/* ── Variables & Reset ────────────────────────── */
:root {
  --efh-deep:      #050A30;
  --efh-purple:    #050A30;
  --efh-mid:       #050A30;
  --efh-accent:    #050A30;
  --efh-light:     white;
  --efh-pale:      white;
  --efh-gold:      #c9a84c;
  --efh-gold-lt:   #f0e2b0;

  --sidebar-w:     340px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;

  --text-on-dark:  #f5f0ff;
  --text-muted:    rgba(245,240,255,0.6);
  --border-subtle: rgba(255,255,255,0.08);
  --border-light:  rgba(255,255,255,0.15);

  --transition:    0.2s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Roboto', sans-serif;
  background: var(--efh-deep);
  color: var(--text-on-dark);
  overflow: hidden;
}

/* ── Layout ───────────────────────────────────── */
.app-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(170deg, var(--efh-deep) 0%, #050A30 100%);
  border-right: 1px solid var(--border-subtle);
  z-index: 1000;
  flex-shrink: 0;
  overflow: hidden;
}

/* Header */
.sidebar-header {
  padding: 28px 24px 22px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.sidebar-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(5, 10, 48, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-header h1 {
  font-family: 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.sidebar-header p {
  font-size: 12px;
  font-weight: 400;
  color: var(--efh-light);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Gold accent line */
.sidebar-header::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: var(--efh-gold);
  border-radius: 2px;
  margin-top: 12px;
}

/* Sidebar scroll content */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--efh-deep) transparent;
}

.sidebar-content::-webkit-scrollbar { width: 4px; }
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--efh-deep);
  border-radius: 2px;
}

/* ── Sidebar sections ─────────────────────────── */
.filter-group,
.search-group,
.directory-group {
  padding: 18px 20px 0;
}

.filter-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: white;
  opacity: 0.7;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Category checkboxes ──────────────────────── */
#categories-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.category-item:hover {
  background: rgba(5, 10, 48, 0.15);
  border-color: rgba(5, 10, 48, 0.35);
}

.category-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}

.category-item input[type="checkbox"]:checked {
  background: var(--efh-accent);
  border-color: var(--efh-accent);
}

.category-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-left: none;
  border-top: none;
  transform: rotate(45deg);
}

.category-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-on-dark);
  flex: 1;
  letter-spacing: 0.2px;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* ── Search ───────────────────────────────────── */
.search-group {
  padding-top: 18px;
  padding-bottom: 4px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

#map-search {
  width: 100%;
  padding: 10px 40px 10px 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-on-dark);
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: background var(--transition), border-color var(--transition);
}

#map-search::placeholder { color: var(--text-muted); }

#map-search:focus {
  background: rgba(5, 10, 48, 0.15);
  border-color: rgba(5, 10, 48, 0.5);
  box-shadow: 0 0 0 3px rgba(5, 10, 48, 0.12);
}

/* Search spinner */
.search-spinner {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--efh-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Directory list ───────────────────────────── */
.directory-group {
  padding-top: 18px;
  flex: 1;
}

#directory-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.tag-group-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}

.tag-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: white;
  padding: 9px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 0;
}

.tag-list-content {
  display: flex;
  flex-direction: column;
}

.contact-link-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  cursor: pointer;
  border-top: 1px solid var(--border-subtle);
  transition: background var(--transition);
  gap: 2px;
}

.contact-link-item:hover {
  background: rgba(5, 10, 48, 0.15);
}

.contact-link-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-on-dark);
  line-height: 1.3;
}

.contact-link-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.3px;
}

.contact-link-item.hidden-search {
  display: none;
}

/* ── App loader ───────────────────────────────── */
.app-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.3px;
}

.app-loader.hidden { display: none; }

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(5, 10, 48, 0.2);
  border-top-color: var(--efh-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Map ──────────────────────────────────────── */
#map {
  flex: 1;
  height: 100%;
  z-index: 1;
  position: relative;
}

#map::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(5, 10, 48, 0.25);
  pointer-events: none;
  z-index: 400;
}

/* ── Markers ──────────────────────────────────── */
.custom-pin-container {
  background: transparent !important;
  border: none !important;
}

.marker-eye {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.marker-eye:hover {
  transform: scale(1.12);
  box-shadow: 0 5px 16px rgba(0,0,0,0.32);
}

/* ════════════════════════════════════════════════
   ANNUAIRE EFH — THÈME #050A30
   ════════════════════════════════════════════════ */

:root {
  --efh-deep:      #050A30;
  --efh-purple:    #050A30;
  --efh-mid:       #050A30;
  --efh-accent:    #050A30;
  --efh-light:     #c4b5fd;
  --efh-glow:      rgba(5, 10, 48, 0.22);
  --border-subtle: rgba(5, 10, 48, 0.28);
  --radius-lg:     16px;
  --radius-md:     10px;
  --radius-sm:     8px;
  --transition:    0.18s ease;
}

/* ── POPUP LEAFLET (wrapper) ──────────────────── */
.leaflet-popup-content-wrapper {
  background: linear-gradient(145deg, #050A30 60%, #050A30 100%) !important;
  border: 1px solid rgba(5, 10, 48, 0.4) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(5, 10, 48, 0.10) inset !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content-wrapper::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #050A30, #050A30, #050A30);
  background-size: 200% 100%;
  animation: efh-shimmer 3s linear infinite;
}

@keyframes efh-shimmer {
  0%   { background-position: 0% }
  100% { background-position: 200% }
}

.leaflet-popup-tip-container,
.leaflet-popup-tip { display: none; }

.leaflet-popup-content {
  margin: 0 !important;
  min-width: 230px;
  max-width: 290px;
}

/* ── CONTENU POPUP ────────────────────────────── */
.popup-info {
  padding: 16px 18px 18px;
  font-family: 'Roboto', sans-serif;
}

.popup-info h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
  line-height: 1.3;
  padding-right: 18px;
}

.popup-pratique {
  font-size: 12.5px;
  color: white;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 3px;
}

.popup-spec {
  font-size: 11.5px;
  color: white;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  margin-bottom: 4px;
}

.popup-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.918);
  margin: 10px 0;
}

.popup-address {
  font-size: 12px;
  color: white;
  margin-bottom: 5px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.45;
}

.popup-contact {
  font-size: 12px;
  color: white;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.popup-contact a {
  color: #ffffff;
  text-decoration: none;
  transition: color var(--transition);
}
.popup-contact a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

/* ── BOUTONS POPUP ────────────────────────────── */
.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.popup-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--efh-accent);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(5, 10, 48, 0.35);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.popup-btn:hover {
  background: #050A30;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5, 10, 48, 0.5);
}

.popup-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(5, 10, 48, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(5, 10, 48, 0.45);
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.popup-btn-outline:hover {
  background: rgba(5, 10, 48, 0.25);
  border-color: white;
  transform: translateY(-1px);
}

/* ── BOUTON FERMER ────────────────────────────── */
.leaflet-popup-close-button {
  color: rgba(255, 255, 255, 0.3) !important;
  font-size: 18px !important;
  top: 10px !important;
  right: 12px !important;
  padding: 0 !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color var(--transition), background var(--transition);
}
.leaflet-popup-close-button:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ── MARQUEURS ────────────────────────────────── */
.custom-pin-container {
  background: transparent !important;
  border: none !important;
}

/* ── SIDEBAR — GROUPES DE TAGS ────────────────── */
.tag-group-container {
  margin-bottom: 10px;
}

.tag-group-title {
  font-size: 10.5px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 0 3px 10px;
  margin-bottom: 4px;
}

/* ── SIDEBAR — ITEMS DE CONTACT ───────────────── */
.contact-link-item {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 1px;
}
.contact-link-item:hover {
  background: rgba(5, 10, 48, 0.15);
}

.contact-link-name {
  font-size: 12.5px;
  color: #e9e0ff;
  font-weight: 500;
}
.contact-link-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.699);
  margin-top: 1px;
}

/* ── CONTRÔLES ZOOM LEAFLET ───────────────────── */
.leaflet-control-zoom {
  border: none !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-control-zoom a {
  background: rgba(5, 10, 48, 0.95) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  border: none !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  font-size: 16px !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  transition: background var(--transition), color var(--transition);
}
.leaflet-control-zoom a:hover {
  background: var(--efh-accent) !important;
  color: #fff !important;
}
.leaflet-control-zoom-in {
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* ── DIVERS ───────────────────────────────────── */
#loader { display: none !important; }

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 680px) {
  :root { --sidebar-w: 100vw; }

  .app-wrapper {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: 42vh;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  #map { height: 58vh; }
}

/* ── Icônes SVG inline dans le popup ── */
.popup-ico {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.popup-address,
.popup-contact {
  color: white;
}

.popup-address .popup-ico svg,
.popup-contact .popup-ico svg {
  stroke: #ffffff;
}

.popup-btn .popup-ico svg {
  stroke: #ffffff;
}

.popup-btn-outline .popup-ico svg {
  stroke: #c4b5fd;
}