/* global.css - styles généraux (chargés par Django) */

/* Variables */
:root {
  --container: 1200px;
  --header-h: 64px;
  --footer-h: 56px;
  --primary: #0055A4;
  --primary-strong: #0A4D98;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #111827;
}

/* Reset */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);

  /* Fallback couleur */
  background: var(--bg);

  /* Fond personnalisé */
  background-image: url("/public/images/bg.png");
  background-size: cover;         
  background-position: center;    
  background-repeat: no-repeat;   
  background-attachment: fixed;   
  position: relative;             
}

/* Overlay semi-transparent dégradé sur le fond */
html::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(0,0,0,0.55),   /* sombre en haut */
    rgba(0,0,0,0.35) 40%,
    rgba(0,0,0,0.15) 70%,
    rgba(0,0,0,0) 100% /* transparent en bas */
  );
  pointer-events: none;
  z-index: 0;
}

/* Layout root: réserve l’espace pour header/footer */
.site-root {
  min-height: 100vh;
  padding-top: var(--header-h);
  padding-bottom: var(--footer-h);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  z-index: 1; /* au-dessus de l’overlay */
}

/* Header (fixed full width) */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  z-index: 1200;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
}
.site-header__inner { width: 100%; max-width: var(--container); margin:0 auto; padding: 0 16px; display:flex; align-items:center; gap:12px; }
.site-title { margin:0; font-size:1.05rem; font-weight:600; }

/* Mobile toggle */
.mobile-toggle { margin-left:auto; background:transparent; border:0; color:inherit; font-size:1.25rem; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }

/* Mobile nav */
.mobile-nav {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--primary-strong);
  z-index: 1150;
  display: none;
}
.mobile-nav.open { display: block; }
.mobile-nav ul { display:flex; gap: 12px; justify-content:center; align-items:center; padding:12px; margin:0; list-style:none; }
.mobile-nav a { color:white; text-decoration:none; padding:8px 12px; border-radius:6px; }
.mobile-nav a:hover { background: rgba(255,255,255,0.06); }

/* Main wrapper */
.site-main-wrapper {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 16px;
  height: calc(100vh - var(--header-h) - var(--footer-h));
  display: flex;
  gap: 16px;
  box-sizing: border-box;
  overflow: hidden; 
}

/* Sidebar (desktop only) */
.site-sidebar {
  display: none;
  width: 260px;
  flex-shrink: 0;
  background: var(--primary-strong);
  color: white;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  overflow: visible;
  align-self: stretch;
  position: relative;
}
.site-sidebar nav { height:100%; display:flex; flex-direction:column; gap:12px; justify-content:flex-start; }
.site-sidebar ul { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.site-sidebar a { color:white; text-decoration:none; padding:8px 10px; border-radius:6px; display:block; }
.site-sidebar a:hover { background: rgba(255,255,255,0.06); }

/* Content (scrollable) */
.site-content {
  flex: 1 1 auto;
  overflow: auto;
  align-self: stretch;
  -webkit-overflow-scrolling: touch;
}

/* Panneau principal 
#content {
  background: rgba(255,255,255,0.85); /* semi-transp 
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.06);
  min-height: 100%;
  box-sizing: border-box;
}*/
/* Variante "glassmorphism" pour le panneau principal */
#content {
  background: rgba(255, 255, 255, 0.8); /* blanc semi-transparent */
  backdrop-filter: blur(8px);          /* flou de l’arrière-plan */
  -webkit-backdrop-filter: blur(8px);  /* support Safari */
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
  min-height: 100%;
  box-sizing: border-box;
}


/* Footer */
#site-footer {
  position: fixed;
  bottom:0; left:0; right:0;
  height: var(--footer-h);
  background:#1E2A38;
  color:white;
  display:flex; align-items:center; justify-content:center;
  z-index:1100;
  box-shadow:0 -3px 8px rgba(0,0,0,0.06);
}

/* Zone d'alertes */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  animation: fadeIn 0.3s ease-in-out;
  border: 1px solid transparent;
}
.alert-success { background-color: #d1fae5; color: #065f46; border-color: #10b981; }
.alert-error   { background-color: #fee2e2; color: #991b1b; border-color: #ef4444; }
.alert-warning { background-color: #fef3c7; color: #92400e; border-color: #f59e0b; }
.alert-info    { background-color: #e0f2fe; color: #075985; border-color: #3b82f6; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (min-width:1024px) {
  .mobile-toggle { display:none; }
  .mobile-nav { display:none !important; }
  .site-sidebar { display:block; }
  .site-main-wrapper { max-width: var(--container); }
}
@media (max-width:1023px) {
  .site-sidebar { display:none; }
  .site-main-wrapper { max-width:100%; padding:12px; }
  #content { min-height: calc(100vh - var(--header-h) - var(--footer-h) - 24px); }
}
body.mobile-open .site-sidebar { display:none !important; }
body.mobile-open .site-main-wrapper { pointer-events: none; }
body.mobile-open #content { pointer-events: none; }
