/* Style général pour la navbar */
.navbar {
  background-color: #ffde59;
  height: 72px;
  overflow: hidden;
  position: fixed;
  width: 100%;
  z-index: 1000;
  top: 0;
  left: 0;
  right: 0;
  transition: top 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}

/* Style pour le logo et le texte de l'entreprise */
.navbar-brand {
  display: flex;
  align-items: center;
}

.logo {
  margin-right: 15px;
}

.company-info {
  display: block;
}

.company-name {
  font-weight: bold;
  display: block;
}

.company-services {
  font-size: 70%;
  font-weight: bold;
  margin-top: -5px;
}

/* Style pour les éléments du menu à droite */
.navbar-nav {
  display: flex;
  flex-direction: row;
  margin-left: auto;
  align-items: center;
}

.navbar-nav .nav-item {
  margin-left: 15px;
}

/* Suppression des styles par défaut de Bootstrap */
.navbar-brand,
.nav-link {
  padding: 0;
}

/* Sous-navigation */
.subnav {
  background-color: #000;
  position: fixed;
  width: 100%;
  top: 72px;
  z-index: 1001;
  display: flex;
  justify-content: center;
  height: 35px;
  padding: 5px 0;
  font-size: 85%;
  font-weight: bold;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

/* Afficher la sous-navigation quand la classe "show" est appliquée */
.subnav.show {
  display: flex !important;
}

.subnav .navbar-nav {
  flex-wrap: nowrap;
}

.subnav .nav-item {
  white-space: nowrap;
}

.subnav .nav-link {
  color: #fff;
  margin-right: 10px;
}

.subnav .nav-link:hover {
  color: #ffde59;
}

/* Styles pour l'utilisateur à droite */
.user {
  margin-right: 0px;
  margin-left: 20px;
  display: flex;
  align-items: center;
}

.user img {
  border: none;
  cursor: pointer;
}

.greeting {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

/* Sidebar menu */
.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1002;
  top: 0;
  right: 0;
  background-color: #111;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
  white-space: nowrap;
}

.sidebar.active {
  width: 250px;
}

.sidebar a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 20px;
  color: #818181;
  display: block;
  transition: 0.3s;
}

.sidebar a:hover {
  color: #f1f1f1;
}

.sidebar .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

.sidebar .logout {
  position: absolute;
  bottom: 20px;
  width: 100%;
  color: red;
}

/* Overlay pour fermer la barre latérale lorsqu'on clique à l'extérieur */
#overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

#overlay.active {
  display: block;
}

/* Overlay pour le sous-menu mobile */
#subNavOverlay {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  width: 100%;
  height: calc(100% - 72px);
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

#subNavOverlay.active {
  display: block;
}

/* Masquer le bouton navbar-toggler sur les écrans larges */
@media (min-width: 831px) {
  .navbar-toggler {
    display: none;
  }
}

@media (max-width: 920px) {
  .greeting {
    display: none; /* Cacher la catégorie en mode mobile */
  }

}

/* Responsivité : ajustements pour les écrans plus petits */
@media (max-width: 830px) {
  .company-info {
    display: none;
  }


  .subnav {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background-color: #000;
    padding: 0;
    height: auto;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }

  .subnav.show {
    display: flex !important;
  }

  .subnav .navbar-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .subnav .nav-item {
    width: 100%;
    border-bottom: 1px solid #444;
    padding: 15px 20px;
  }

  .subnav .nav-link {
    color: #fff;
    width: 100%;
    text-align: left;
    font-size: 18px;
  }

  .subnav .nav-link:hover {
    background-color: #333;
  }

  /* Transformer le bouton en croix lorsque le sous-menu est ouvert */
  .navbar-toggler {
    border: none;
    background: none;
  }

  .navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
  }

  /* Icône du hamburger */
  .navbar-toggler:not(.open) .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  }

  /* Icône de la croix */
  .navbar-toggler.open .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' d='M7 7l16 16M23 7L7 23'/%3E%3C/svg%3E");
  }

  /* Ajuster le padding-top du body si nécessaire */
  body {
    padding-top: 72px;
  }
}

/* S'assurer que les pages ne commencent pas sous la navbar */
body {
  padding-top: 107px;
}