/* Modern Integrated Navbar - Refined Dropdown & Mobile Fix */
.navbar-modern {
  padding: 0.25rem 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  z-index: 2000 !important;
  top: 0;
  margin-top: 0;
  margin-bottom: 2.5rem !important;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.navbar-modern .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: #0d6efd;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  padding: 0;
}

.navbar-modern .navbar-brand img {
  max-height: 80px;
  width: auto;
}

.navbar-modern .nav-link {
  font-weight: 600;
  color: #495057 !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.navbar-modern .nav-link:hover {
  color: #0d6efd !important;
  background: rgba(13, 110, 253, 0.05);
}

.navbar-modern .nav-link.active {
  color: #0d6efd !important;
  position: relative;
}

.navbar-modern .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: #0d6efd;
  border-radius: 2px;
}

/* User Pill / Dropdown Toggle */
.user-dropdown-toggle {
  display: flex;
  align-items: center;
  background: #f1f3f5;
  padding: 0.35rem 1rem;
  border-radius: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #495057;
  font-weight: 700;
  font-size: 0.85rem;
  gap: 0.5rem;
  border: none;
}

.user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.user-dropdown-toggle:hover {
  background: #e9ecef;
}

.user-dropdown-toggle::after {
  display: none;
}

/* Modern Dropdown Menu */
.modern-dropdown {
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.75rem !important;
  min-width: 240px !important;
  margin-top: 0.5rem !important;
  z-index: 2100 !important;
}

.dropdown-item {
  border-radius: 0.75rem !important;
  padding: 0.6rem 1rem !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  color: #495057 !important;
  transition: all 0.2s ease !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropdown-item:hover {
  background-color: rgba(13, 110, 253, 0.05) !important;
  color: #0d6efd !important;
}

.dropdown-item.text-danger:hover {
  background-color: rgba(220, 53, 69, 0.05) !important;
  color: #dc3545 !important;
}

.dropdown-header {
  font-weight: 800 !important;
  text-transform: uppercase !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.05em !important;
  color: #adb5bd !important;
  padding: 0.5rem 1rem !important;
}

/* Score Display in Dropdown */
.dropdown-score-box {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.15);
}

.dropdown-score-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.8;
}

.dropdown-score-value {
  font-size: 1.1rem;
  font-weight: 800;
}

/* PWA Toggle in Dropdown */
.dropdown-pwa-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
}

.navbar-modern .pwa-toggle {
  height: 20px;
  width: 50px;
  margin-bottom: 0;
}

.navbar-modern .pwa-toggle-slider {
  border-radius: 10px;
}

.navbar-modern .pwa-toggle-slider:before {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  top: 1px;
  left: 2px;
}

.navbar-modern .pwa-toggle input:checked+.pwa-toggle-slider:before {
  transform: translateX(30px);
}

/* Mobile Adjustments */
@media (max-width: 991.98px) {
  .navbar-modern {
    border-radius: 0 0 1.25rem 1.25rem;
    padding: 0.5rem 0;
    /* Horizontal padding handled by container below */
    background: #ffffff;
    margin: 0 0.5rem;
  }

  .navbar-modern .container {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
  }

  .navbar-modern .navbar-brand {
    margin-left: 0;
  }

  .navbar-modern .navbar-toggler {
    margin-right: 0;
  }

  .user-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    margin-top: 1rem;
    background: #f8f9fa;
    height: 44px;
  }

  /* Static dropdown on mobile to push content down */
  .modern-dropdown {
    position: static !important;
    float: none !important;
    width: 100% !important;
    box-shadow: none !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: #fdfdfd !important;
    margin-top: 0.5rem !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: none;
    /* Controlled by JS/Bootstrap, but static when visible */
  }

  .modern-dropdown.show {
    display: block !important;
  }

  .dropdown-item {
    background: transparent !important;
  }

  .user-name {
    max-width: none;
    /* Full width on mobile */
  }
}