/* Styles pour le header avec top-bar et menu amélioré */

/* Header styles */
.header {
  color: var(--light-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-bar {
  background-color: #013571;
  padding-top: 5px;
  padding-bottom: 5px;
}


.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Style des drapeaux de langue */
.language-flags {
  display: flex;
  align-items: center;
}

.language-flags a {
  margin-right: 12px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.language-flags a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.language-flags a.active {
  opacity: 1;
  position: relative;
}

.language-flags a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.language-flags img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 2px;
}

/* Actions utilisateur dans la top-bar */
.user-actions {
  display: flex;
  align-items: center;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--light-color);
  font-size: 18px;
  margin-right: 15px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

.user-menu .dropdown-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  color: var(--light-color);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 20px;
}

.user-menu .dropdown-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
}

/* Style de l'en-tête principal */
.main-header {
  padding: 15px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 80px;
  width: auto;
  max-width: 280px;
}

/* Style du menu principal */
.main-nav {
  flex: 1;
  margin-left: 30px;
  max-width: 1000px;
}

.nav-items {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.nav-item {
  margin: 0 5px;
}

.nav-item a {
  color: var(--light-color);
  font-weight: 500;
  padding: 10px 12px;
  position: relative;
  display: block;
  font-size: 14px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.nav-item a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-item a.active {
  background-color: rgba(255, 255, 255, 0.15);
  position: relative;
  text-decoration: none;
}

.nav-item a.active::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background-color: var(--light-color);
  border-radius: 3px;
}

.nav-item.dropdown .dropdown-content {
  left: 0;
  right: auto;
}

.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 10;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: 10px 15px;
  color: var(--dark-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem !important;
  font-weight: 600 !important;
}

.dropdown-content a:hover {
  background-color: var(--gray-color);
}

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

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 30px;
  position: relative;
}

.mobile-toggle span {
  width: 30px;
  height: 3px;
  background-color: var(--light-color);
  display: block;
  position: absolute;
  left: 5px;
  transition: all 0.3s ease;
}

.mobile-toggle span:first-child {
  top: 5px;
}

.mobile-toggle span:nth-child(2) {
  top: 15px;
}

.mobile-toggle span:last-child {
  top: 25px;
}

/* Responsive styles for header */
@media (max-width: 991px) {
  .main-nav {
    margin-left: 15px;
  }
  
  .nav-item a {
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .main-header .header-content {
    position: relative;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    padding: 15px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .nav-items {
    flex-direction: column;
  }
  
  .nav-item {
    margin: 5px 0;
  }
  
  .mobile-toggle.active span:first-child {
    transform: rotate(45deg);
    top: 15px;
  }
  
  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-toggle.active span:last-child {
    transform: rotate(-45deg);
    top: 15px;
  }
  
  .main-nav.active {
    display: block;
  }
}

@media (max-width: 575px) {
  .top-bar-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .language-flags, .user-actions {
    width: 100%;
    justify-content: center;
  }
  
  .auth-actions {
    width: 100%;
    justify-content: center;
  }
  
  .logo {
    margin: 0 auto;
  }
}
