/*
 * =====================================================
 * NAVBAR MODERNE - Styles pour le menu de navigation
 * Application de gestion de pressing
 * Version 2.0
 * =====================================================
 */

/* ==================== NAVBAR PRINCIPALE ==================== */

.navbar-modern {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: all 0.3s ease;
}

.navbar-modern .container-fluid {
  padding: 0.5rem 1rem;
}

/* ==================== BRAND / LOGO ==================== */

.navbar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  padding: 0.4rem;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.navbar-brand-icon:hover {
  transform: rotate(5deg) scale(1.05);
}

.navbar-brand-text {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ==================== BOUTON MENU MOBILE ==================== */

.mobile-menu-toggle {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mobile-menu-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  transform: scale(1.05);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* ==================== NAV ITEMS & DROPDOWN ==================== */

.navbar-nav {
  gap: 0.25rem;
}

.nav-link.dropdown-toggle {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link.dropdown-toggle:hover,
.nav-link.dropdown-toggle:focus {
  background: rgba(59, 130, 246, 0.15);
  color: white;
  transform: translateY(-2px);
}

.nav-link.dropdown-toggle:active {
  transform: translateY(0);
}

.nav-link.dropdown-toggle svg {
  transition: transform 0.2s ease;
}

.nav-link.dropdown-toggle:hover svg {
  transform: scale(1.1);
}

/* Dropdown Menu */
.dropdown-menu {
  background: white;
  border: 1px solid rgba(226, 232, 240, 1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
  padding: 0.5rem;
  min-width: 200px;
  margin-top: 0.5rem;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: #334155;
  font-weight: 500;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  transform: translateX(4px);
}

.dropdown-divider {
  margin: 0.5rem 0;
  border-color: rgba(226, 232, 240, 1);
  opacity: 1;
}

/* ==================== SEARCH BAR ==================== */

.navbar-search {
  position: relative;
}

.navbar-search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border-radius: 0.5rem;
  width: 180px;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.navbar-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.navbar-search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  outline: none;
  width: 240px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.navbar-search-button {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.navbar-search-button:hover {
  color: white;
  transform: translateY(-50%) scale(1.1);
}

/* ==================== NOTIFICATIONS ==================== */

.navbar-notification {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.navbar-notification:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  transform: scale(1.05);
}

.navbar-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 2px solid #1e293b;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ==================== USER MENU ==================== */

.navbar-user {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.navbar-user:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-user-name {
  color: white;
  font-weight: 600;
  font-size: 0.813rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.navbar-logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 0.35rem 0.45rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  line-height: 1;
  cursor: pointer;
}

.navbar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.navbar-logout-btn:active {
  transform: scale(0.95);
}

/* ==================== OFFCANVAS MOBILE MENU ==================== */

.offcanvas-mobile {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  width: 300px;
}

.offcanvas-mobile .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.offcanvas-mobile .offcanvas-title {
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.offcanvas-mobile .btn-close-white {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.offcanvas-mobile .btn-close-white:hover {
  opacity: 1;
}

.offcanvas-mobile .offcanvas-body {
  padding: 1.5rem;
}

/* User Profile dans Offcanvas */
.offcanvas-user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-user-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.offcanvas-user-info {
  flex: 1;
}

.offcanvas-user-name {
  color: white;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.offcanvas-user-role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.offcanvas-logout-btn {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.75rem;
  font-weight: 600;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.offcanvas-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

/* Accordion dans Offcanvas */
.offcanvas-mobile .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
}

.offcanvas-mobile .accordion-button {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: none;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: none;
  transition: all 0.2s ease;
}

.offcanvas-mobile .accordion-button:not(.collapsed) {
  background: rgba(59, 130, 246, 0.15);
  color: white;
}

.offcanvas-mobile .accordion-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.offcanvas-mobile .accordion-button::after {
  filter: brightness(0) invert(1);
}

.offcanvas-mobile .accordion-body {
  padding: 0.5rem 0 0.5rem 2rem;
}

.offcanvas-mobile .accordion-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.offcanvas-mobile .accordion-body li {
  margin-bottom: 0.25rem;
}

.offcanvas-mobile .accordion-body a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.offcanvas-mobile .accordion-body a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  transform: translateX(4px);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 991.98px) {
  /* Cacher le navbar-toggler standard Bootstrap */
  .navbar-toggler {
    display: none !important;
  }

  /* Montrer uniquement le bouton offcanvas en mobile */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Cacher le contenu navbar en mobile */
  .navbar-collapse {
    display: none !important;
  }
}

@media (min-width: 992px) {
  /* Desktop: cacher le bouton mobile */
  .mobile-menu-toggle {
    display: none;
  }

  /* Desktop: montrer la navbar normale */
  .navbar-collapse {
    display: flex !important;
  }
}

@media (max-width: 1199.98px) {
  .navbar-user-name {
    display: none;
  }
}

/* ==================== SCROLLED STATE ==================== */

.navbar-modern.scrolled {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* ==================== ACCESSIBILITY ==================== */

.navbar-modern a:focus,
.navbar-modern button:focus {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

/* Reduce motion pour accessibilité */
@media (prefers-reduced-motion: reduce) {
  .navbar-modern,
  .navbar-modern *,
  .offcanvas-mobile,
  .offcanvas-mobile * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
