/* ============================================================
   MUSÉE DE L'AIR ET DE L'ESPACE — Plan Interactif
   style.css
   ============================================================ */

:root {
  --c-bg: #f4f5f7;
  --c-surface: #ffffff;
  --c-border: #e2e5ea;
  --c-text: #1a1d23;
  --c-text-muted: #6b7280;
  --c-primary: #e84c2b;
  --c-primary-dark: #c43820;
  --c-accent: #1a6fb5;
  --c-accent-2: #0e8a6e;
  --c-accent-3: #4a4a8a;
  --c-header: #0d1117;
  --c-hall-default: #dde3ed;
  --c-hall-hover: #c5cfe4;
  --c-hall-active: #b8c8e8;
  --c-hall-border: #8a9bbf;
  --c-hall-aviation: #d4e4f7;
  --c-hall-guerre: #dddaf5;
  --c-hall-espace: #cdf0e8;
  --c-hall-services: #f5f5f5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.16);
  --radius: 10px;
  --header-h: 62px;
  --sidebar-w: 260px;
  --detail-w: 320px;
  --toolbar-h: 54px;
  --font: 'Inter', sans-serif;
  --transition: .2s ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  overflow: hidden;
}

/* ── HEADER ─────────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--c-header);
  color: #fff;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 38px; height: 38px;
  background: var(--c-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.brand-main { display: block; font-weight: 600; font-size: 15px; }
.brand-sub  { display: block; font-size: 11px; color: rgba(255,255,255,.55); font-weight: 300; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.btn-ghost {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  padding: 7px 14px;
  border-radius: 7px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { background: rgba(255,255,255,.18); }

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--c-primary-dark); }

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
#map-container {
  display: flex;
  height: 100vh;
  padding-top: var(--header-h);
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 0;
}
.sidebar-section {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 4px;
}
.sidebar-section:last-child { border-bottom: none; }
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-text-muted);
  margin-bottom: 10px;
  padding-top: 12px;
  display: flex; align-items: center; gap: 6px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.filter-btn:hover { background: var(--c-bg); }
.filter-btn.active { background: #fef0ed; color: var(--c-primary); font-weight: 600; }
.filter-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.halls-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.hall-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  border: 1px solid transparent;
}
.hall-item:hover { background: var(--c-bg); border-color: var(--c-border); }
.hall-item.active { background: #fef0ed; border-color: #f5c4bb; color: var(--c-primary); font-weight: 600; }
.hall-item .hall-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hall-item .hall-num.no-num { background: var(--c-text-muted); }

.info-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.info-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--c-text-muted); }
.info-list li i { width: 14px; color: var(--c-primary); }

/* ── MAP WRAPPER ─────────────────────────────────────────── */
#map-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── TOOLBAR ─────────────────────────────────────────────── */
#map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--toolbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.toolbar-left { display: flex; align-items: center; gap: 4px; }
.toolbar-left button, #btn-zoom-reset {
  width: 34px; height: 34px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--c-text);
  transition: var(--transition);
}
.toolbar-left button:hover { background: var(--c-bg); border-color: #bbb; }
.toolbar-center { flex: 1; }
.search-wrap {
  display: flex; align-items: center;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.search-wrap i { color: var(--c-text-muted); font-size: 13px; }
.search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--c-text);
  outline: none;
  padding: 8px 0;
}
.search-wrap input::placeholder { color: var(--c-text-muted); }
#btn-search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--c-text-muted); font-size: 13px; padding: 2px;
}
#zoom-indicator {
  font-size: 12px; color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px; text-align: right;
}

/* ── SVG VIEWPORT ─────────────────────────────────────────── */
#svg-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  background:
    radial-gradient(circle at 60% 40%, rgba(26,111,181,.03) 0%, transparent 60%),
    var(--c-bg);
}
#svg-viewport:active { cursor: grabbing; }
#svg-pan-zoom {
  position: absolute;
  transform-origin: 0 0;
  user-select: none;
}

/* ── SVG MAP STYLES ──────────────────────────────────────── */
.hall-zone {
  transition: fill .18s ease, filter .18s ease;
  cursor: pointer;
}
.hall-zone:hover { filter: brightness(.94) drop-shadow(0 2px 6px rgba(0,0,0,.15)); }
.hall-zone.highlighted { stroke: var(--c-primary) !important; stroke-width: 2.5 !important; filter: brightness(.92); }
.hall-zone.dimmed { opacity: .35; }

.hall-label {
  pointer-events: none;
  user-select: none;
}
.hall-number-badge {
  cursor: pointer;
  transition: transform .15s ease;
}
.hall-number-badge:hover { transform: scale(1.2); }
.hall-number-badge circle { transition: fill .15s ease; }

.service-icon {
  cursor: pointer;
  transition: transform .15s ease;
}
.service-icon:hover { transform: scale(1.15); }

.aircraft-silhouette { pointer-events: none; }

/* ── DETAIL PANEL ─────────────────────────────────────────── */
.detail-panel {
  width: var(--detail-w);
  background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  overflow-y: auto;
  flex-shrink: 0;
  position: relative;
  transition: width .25s ease, opacity .25s ease;
}
.detail-panel.hidden { width: 0; opacity: 0; overflow: hidden; }
.close-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px;
  transition: var(--transition);
  z-index: 2;
}
.close-btn:hover { background: #fef0ed; border-color: var(--c-primary); color: var(--c-primary); }

#detail-content {
  padding: 20px;
}

.detail-hero {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.detail-hero-icon {
  font-size: 60px;
  opacity: .18;
}
.detail-category {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.cat-aviation  { background: #d4e4f7; color: #1a6fb5; }
.cat-guerre    { background: #dddaf5; color: #4a4a8a; }
.cat-espace    { background: #cdf0e8; color: #0e8a6e; }
.cat-services  { background: #f5f5f5; color: #555; }
.cat-incontournable { background: #fef0ed; color: var(--c-primary); }

.detail-title {
  font-size: 20px; font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}
.detail-subtitle {
  font-size: 13px; color: var(--c-text-muted);
  margin-bottom: 14px;
}
.detail-desc {
  font-size: 13.5px; line-height: 1.65;
  color: var(--c-text);
  margin-bottom: 18px;
}
.detail-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 18px;
}
.detail-tag {
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--c-bg);
  font-size: 12px;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}
.detail-section-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-text-muted);
  margin-bottom: 8px;
}
.detail-highlights {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 18px;
}
.detail-highlights li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--c-text);
}
.detail-highlights li i { color: var(--c-primary); margin-top: 2px; flex-shrink: 0; }

.detail-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 18px;
}
.meta-card {
  background: var(--c-bg);
  border-radius: 8px; padding: 10px 12px;
}
.meta-card .meta-label { font-size: 10px; text-transform: uppercase; letter-spacing:.05em; color: var(--c-text-muted); margin-bottom: 3px; }
.meta-card .meta-val   { font-size: 14px; font-weight: 600; }

.detail-cta {
  display: flex; flex-direction: column; gap: 8px;
}
.btn-detail-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--c-primary); color: #fff;
  border: none; border-radius: 8px;
  padding: 11px 16px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.btn-detail-primary:hover { background: var(--c-primary-dark); }
.btn-detail-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--c-bg); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font); font-size: 13px;
  cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.btn-detail-secondary:hover { background: #eee; }

/* ── LEGEND PANEL ─────────────────────────────────────────── */
.legend-panel {
  position: absolute;
  bottom: 20px; left: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  min-width: 200px;
  z-index: 50;
  transition: opacity .2s ease, transform .2s ease;
}
.legend-panel.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.legend-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.legend-header h4 { font-size: 13px; font-weight: 700; }
#btn-close-legend { background: none; border: none; cursor: pointer; color: var(--c-text-muted); font-size: 14px; }
.legend-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.legend-list li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.leg-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  border: 1px solid var(--c-border);
}
.leg-icon.red-cross { color: #e11d48; font-weight: 900; font-size: 16px; }
.leg-icon.orange-dot { color: var(--c-primary); font-size: 14px; }

/* ── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--c-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* ── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.18); }
}
.hall-number-badge.pulse circle {
  animation: pulse-badge .8s ease-in-out 3;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
#detail-content { animation: fade-in-up .25s ease; }

.detail-panel:not(.hidden) { animation: fade-in-up .25s ease; }

/* ── SCROLLBAR ─────────────────────────────────────────── */

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; --detail-w: 280px; }
  #sidebar { display: none; }
  .brand-sub { display: none; }
}
@media (max-width: 600px) {
  :root { --detail-w: 100vw; }
  .detail-panel { position: fixed; bottom: 0; left: 0; right: 0; width: 100vw !important; height: 60vh; border-radius: 16px 16px 0 0; z-index: 200; }
  .detail-panel.hidden { height: 0; }
  .header-actions .btn-ghost { display: none; }
}
