/* Header Comic Style */
.comic-header {
  background: linear-gradient(135deg, #153a6e 0%, #142454 100%);
  position: relative;
  overflow: visible;
  z-index: 1000;
  width: 100%;
  display: flex;
  justify-content: center;
}

.header-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  position: relative;
  z-index: 1001;
  max-width: 1200px;
  width: 100%;
  gap: 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.logo-section a {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.logo-section a:hover {
  transform: scale(1.05);
}

.logo {
  width: 120px;
  height: auto;
  border: none;
  box-shadow: none;
}

.logo-text h1 {
  font-family: 'Bangers', cursive;
  font-size: 2.5em;
  color: #fff;
  text-shadow: 3px 3px 0 #333;
  margin: 0;
}

.tagline {
  font-size: 0.9em;
  color: #333;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Hamburger Menu Button - Hidden by default */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
  z-index: 1005;
  position: relative;
}

.hamburger span,
.hamburger span:before,
.hamburger span:after {
  display: block;
  width: 25px;
  height: 3px;
  background: #ff0000;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger span {
  position: relative;
  margin: 3px 0;
}

.hamburger span:before,
.hamburger span:after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger span:before {
  top: -8px;
}

.hamburger span:after {
  top: 8px;
}

.hamburger.active span {
  background: transparent;
}

.hamburger.active span:before {
  transform: rotate(45deg) translate(0, 8px);
}

.hamburger.active span:after {
  transform: rotate(-45deg) translate(0, -8px);
}

/* Navigation */
.comic-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  margin-left: auto;
  margin-right: auto;
}

.comic-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 35px 10px 35px 10px;
  padding: 10px 20px;
  gap: 5px;
  white-space: nowrap;
}

.comic-nav li {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  font-size: 1em;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  color: #333;
  border-radius: 10px;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  min-height: auto;
  line-height: 1.2;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #ff6b6b 0%, #4ecdc4 25%, #ffd93d 50%, #a8e6cf 75%, #ff6b6b 100%);
  background-size: 400% 400%;
  transition: all 0.4s ease;
  z-index: -1;
  animation: comicGlow 2s ease-in-out infinite;
}

.nav-link::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-15deg);
  font-family: 'Bangers', cursive;
  font-size: 0.7em;
  color: #333;
  font-weight: bold;
  text-shadow: 1px 1px 0 #fff;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

@keyframes comicGlow {
  0%, 100% { 
    background-position: 0% 50%; 
    filter: hue-rotate(0deg);
  }
  50% { 
    background-position: 100% 50%; 
    filter: hue-rotate(15deg);
  }
}

.nav-link:hover {
  background: transparent !important;
  color: #333;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 6px 15px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(255, 107, 107, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  border-color: #333;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-link:hover::before {
  left: 0;
  background: linear-gradient(45deg, #ff6b6b 0%, #4ecdc4 25%, #ffd93d 50%, #a8e6cf 75%, #ff6b6b 100%);
  background-size: 400% 400%;
  animation: comicExplosion 0.6s ease-out;
}

.nav-link:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
  animation: comicPop 0.6s ease-out;
}

@keyframes comicExplosion {
  0% { 
    background-position: 0% 50%; 
    filter: brightness(1);
  }
  50% { 
    background-position: 100% 50%; 
    filter: brightness(1.3);
  }
  100% { 
    background-position: 200% 50%; 
    filter: brightness(1.1);
  }
}

@keyframes comicPop {
  0% { 
    transform: translate(-50%, -50%) scale(0) rotate(-15deg); 
    opacity: 0;
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.5) rotate(5deg); 
    opacity: 1;
  }
  100% { 
    transform: translate(-50%, -50%) scale(1.2) rotate(0deg); 
    opacity: 1;
  }
}

/* Menu déroulant */
.nav-dropdown {
  position: relative;
  z-index: 1001;
  display: flex;
  align-items: center;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  justify-content: center;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.98);
  border: 3px solid #333;
  border-radius: 15px;
  min-width: 200px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1002;
  backdrop-filter: blur(10px);
}

/* Desktop hover behavior */
@media (min-width: 769px) {
  .nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
  }
}

/* Mobile click behavior */
@media (max-width: 768px) {
  .nav-dropdown .dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    margin-top: 10px;
    pointer-events: auto;
    z-index: auto;
    display: none; /* Masqué par défaut sur mobile */
  }
  
  .nav-dropdown.active .dropdown-content {
    display: block; /* Affiché quand actif */
  }
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-weight: 600;
  text-transform: none;
  text-shadow: none;
  border-bottom: 2px solid rgba(51, 51, 51, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dropdown-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255, 107, 107, 0.1) 0%, 
    rgba(78, 205, 196, 0.2) 25%, 
    rgba(255, 217, 61, 0.3) 50%, 
    rgba(168, 230, 207, 0.2) 75%, 
    rgba(255, 107, 107, 0.1) 100%
  );
  transition: all 0.4s ease;
  z-index: -1;
}

.dropdown-link:last-child {
  border-bottom: none;
}

.dropdown-link:hover {
  background: transparent;
  transform: translateX(8px) scale(1.02);
  color: #333;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow: 
    inset 0 0 0 2px rgba(255, 107, 107, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
}

.dropdown-link:hover::before {
  left: 0;
  animation: comicRush 0.6s ease-out;
}

@keyframes comicRush {
  0% { 
    left: -100%; 
    filter: blur(2px);
  }
  50% { 
    left: 0; 
    filter: blur(0px);
    background: linear-gradient(90deg, 
      rgba(255, 107, 107, 0.3) 0%, 
      rgba(78, 205, 196, 0.4) 25%, 
      rgba(255, 217, 61, 0.5) 50%, 
      rgba(168, 230, 207, 0.4) 75%, 
      rgba(255, 107, 107, 0.3) 100%
    );
  }
  100% { 
    left: 0; 
    filter: blur(0px);
  }
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-self: end;
  position: relative;
  z-index: 1002;
}

/* Image du header à droite - Repositionnée complètement à droite */
.header-right-image {
  height: 100%;
  width: auto;
  max-width: 200px;
  transition: all 0.3s ease;
  transform: scale(-1, -1);
  position: absolute;
  right: 0px; /* Sortir de la zone du header */
  top: 0;
  z-index: 999; /* Z-index plus bas que les boutons */
  pointer-events: none; /* Empêcher les interactions avec le nuage */
}



/* Boutons Comic */
.btn-comic {
  display: inline-block;
  padding: 12px 24px;
  font-family: 'Bangers', cursive;
  font-size: 1.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 25px;
  border: 3px solid #333;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-comic.primary {
  background: #ff6b6b;
  color: #fff;
  text-shadow: 2px 2px 0 #333;
}

.btn-comic:hover {
  background: #e55a5a;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(255, 107, 107, 0.4);
}

/* Espace Moniteur Button */
.btn-moniteur {
  position: relative;
  width: 180px;
  height: 50px;
  border: none;
  background-color: rgb(231, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: hidden;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 8px 8px 0px rgb(12, 12, 12);
  transition-duration: .3s;
  text-decoration: none;
  border: 3px solid #333;
}

.btn-moniteur .layer {
  width: 60px;
  position: absolute;
  left: -30px;
  transition-duration: .3s;
  fill: #ffaf02;
}

.btn-moniteur .cls-1 { fill: #333; }
.btn-moniteur .cls-2 { fill: #ffaf02; }
.btn-moniteur .cls-3 { fill: #ff6b6b; }
.btn-moniteur .cls-4 { fill: #4ecdc4; }

.btn-moniteur:hover {
  transform: translateY(5px);
  box-shadow: 3px 3px 0px rgb(0, 0, 0);
  transition-duration: .3s;
}

.btn-moniteur:hover .layer {
  left: 0%;
  width: 100%;
  transition-duration: .3s;
}

.btn-moniteur p {
  color: white;
  font-weight: 600;
  font-size: 14px;
  position: absolute;
  z-index: 2;
  transition-duration: .1s;
  font-family: 'Comic Neue', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-moniteur:hover p {
  color: transparent;
  transition-duration: .3s;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .header-container {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 15px;
  }
  
  .logo {
    width: 60px;
  }
  
  .logo-text h1 {
    font-size: 2em;
  }
  
  .comic-nav {
    flex: 1;
    justify-content: center;
    max-width: 500px;
  }
  
  .comic-nav ul {
    padding: 8px 15px;
    gap: 3px;
  }
  
  .nav-link {
    padding: 8px 12px;
    font-size: 0.9em;
  }
  
  .btn-moniteur {
    width: 150px;
    height: 45px;
  }
  
  .btn-moniteur p {
    font-size: 12px;
  }
  
  .header-right-image {
    right: -30px;
    max-width: 150px;
    z-index: 999;
  }
}

@media (max-width: 900px) {
  .header-container {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    gap: 10px;
  }
  
  .logo {
    width: 50px;
  }
  
  .logo-text h1 {
    font-size: 1.8em;
  }
  
  .tagline {
    font-size: 0.8em;
  }
  
  .comic-nav {
    flex: 1;
    justify-content: center;
    max-width: 400px;
  }
  
  .comic-nav ul {
    padding: 6px 10px;
    gap: 2px;
  }
  
  .nav-link {
    padding: 6px 8px;
    font-size: 0.8em;
  }
  
  .btn-moniteur {
    width: 130px;
    height: 40px;
  }
  
  .btn-moniteur p {
    font-size: 11px;
  }
  
  .header-right-image {
    right: -20px;
    max-width: 120px;
    z-index: 999;
  }
}

/* Menu hamburger activé à partir de 768px */
@media (max-width: 768px) {
  .comic-header {
    position: relative; /* Changé de fixed à relative pour permettre les interactions */
    z-index: 1005;
  }
  
  .header-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1005;
    background: linear-gradient(135deg, #153a6e 0%, #142454 100%);
    padding: 10px 15px;
  }
  
  .logo-section {
    position: relative;
    z-index: 1006;
  }
  
  .hamburger {
    display: flex;
    position: relative;
    z-index: 1006;
  }
  
  .comic-nav {
    position: fixed;
    top: 0; /* Commencer du haut de l'écran */
    left: -100%;
    width: 100%;
    height: 100vh; /* Prendre toute la hauteur */
    background: linear-gradient(135deg, #153a6e 0%, #142454 100%);
    transition: left 0.3s ease;
    z-index: 1004; /* z-index plus bas que le header */
    padding-top: 80px; /* Laisser de la place pour le header */
    overflow-y: auto;
  }
  
  .comic-nav.menu-open {
    left: 0;
  }
  
  .comic-nav ul {
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    padding: 20px;
    width: 100%;
    gap: 15px;
  }
  
  .comic-nav li {
    width: 100%;
  }
  
  .nav-link {
    display: block;
    padding: 15px 20px;
    font-size: 1.2em;
    background: rgba(248, 249, 250, 0.95);
    border-radius: 15px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    border: 3px solid rgba(51, 51, 51, 0.1);
    text-transform: uppercase;
    font-family: 'Comic Neue', cursive;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b 0%, #4ecdc4 25%, #ffd93d 50%, #a8e6cf 75%, #ff6b6b 100%);
    transition: all 0.4s ease;
    z-index: -1;
  }
  
  .nav-link:hover,
  .nav-link:active {
    background: transparent;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: #ff6b6b;
  }
  
  .nav-link:hover::before,
  .nav-link:active::before {
    left: 0;
  }
  
  .nav-dropdown .dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    margin-top: 10px;
    display: none;
  }
  
  .nav-dropdown.active .dropdown-content {
    display: block;
  }
  
  .dropdown-link {
    background: rgba(248, 249, 250, 0.8);
    margin-bottom: 8px;
    border-radius: 12px;
    padding: 12px 15px;
    display: block;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    border: 2px solid rgba(51, 51, 51, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }
  
  .dropdown-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
      rgba(78, 205, 196, 0.3) 0%, 
      rgba(255, 217, 61, 0.4) 50%, 
      rgba(168, 230, 207, 0.3) 100%
    );
    transition: all 0.3s ease;
    z-index: -1;
  }
  
  .dropdown-link:hover,
  .dropdown-link:active {
    background: transparent;
    color: #333;
    transform: translateX(5px);
    border-color: #4ecdc4;
  }
  
  .dropdown-link:hover::before,
  .dropdown-link:active::before {
    left: 0;
  }
  
  .header-actions {
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 1006;
  }
  
  .btn-moniteur {
    width: 120px;
    height: 35px;
    position: relative;
    z-index: 1006;
  }
  
  .header-right-image {
    right: 10px;
    max-width: 100px;
    z-index: 1007; /* Augmenté pour passer au-dessus du menu */
    opacity: 1;    /* Pleine visibilité */
  }
}

@media (max-width: 480px) {
  .comic-header {
    position: relative; /* S'assurer que c'est aussi relatif sur très petits écrans */
  }
  
  .header-container {
    padding: 8px 10px;
    gap: 8px;
    z-index: 1005;
    background: linear-gradient(135deg, #153a6e 0%, #142454 100%);
    position: relative; /* Ajouté pour sécurité */
  }
  
  .logo-section {
    z-index: 1006;
  }
  
  .hamburger {
    z-index: 1006;
  }
  
  .logo {
    width: 100px;
  }
  
  .logo-text h1 {
    font-size: 1.5em;
  }
  
  .tagline {
    font-size: 0.7em;
  }
  
  .comic-nav {
    top: 0;
    height: 100vh;
    width: 100vw;
    max-width: 100vw;
    background: linear-gradient(135deg, #153a6e 0%, #142454 100%);
    padding-top: 70px; /* Ajuster pour les petits écrans */
  }
  
  .comic-nav ul {
    padding: 15px;
  }
  
  .nav-link {
    padding: 12px 15px;
    font-size: 1.1em;
  }
  
  .btn-moniteur {
    width: 100px;
    height: 30px;
    z-index: 1006;
    position: relative;
  }
  
  .btn-moniteur p {
    font-size: 9px;
  }
  
  .header-right-image {
    right: 5px;
    max-width: 80px;
    z-index: 1007; /* Augmenté pour passer au-dessus du menu */
    opacity: 1;    /* Pleine visibilité */
  }
}

/* Overlay pour fermer le menu en cliquant à côté */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1003;
  display: none;
}

.menu-overlay.active {
  display: block;
}