/**
 * Navigation Components - Zocdoc inspired
 * Responsive, symmetric layout with progressive enhancement
 */

/* Site Header */
.site-header {
  background-color: #FFFFFF;
  border-bottom: 1px solid #E8E8E8;
  position: static;
  top: auto;
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Navbar Container */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

/* Logo/Brand - Always visible (Left) */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: #191919;
  font-weight: 600;
  font-size: 1.125rem;
  margin-right: 1rem;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.8;
  color: #191919;
}

.logo-circle {
  width: 36px;
  height: 36px;
  background: #FFD93D;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: #191919;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 600;
  white-space: nowrap;
}

/* Mobile Hamburger Toggle */
.navbar-toggler {
  padding: 0.5rem 0.75rem;
  font-size: 1.125rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid #E8E8E8;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-left: auto;
}

.navbar-toggler:hover {
  border-color: #191919;
  background-color: #F8F8F8;
}

.navbar-toggler:focus {
  outline: 2px solid #FFD93D;
  outline-offset: 2px;
}

.navbar-toggler-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(25, 25, 25, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* Collapsible Content */
.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

/* Desktop: Show by default at lg breakpoint */
@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }

  .navbar-toggler {
    display: none;
  }
}

/* Mobile: Hidden by default */
.navbar-collapse:not(.show) {
  display: none;
}

/* Navigation Links - Centered (mx-auto) */
.navbar-nav {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  gap: 0.5rem;
}

@media (min-width: 992px) {
  .navbar-nav {
    flex-direction: row;
    gap: 2rem;
    align-items: center;
  }

  /* Center navigation items */
  .navbar-nav.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: #191919;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.nav-link:hover {
  color: #191919;
  background-color: #F8F8F8;
}

.nav-link:focus {
  outline: 2px solid #FFD93D;
  outline-offset: 2px;
}

/* Desktop nav-link styling */
@media (min-width: 992px) {
  .nav-link {
    padding: 0.5rem 0;
    background: none;
  }

  .nav-link:hover {
    background: none;
    color: #666;
  }
}

/* Dropdown Toggle */
.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.4em;
  vertical-align: 0.15em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 220px;
  padding: 0.5rem 0;
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: #191919;
  text-align: left;
  list-style: none;
  background-color: #FFFFFF;
  background-clip: padding-box;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Show dropdown on hover (desktop) or with .show class (Bootstrap JS) */
@media (min-width: 992px) {
  .dropdown:hover .dropdown-menu {
    display: block;
  }
}

.dropdown.show .dropdown-menu {
  display: block;
}

.dropdown-menu-end {
  right: 0;
  left: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.625rem 1rem;
  clear: both;
  font-weight: 400;
  color: #191919;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: #191919;
  background-color: #F5F5F5;
}

.dropdown-item svg {
  flex-shrink: 0;
}

.dropdown-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid #E8E8E8;
}

/* Navbar Actions - Right side */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 992px) {
  .navbar-actions {
    margin-top: 0;
    margin-left: 1rem;
  }
}

/* Auth Buttons Container */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 992px) {
  .auth-buttons {
    width: auto;
  }
}

/* Login Button */
.btn-login {
  color: #191919;
  background: transparent;
  border: 1px solid #E8E8E8;
  border-radius: 6px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-login:hover {
  background: #F8F8F8;
  border-color: #191919;
  color: #191919;
}

.btn-login:focus {
  outline: 2px solid #FFD93D;
  outline-offset: 2px;
}

/* Sign Up Button */
.btn-signup {
  background: #FFD93D;
  color: #191919;
  border: 1px solid #FFD93D;
  border-radius: 6px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-signup:hover {
  background: #FFC93D;
  border-color: #FFC93D;
  color: #191919;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 217, 61, 0.3);
}

.btn-signup:focus {
  outline: 2px solid #FFD93D;
  outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 991px) {
  .navbar-collapse {
    padding-top: 1rem;
    border-top: 1px solid #E8E8E8;
    margin-top: 1rem;
  }

  .navbar-nav {
    width: 100%;
  }

  .nav-link {
    padding: 0.75rem 1rem;
  }

  .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin-top: 0;
    border: 0;
    box-shadow: none;
    background-color: #F8F8F8;
    padding: 0.5rem;
    border-radius: 6px;
  }

  .navbar-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .auth-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-login,
  .btn-signup {
    width: 100%;
    justify-content: center;
  }
}

/* Smooth transitions */
.navbar-collapse {
  transition: height 0.35s ease;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .navbar-collapse,
  .nav-link,
  .btn-login,
  .btn-signup,
  .dropdown-item {
    transition: none;
  }
}
