:root {
  /* --- PALETTE "BLUE SKY & SNOW" --- */
  --bg-color: #1e293b; 
  --menu-bg: #0f172a;
  --menu-text: #f8fafc;
  --accent-color: #3b82f6; 
  --hover-color: #60a5fa;
  --separator: rgba(255,255,255,0.1);
  --brand-red: #ef4444; 
}

body {
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-color);
  margin: 0; padding: 0;
  overflow: hidden; height: 100vh; display: flex; flex-direction: column;
}

/* --- NAVIGATION --- */
nav {
  background-color: var(--menu-bg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  height: 100px; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  position: relative;
  z-index: 1000;
}

/* --- LOGO --- */
.brand-wrapper-absolute {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100;
    display: block;
    text-decoration: none;
}

.brand-image {
    height: 90px; 
    width: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    transition: transform 0.2s;
    border: 2px solid rgba(255,255,255,0.1);
}

.brand-wrapper-absolute:hover .brand-image {
    transform: scale(1.03);
    border-color: var(--accent-color);
}

/* --- MENU ITEMS --- */
ul.main-menu {
  list-style: none; margin: 0; padding: 0; display: flex; height: 100%;
  /* On laisse la place pour le logo */
  margin-left: auto; margin-right: auto;
  flex-wrap: wrap; /* Sécurité si l'écran est petit */
  justify-content: center;
  align-content: center;
}

li.menu-item {
  position: relative; height: 100%; display: flex; align-items: center;
}

li.menu-item > a {
  text-decoration: none; color: var(--menu-text); 
  /* Marges ajustées pour tout faire tenir */
  padding: 0 8px;
  font-weight: 600; text-transform: uppercase; 
  /* Taille de police optimisée pour 10 items */
  font-size: 0.75rem; 
  letter-spacing: 0.5px; height: 100%; display: flex; align-items: center;
  transition: background 0.3s, color 0.3s; gap: 5px;
  white-space: nowrap; /* Empêche le texte de se couper */
}

li.menu-item > a i { color: #94a3b8; font-size: 1.1em; transition: color 0.3s; }

li.menu-item:hover > a { background-color: var(--accent-color); color: #fff; }
li.menu-item:hover > a i { color: #fff; }

/* --- SOUS-MENUS --- */
ul.submenu {
  display: none; position: absolute; top: 100px;
  left: 0; background-color: var(--menu-bg); list-style: none; padding: 0;
  min-width: 200px; box-shadow: 0 8px 16px rgba(0,0,0,0.6);
  border-top: 4px solid var(--brand-red); 
  z-index: 1001;
}

/* Les 4 derniers menus s'alignent à droite pour éviter le débordement */
li.menu-item:nth-last-child(-n+4) ul.submenu { left: auto; right: 0; }

li.menu-item:hover ul.submenu { display: block; }
ul.submenu li a {
  display: block; padding: 12px 15px; color: var(--menu-text);
  text-decoration: none; font-size: 0.85rem; border-bottom: 1px solid var(--separator);
  transition: background 0.2s, padding-left 0.2s;
}
ul.submenu li a:hover { background-color: var(--hover-color); padding-left: 20px; }

.submenu-section-title {
  padding: 8px 15px; font-size: 0.7rem; color: #94a3b8;
  text-transform: uppercase; font-weight: bold; background: rgba(0,0,0,0.3);
  letter-spacing: 1px; cursor: default;
}

.content-frame {
  flex-grow: 1; border: none; width: 100%; background: var(--bg-color);
}

@media (max-width: 1450px) {
    /* Si l'écran est moyen, on décale un peu le menu pour ne pas toucher le logo */
    ul.main-menu { padding-left: 100px; }
}
@media (max-width: 1200px) {
   /* Mode compact tablette */
   li.menu-item > a { font-size: 0.7rem; padding: 0 5px; }
   .brand-image { height: 60px; }
   nav { height: 70px; }
   ul.submenu { top: 70px; }
}