/* VARIABLES GLOBALES */
:root {
  --chu-blue: #0056a6;
  --chu-white: #ffffff;
  --chu-light-blue: #e6f0fa;
  --chu-dark: #333333;
  --chu-green: #4caf50;
  --chu-red: #e53935;
  --chu-orange: #ff9800;
  --chu-dark-blue: #003366;
}

/* HEADER TOP BAR */
.header-top {
  background: var(--chu-blue);
  color: white;
  padding: 10px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-top a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.header-top a:hover {
  color: var(--chu-light-blue);
}

/* LOGO AVEC GESTION BILINGUE - CORRIGÉ */
.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.chu-logo {
  height: 50px;
  width: auto;
  transition: all 0.3s ease;
  object-fit: contain;
  max-width: 200px;
}

.chu-logo:hover {
  transform: scale(1.05);
}

/* Logo du footer */
.footer-logo {
  height: 45px;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  max-width: 180px;
}

.footer-logo:hover {
  transform: scale(1.05);
}

/* MAIN HEADER */
.chu-header {
  background: var(--chu-white);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.chu-header.scrolled {
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

/* MENU HAMBURGER AVEC TEXTE "MENU" */
.menu-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hamburger-menu {
  width: 30px;
  height: 20px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  transition: transform 0.3s ease;
}

.hamburger-menu:hover {
  transform: scale(1.1);
}

.hamburger-menu span {
  display: block;
  position: absolute;
  height: 3px;
  background: var(--chu-blue);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-menu span:nth-child(1) {
  top: 0;
  width: 70%;
  left: 0;
}

.hamburger-menu span:nth-child(2) {
  top: 8px;
  width: 85%;
  left: 0;
}

.hamburger-menu span:nth-child(3) {
  top: 16px;
  width: 100%;
  left: 0;
}

.hamburger-menu:hover span {
  width: 100%;
}

.menu-text {
  color: var(--chu-blue);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.menu-text:hover {
  color: var(--chu-dark-blue);
}

/* PANEL LATÉRAL */
.side-panel {
  position: fixed;
  top: 0;
  left: -400px;
  width: 350px;
  height: 100vh;
  background: white;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
  overflow-y: auto;
}

.side-panel.open {
  left: 0;
}

.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
  animation: fadeIn 0.3s ease;
}

.panel-overlay.show {
  display: block;
}

.panel-header {
  background: linear-gradient(
    135deg,
    var(--chu-blue) 0%,
    var(--chu-dark-blue) 100%
  );
  color: white;
  padding: 25px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.close-panel {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-panel:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.panel-nav {
  padding: 20px;
}

.panel-nav-item {
  padding: 15px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease;
}

.panel-nav-item:hover {
  background: var(--chu-light-blue);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.panel-nav-item a {
  color: var(--chu-dark);
  text-decoration: none;
  font-weight: 500;
  display: block;
  transition: color 0.3s ease;
}

.panel-nav-item a:hover {
  color: var(--chu-blue);
}

.panel-submenu {
  padding-left: 20px;
  margin-top: 10px;
  border-left: 2px solid var(--chu-light-blue);
}

.panel-submenu a {
  font-weight: 400;
  font-size: 0.9rem;
  padding: 8px 0;
  display: block;
  color: #666;
  transition: all 0.3s ease;
}

.panel-submenu a:hover {
  color: var(--chu-blue);
  padding-left: 5px;
}

/* URGENCES BANNER */
.emergency-alert {
  background: linear-gradient(45deg, var(--chu-red) 0%, #d32f2f 100%);
  color: white;
  padding: 15px 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(229, 57, 53, 0.3);
}

.emergency-alert .btn-light {
  background: rgba(255, 255, 255, 0.9);
  color: var(--chu-red);
  font-weight: 600;
}

.emergency-alert .btn-light:hover {
  background: white;
  color: var(--chu-red);
  transform: translateY(-2px);
}

/* SEARCH BOX */
.search-box {
  position: relative;
  max-width: 400px;
  flex: 1;
}

.search-box .form-control {
  border-radius: 25px;
  padding: 10px 20px;
  border: 2px solid var(--chu-light-blue);
  transition: all 0.3s ease;
}

.search-box .form-control:focus {
  border-color: var(--chu-blue);
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 166, 0.25);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--chu-blue);
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: var(--chu-light-blue);
  transform: translateY(-50%) scale(1.1);
}

/* ESPACES RÉSERVÉS IMAGES AVEC ADAPTATION */
.image-container {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.adaptive-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.adaptive-image:hover {
  transform: scale(1.05);
}

/* Conteneurs spécifiques */
.hero-image-container .adaptive-image {
  object-fit: cover;
  border-radius: 15px;
}

.service-image .adaptive-image {
  object-fit: cover;
  height: 200px;
}

.news-image .adaptive-image {
  object-fit: cover;
  height: 220px;
}

/* Placeholder amélioré */
.image-placeholder {
  background: linear-gradient(135deg, var(--chu-light-blue) 0%, #f8f9fa 100%);
  border: 2px dashed var(--chu-blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chu-blue);
  font-weight: 500;
  transition: all 0.3s ease;
  flex-direction: column;
  text-align: center;
}

.image-placeholder:hover {
  border-color: var(--chu-dark-blue);
  background: var(--chu-light-blue);
}

.image-placeholder i {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.7;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Support des écrans haute résolution pour PNG */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .chu-logo,
  .footer-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Styles pour les logos en erreur */
.chu-logo[style*="opacity: 0.7"],
.footer-logo[style*="opacity: 0.7"] {
  background: #f8f9fa;
  padding: 5px;
  border-radius: 5px;
}

/* RESPONSIVE HEADER */
@media (max-width: 768px) {
  .menu-text {
    display: none;
  }

  .side-panel {
    width: 300px;
  }

  .search-box {
    max-width: 200px;
  }

  .chu-logo {
    height: 40px;
    max-width: 150px;
  }

  .footer-logo {
    height: 35px;
    max-width: 140px;
  }

  .adaptive-image {
    object-fit: cover;
  }

  .logo-container {
    gap: 10px;
  }
}

@media (max-width: 576px) {
  .header-top .col-md-6 {
    text-align: center;
    margin-bottom: 5px;
  }

  .search-box {
    display: none;
  }

  .chu-logo {
    height: 35px;
    max-width: 120px;
  }

  .footer-logo {
    height: 30px;
    max-width: 110px;
  }

  .image-placeholder {
    padding: 20px;
  }

  .image-placeholder i {
    font-size: 2rem;
  }
}
