/* ===================== */
/*      Variables        */
/* ===================== */
:root {
  /* Couleurs principales */
  --primary-color: #4a90e2;
  --secondary-color: #50e3c2;
  --background-color: #ffffff;
  --text-color: #333333;

  /* Header et Navbar */
  --header-bg: #ffffff;
  --header-text: #000;
  --nav-bg: #ffffff;
  --nav-text: #333333;
  --link-hover: #0055aa;
  --border-color: #ccc;

  /* Branding (couleur utilisée pour la navbar et les boutons "Enregistrer") */
  --brand-color: #003366; 

  /* Container / Cards */
  --card-bg: #f7f7f7;

  /* Boutons (on force ici la couleur de fond à la couleur de marque) */
  --button-bg: var(--brand-color);
  --button-hover-bg: #1a2f4a;  /* Une teinte légèrement plus foncée */
  
  --transition: all 0.3s ease;
}

/* Mode Nuit (Dark Mode) */
body.dark-mode {
  --primary-color: #2c3e50;
  --secondary-color: #1abc9c;
  --background-color: #121212;
  --text-color: #e0e0e0;

  --header-bg: #000;
  --header-text: #fff;
  --nav-bg: #333;
  --nav-text: #f0f0f0;
  --link-hover: #ffcc00;
  --border-color: #666;
  --card-bg: #1e1e1e;

  --button-bg: var(--brand-color);
  --button-hover-bg: #1a2f4a;
}

/* ===================== */
/*      Base / Reset     */
/* ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}
img {
  max-width: 100%;
  display: block;
}

/* ===================== */
/*       Header          */
/* ===================== */
.site-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.logo-gouv {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-gouv img {
  height: 50px;
}
.logo-gouv .title {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}
.logo-gouv .title strong {
  font-size: 1rem;
}

/* Actions (sans barre de recherche) */
.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mode Toggle (jour/nuit) */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.toggle-icon {
  width: 20px;
  height: 20px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}
.slider:before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--brand-color);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* ===================== */
/*    Navbar Principale  */
/* ===================== */
.navbar-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background-color: var(--nav-bg);
}
.navbar-bottom ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.navbar-bottom a {
  text-decoration: none;
  color: var(--nav-text);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: var(--transition);
}
.navbar-bottom a:hover,
.navbar-bottom a.active {
  background-color: var(--brand-color);
  color: #fff;
  transform: translateY(-2px);
}

/* User Menu */
.user-menu {
  margin-left: auto;
  position: relative;
}
.user-icon {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.user-icon img {
  width: 24px;
  height: 24px;
}
.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 120%;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 120px;
  padding: 0.5rem;
  z-index: 999;
}
.user-dropdown a {
  color: var(--text-color);
  text-decoration: none;
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}
.user-dropdown a:hover {
  background-color: var(--border-color);
}
.user-menu.active .user-dropdown {
  display: block;
}

/* ===================== */
/*     Section Hero      */
/* ===================== */
.hero {
  position: relative;
  width: 100%;
  min-height: 60vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}
.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.hero-content p {
  font-size: 1.2rem;
}

/* ===================== */
/*   Main Container      */
/* ===================== */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ===================== */
/*  Forms & Inputs       */
/* ===================== */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
input, select, textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
}
label {
  font-weight: 600;
}

/* ===================== */
/*       Boutons         */
/* ===================== */
.button, button {
  padding: 0.75rem 1.5rem;
  background-color: var(--button-bg);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.button:hover, button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* ===================== */
/*        Footer         */
/* ===================== */
.site-footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--nav-bg);
  color: var(--nav-text);
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* ===================== */
/*        Tables         */
/* ===================== */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}
th {
  background-color: var(--primary-color);
  color: #fff;
}

/* ===================== */
/*    Responsive Layout  */
/* ===================== */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 1rem;
  }
  .navbar-bottom ul {
    flex-direction: column;
  }
  .container {
    margin: 1rem;
    padding: 1rem;
  }
  .hero {
    min-height: 40vh;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
}
