/* ============================================================
   G2AP — VISITE VIRTUELLE INTERACTIVE
   style.css — Styles modernes, responsive, CSS Variables
   ============================================================ */

/* ── Variables CSS ── */
:root {
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-dark: #8a6a20;
  --dark: #0e0d0b;
  --dark-2: #1a1812;
  --dark-3: #252218;
  --dark-4: #2e2b1e;
  --panel-bg: rgba(14, 13, 11, 0.92);
  --panel-border: rgba(201, 168, 76, 0.25);
  --text-primary: #f0ead6;
  --text-secondary: #b0a880;
  --text-muted: #6a6450;
  --accent: #c9a84c;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 20px rgba(201, 168, 76, 0.15);
  --sidebar-width: 320px;
  --header-height: 70px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Playfair Display', 'Georgia', serif;
  background: var(--dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── ÉCRAN D'ACCUEIL ── */
#welcome-screen {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#welcome-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-bg {
  position: absolute; inset: 0;
  background-image: url('WhatsApp Image 2026-06-20 at 17.25.34.jpeg');
  background-size: cover;
  background-position: center;
  filter: brightness(0.25) saturate(0.6);
}

.welcome-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14,13,11,0.3) 0%,
    rgba(14,13,11,0.7) 50%,
    rgba(14,13,11,0.95) 100%
  );
}

.welcome-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 700px;
}

.welcome-logo {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 60px rgba(201,168,76,0.4);
  margin-bottom: 0.3rem;
}

.welcome-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1.2rem auto;
}

.welcome-subtitle {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  margin-bottom: 0.8rem;
}

.welcome-description {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  color: var(--text-muted);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  margin-top: 0.3rem;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: var(--dark);
  border: none;
  border-radius: var(--radius-lg);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 30px rgba(201,168,76,0.35);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(201,168,76,0.55);
}

.btn-start svg { width: 18px; height: 18px; }

/* ── LAYOUT PRINCIPAL ── */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-columns: 1fr;
  transition: opacity 0.5s ease;
}

/* ── HEADER ── */
#header {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(180deg, rgba(14,13,11,0.98) 0%, rgba(14,13,11,0.85) 100%);
  border-bottom: 1px solid var(--panel-border);
  z-index: 100;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.header-separator {
  width: 1px;
  height: 22px;
  background: var(--panel-border);
}

.header-title {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-space-name {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.icon-btn:hover, .icon-btn.active {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold);
  color: var(--gold);
}

.icon-btn svg { width: 16px; height: 16px; }

/* ── ZONE PRINCIPALE ── */
#main {
  grid-row: 2;
  position: relative;
  display: flex;
  overflow: hidden;
}

/* ── VIEWER ── */
#viewer {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

/* ── GALERIE PHOTO ── */
#photo-stage {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-slide {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-slide.active { opacity: 1; }

.photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── OVERLAY INFO VUE ── */
.view-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3rem 2rem 1.5rem;
  background: linear-gradient(0deg, rgba(14,13,11,0.88) 0%, transparent 100%);
  pointer-events: none;
  transition: opacity var(--transition);
}

.view-category {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.view-title {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.view-description {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 550px;
  line-height: 1.6;
}

/* ── CONTRÔLES NAVIGATION ── */
.nav-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10;
}

.nav-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-btn:hover {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold);
  color: var(--gold);
  transform: scale(1.05);
}

.nav-btn svg { width: 18px; height: 18px; }

/* ── INDICATEUR PHOTOS ── */
.photo-indicators {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.photo-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: var(--transition);
}

.photo-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

/* ── BOUTONS PREV/NEXT PHOTO ── */
.photo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  opacity: 0.7;
}

.photo-arrow:hover { opacity: 1; border-color: var(--gold); color: var(--gold); }
.photo-arrow.prev { left: 1rem; }
.photo-arrow.next { right: 5rem; }
.photo-arrow svg { width: 18px; height: 18px; }

/* ── COMPTEUR PHOTOS ── */
.photo-counter {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.photo-counter span { color: var(--gold); font-weight: 600; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  z-index: 50;
  overflow: hidden;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#sidebar.collapsed {
  transform: translateX(var(--sidebar-width));
  position: absolute;
  right: 0;
  top: 0; bottom: 0;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  margin-bottom: 0.75rem;
}

/* ── MINI-CARTE ── */
#minimap {
  position: relative;
  background: var(--dark-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  overflow: hidden;
  height: 160px;
  margin-bottom: 0;
}

.minimap-svg {
  width: 100%;
  height: 100%;
}

/* ── LISTE DES ESPACES ── */
.sidebar-spaces {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-border) transparent;
}

.sidebar-spaces::-webkit-scrollbar { width: 4px; }
.sidebar-spaces::-webkit-scrollbar-track { background: transparent; }
.sidebar-spaces::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 4px; }

.category-group {
  margin-bottom: 1rem;
}

.category-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--panel-border);
}

.space-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.space-item:hover {
  background: rgba(201,168,76,0.07);
  border-color: var(--panel-border);
}

.space-item.active {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.35);
}

.space-thumb {
  width: 46px; height: 34px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--dark-3);
}

.space-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.space-item:hover .space-thumb img { transform: scale(1.08); }

.space-info { flex: 1; min-width: 0; }

.space-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.space-item.active .space-name { color: var(--gold); }

.space-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.space-indicator {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--panel-border);
  flex-shrink: 0;
}

.space-item.active .space-indicator { background: var(--gold); }

/* ── CONNEXIONS (HOTSPOTS) ── */
#connections-panel {
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.connections-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.connections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.connection-chip {
  padding: 0.3rem 0.7rem;
  background: var(--dark-3);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.connection-chip:hover {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── HOTSPOTS SUR L'IMAGE ── */
#hotspots-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: all;
  cursor: pointer;
}

.hotspot-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.6);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  animation: pulse-ring 2.5s ease infinite;
  background: rgba(201,168,76,0.1);
  backdrop-filter: blur(4px);
}

.hotspot:hover .hotspot-ring {
  background: rgba(201,168,76,0.3);
  border-color: var(--gold);
  transform: scale(1.15);
}

.hotspot-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.hotspot-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(10px);
}

.hotspot:hover .hotspot-label { opacity: 1; }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(201,168,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
}

/* ── BREADCRUMB ── */
#breadcrumb {
  position: absolute;
  top: 1rem; left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 10;
}

.breadcrumb-item {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.breadcrumb-item:hover { color: var(--gold); }

.breadcrumb-sep {
  color: var(--panel-border);
  font-size: 0.7rem;
}

.breadcrumb-current {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--gold);
}

/* ── MODAL PLEIN ÉCRAN ── */
#fullscreen-modal {
  position: fixed; inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.95);
  display: none;
  align-items: center;
  justify-content: center;
}

#fullscreen-modal.open { display: flex; }

.fullscreen-img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.fullscreen-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.fullscreen-close:hover { border-color: var(--gold); color: var(--gold); }

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--text-primary);
  backdrop-filter: blur(20px);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.5s forwards;
  white-space: nowrap;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ── LOADER ── */
#loader {
  position: fixed; inset: 0;
  z-index: 800;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-logo {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.25em;
}

.loader-bar {
  width: 200px; height: 2px;
  background: var(--dark-3);
  border-radius: 2px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 2px;
  animation: loader-fill 1.5s ease forwards;
}

@keyframes loader-fill {
  from { width: 0; }
  to   { width: 100%; }
}

.loader-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100vw;
    --header-height: 56px;
  }

  #sidebar {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    width: 100%;
    transform: translateX(100%);
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .welcome-stats { gap: 1.2rem; }
  .stat-number { font-size: 1.4rem; }

  .photo-arrow.next { right: 1rem; }

  .view-overlay { padding: 2rem 1rem 1rem; }

  .nav-controls {
    flex-direction: row;
    bottom: 5rem;
    right: 1rem;
  }

  .header-title { display: none; }
  .header-separator { display: none; }
}

@media (max-width: 480px) {
  .welcome-logo { font-size: 3rem; }
  .welcome-stats { flex-wrap: wrap; gap: 1rem; }
}

/* ── TRANSITIONS DE SCÈNE ── */
.scene-transition {
  animation: fade-scene 0.5s ease;
}

@keyframes fade-scene {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── SCROLLBAR GLOBALE ── */
* { scrollbar-width: thin; scrollbar-color: var(--panel-border) transparent; }
