/* Header.css - Styles pour le header unifié */

:root {
  --primary: #007BFF;
  --primary-dark: #0056b3;
  --bg-light: hsla(0, 0%, 97%, 0.94);
  --text-dark: #333333;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header Container */
.head {
  background-color: var(--bg-light);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow);
  gap: 1rem;
}

/* Logos */
.logo_clair,
.logo_sombre {
  height: 40px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  order: -1;
}

.logo_clair {
  display: block;
}

.logo_sombre {
  display: none;
}

/* Dark mode */
html.dark .logo_clair,
body.dark .logo_clair {
  display: none;
}

html.dark .logo_sombre,
body.dark .logo_sombre {
  display: block;
}

/* Hamburger Menu */
.hamburger {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  margin-left: 1rem;
  z-index: 1001;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

.hamburger:hover span {
  background-color: var(--primary, #667eea);
}

/* Navigation */
.Bande {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.Bande li {
  display: inline-flex;
  align-items: center;
}

.Bande a {
  text-decoration: none;
}

/* Buttons */
button {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.Boutton_Acceuil,
.Boutton_Trouver,
.Boutton_Publier,
.Messagerie {
  background-color: transparent;
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.Boutton_Acceuil:hover,
.Boutton_Trouver:hover,
.Boutton_Publier:hover,
.Messagerie:hover {
  background-color: var(--border);
  color: var(--primary);
}

.Boutton_Se_connecter {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.Boutton_Se_connecter:hover {
  background-color: var(--primary-dark);
}

/* Language Select */
#languageSelect {
  background-color: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#languageSelect:hover {
  border-color: var(--primary);
  background-color: white;
}

/* Dark Mode Toggle */
.Sombre {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
}

.Sombre img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.Sombre1 {
  display: block;
}

.Sombre2,
.SombreB {
  display: none;
}

html.dark .Sombre1,
body.dark .Sombre1 {
  display: none;
}

html.dark .SombreB,
body.dark .SombreB {
  display: block;
}

/* Profile Dropdown */
#menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 180px;
  list-style: none;
  margin: 0.5rem 0 0 0;
  padding: 0.5rem 0;
  z-index: 1001;
}

#menu li {
  display: block;
}

#menu button {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--text-dark);
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

#menu button:hover {
  background-color: var(--border);
  color: var(--primary);
}

/* Profile Picture */
.head img[alt="Profil"] {
  cursor: pointer;
  transition: border-color 0.3s;
}

.head img[alt="Profil"]:hover {
  border-color: var(--primary);
}

/* Responsive Design */
/* Extra Small (Mobile) - < 576px */
@media (max-width: 575.98px) {
  .head {
    flex-wrap: wrap;
    padding: 0.4rem 0.5rem;
    gap: 0.5rem;
    height: auto;
    min-height: 50px;
  }

  /* Réduire la taille du logo sur mobile */
  .logo_clair,
  .logo_sombre {
    height: 35px;
    max-width: 120px;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
    margin: 0;
    padding: 4px;
  }

  .hamburger span {
    width: 20px;
    height: 2.5px;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .Bande {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background-color: var(--bg-light);
    gap: 0;
    margin: 0;
    padding: 0.5rem 0;
    width: 100%;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .Bande.active {
    display: flex;
  }

  .Bande li {
    width: 100%;
    padding: 0.75rem 0;
    display: block !important;
  }

  .Bande a,
  .Bande button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem !important;
    border-radius: 0;
    display: block;
    font-size: 14px;
  }

  #languageSelect {
    width: 90%;
    margin: 0.5rem auto;
    padding: 0.6rem 0.5rem;
    font-size: 13px;
  }

  .Sombre {
    padding: 0.4rem;
  }

  .Sombre img {
    width: 20px;
    height: 20px;
  }

  #menu {
    position: fixed;
    top: 60px;
    right: 0.5rem;
    left: 0.5rem;
    min-width: auto;
    width: auto;
    max-width: calc(100vw - 1rem);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 0;
    padding: 0.25rem 0;
  }

  #menu button {
    padding: 0.7rem 1rem;
    font-size: 13px;
  }

  .head img[alt="Profil"] {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  .Boutton_Se_connecter {
    padding: 0.5rem 0.8rem;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* Small-Tablet (576px - 699.98px) */
@media (min-width: 576px) and (max-width: 699.98px) {
  .head {
    flex-wrap: wrap;
    padding: 0.5rem 0.6rem;
    gap: 0.6rem;
    height: auto;
    min-height: 55px;
  }

  .logo_clair,
  .logo_sombre {
    height: 36px;
    max-width: 130px;
  }

  .hamburger {
    display: flex;
    position: relative;
    z-index: 1000;
    margin: 0;
    padding: 4px;
  }

  .hamburger span {
    width: 22px;
    height: 2.5px;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .Bande {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    background-color: var(--bg-light);
    gap: 0;
    margin: 0;
    padding: 0.5rem 0;
    width: 100%;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .Bande.active {
    display: flex;
  }

  .Bande li {
    width: 100%;
    padding: 0.5rem 0;
    display: block !important;
  }

  .Bande a,
  .Bande button {
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem !important;
    border-radius: 0;
    display: block;
    font-size: 14px;
  }

  #languageSelect {
    width: 90%;
    margin: 0.5rem auto;
    padding: 0.55rem 0.5rem;
    font-size: 13px;
  }

  .Sombre {
    padding: 0.4rem;
  }

  .Sombre img {
    width: 20px;
    height: 20px;
  }

  #menu {
    position: fixed;
    top: 55px;
    right: 0.5rem;
    left: 0.5rem;
    min-width: auto;
    width: auto;
    max-width: calc(100vw - 1rem);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 0;
    padding: 0.25rem 0;
  }

  #menu button {
    padding: 0.65rem 1rem;
    font-size: 13px;
  }

  .head img[alt="Profil"] {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  .Boutton_Se_connecter {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* Small-Medium (700px - 767.98px) */
@media (min-width: 700px) and (max-width: 767.98px) {
  .head {
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    gap: 0.75rem;
    height: auto;
    min-height: 60px;
  }

  .logo_clair,
  .logo_sombre {
    height: 38px;
    max-width: 140px;
  }

  .hamburger {
    display: flex;
    position: relative;
    z-index: 1000;
    margin: 0;
    padding: 5px;
  }

  .hamburger span {
    width: 22px;
    height: 2.5px;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .Bande {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-light);
    gap: 0;
    margin: 0;
    padding: 0.5rem 0;
    width: 100%;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 999;
    max-height: calc(100vh - 65px);
    overflow-y: auto;
  }

  .Bande.active {
    display: flex;
  }

  .Bande li {
    width: 100%;
    padding: 0.5rem 0;
    display: block !important;
  }

  .Bande a,
  .Bande button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1.1rem !important;
    border-radius: 0;
    display: block;
    font-size: 14px;
  }

  #languageSelect {
    width: 88%;
    margin: 0.5rem auto;
    padding: 0.6rem 0.5rem;
    font-size: 13px;
  }

  .Sombre {
    padding: 0.4rem;
  }

  .Sombre img {
    width: 21px;
    height: 21px;
  }

  #menu {
    position: fixed;
    top: 60px;
    right: 0.5rem;
    left: 0.5rem;
    min-width: auto;
    width: auto;
    max-width: calc(100vw - 1rem);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 0;
    padding: 0.25rem 0;
  }

  #menu button {
    padding: 0.7rem 1rem;
    font-size: 13px;
  }

  .head img[alt="Profil"] {
    width: 38px;
    height: 38px;
    border-radius: 50%;
  }

  .Boutton_Se_connecter {
    padding: 0.5rem 0.8rem;
    font-size: 13px;
    white-space: nowrap;
  }
}
    right: 0;
    background-color: var(--bg-light);
    padding: 0.75rem 0;
    z-index: 999;
  }

  .Bande.active {
    display: flex;
  }

  .Bande li {
    width: 100%;
    padding: 0.5rem 0;
  }

  .Bande a,
  .Bande button {
    width: 100%;
    padding: 0.7rem 1.2rem;
    text-align: left;
  }

  #languageSelect {
    width: 95%;
    margin: 0 auto;
  }

  #menu {
    right: 0.5rem;
    min-width: 160px;
  }
}

/* Medium (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .head {
    padding: 0.7rem 1rem;
  }

  .hamburger {
    display: flex;
  }

  .Bande {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background-color: var(--bg-light);
    gap: 0;
    margin: 0;
    padding: 0.75rem 0;
    width: 100%;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 999;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .Bande.active {
    display: flex;
  }

  .Bande li {
    width: 100%;
    padding: 0.5rem 0;
  }

  .Bande a,
  .Bande button {
    width: 100%;
    padding: 0.7rem 1.2rem;
    text-align: left;
    font-size: 13px;
  }

  #languageSelect {
    font-size: 13px;
  }
}

/* Large (992px - 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .head {
    padding: 0.75rem 1.2rem;
  }

  .hamburger {
    display: flex;
  }

  .Bande {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background-color: var(--bg-light);
    padding: 0.75rem 0;
    z-index: 999;
  }

  .Bande.active {
    display: flex;
  }

  .Bande li {
    width: 100%;
    padding: 0.5rem 0;
  }

  .Bande a,
  .Bande button {
    width: 100%;
    padding: 0.7rem 1.2rem;
    text-align: left;
  }
}

/* Extra Large (≥ 1200px) - Affiche la barre normale */
@media (min-width: 1200px) {
  .head {
    padding: 0.75rem 1.5rem;
  }

  .hamburger {
    display: none;
  }

  .Bande {
    display: flex !important;
    position: relative;
    top: auto;
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
    max-height: none;
    padding: 0;
    z-index: auto;
    gap: 1rem;
    flex: 1;
    justify-content: center;
  }

  .Bande li {
    display: inline-flex;
    width: auto;
    padding: 0;
  }

  .Bande a,
  .Bande button {
    width: auto;
    padding: 0.5rem 1rem;
  }

  #menu {
    position: fixed;
    top: 70px;
    right: 1rem;
  }
}

/* Dark Mode Colors */
html.dark,
body.dark {
  --bg-light: hsla(0, 0%, 20%, 0.95);
  --text-dark: #e0e0e0;
  --border: #3a3a3a;
}

html.dark .head,
body.dark .head {
  background-color: hsla(0, 0%, 20%, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.dark .Boutton_Acceuil,
html.dark .Boutton_Trouver,
html.dark .Boutton_Publier,
html.dark .Messagerie,
body.dark .Boutton_Acceuil,
body.dark .Boutton_Trouver,
body.dark .Boutton_Publier,
body.dark .Messagerie {
  color: #e0e0e0;
}

html.dark #languageSelect,
body.dark #languageSelect {
  background-color: hsla(0, 0%, 30%, 1);
  color: #e0e0e0;
  border-color: #3a3a3a;
}

html.dark #languageSelect:hover,
body.dark #languageSelect:hover {
  background-color: hsla(0, 0%, 35%, 1);
}

html.dark #menu,
body.dark #menu {
  background-color: hsla(0, 0%, 25%, 1);
  border-color: #3a3a3a;
  color: #e0e0e0;
}

html.dark #menu button,
body.dark #menu button {
  color: #e0e0e0;
}

html.dark #menu button:hover,
body.dark #menu button:hover {
  background-color: hsla(0, 0%, 30%, 1);
}
