/* ============================================================
   layout.css — Mise en page principale
   Topbar, sidebar gauche, zone principale, sidebar droite.
   Ce fichier gère la structure des pages, pas les composants.
   ============================================================ */

/* ===========================================
   TOPBAR — Barre de navigation fixe en haut
   =========================================== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(6, 14, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;  /* Au-dessus de tout sauf les modales */
}

/* ===========================================
   SIDEBAR GAUCHE — Navigation principale
   Fixe, pleine hauteur, cachée sur mobile
   =========================================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: 240px;
  background: rgba(6, 14, 32, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 80px 12px 24px; /* 80px pour passer sous la topbar */
  display: flex;
  flex-direction: column;
  z-index: 50;
   transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Item de navigation de la sidebar --- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(222, 229, 255, 0.5);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--on-surface);
}

.nav-item.active {
  background: rgba(163, 166, 255, 0.12);
  color: var(--primary);
  box-shadow: 0 0 20px rgba(163, 166, 255, 0.1);
}

.menu-btn { display: none; }

.sidebar-overlay-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}




/* ===========================================
   LAYOUT PRINCIPAL — Wrapper du contenu
   Pousse le contenu hors de la sidebar gauche
   =========================================== */
.main-layout {
  margin-left: 240px;  /* Largeur de la sidebar */
  padding-top: 64px;   /* Hauteur de la topbar */
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  position: relative;
  z-index: 2;          /* Au-dessus du fond (stars, blobs) */
}

/* ===========================================
   SIDEBAR DROITE — Widgets contextuels
   Sticky, visible uniquement sur grand écran
   =========================================== */
.right-sidebar {
  width: 280px;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
}

.right-sidebar > [data-include] {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 100%;
}



/* ===========================================
   RESPONSIVE
   =========================================== */

/* Tablette : masquer la sidebar droite */
@media (max-width: 1024px) {
  .right-sidebar { display: none; }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .main-layout   { margin-left: 0; }
  .menu-btn      { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay-backdrop { display: block; }
  body.sidebar-open .sidebar-overlay-backdrop {
    opacity: 1;
    pointer-events: all;
  }
}