/*--- functions/styles/navbar.css ---*/

/* === Header === */
.site-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--cc-header);
  color: var(--cc-header-text);
}

/* === Container === */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 86px;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

/* === Logo === */
.logo img {
  height: 86px;
  max-height: 86px;
  object-fit: contain;
  display: block;
}

/* === Navigation === */
.nav-links > ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links > ul > li {
  position: relative;
}

.nav-links a {
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: block;
  color: var(--cc-header-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background-color: rgba(234, 211, 205, 0.16);
  color: var(--cc-header-text);
  outline: none;
}

/* === Dropdown (Services) === */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  border-radius: 4px;
  padding: 0.5rem 0;
  min-width: 200px;
  z-index: 1000;
  white-space: nowrap;
  margin: 0;
  background-color: var(--cc-header);
  border: 1px solid rgba(234, 211, 205, 0.14);
  box-shadow: 0 16px 30px rgba(16, 12, 12, 0.45);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
  color: var(--cc-header-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: rgba(234, 211, 205, 0.14);
  color: var(--cc-header-text);
}

/* JS toggles this */
.dropdown-menu.show {
  display: block;
}

/* === Hamburger === */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  width: 25px;
  margin: 4px 0;
  transition: 0.4s;
  background: var(--cc-header-text);
}

/* === Login Dropdown === */
.login-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  border-radius: 4px;
  padding: 1rem;
  min-width: 220px;
  box-shadow: 0 16px 30px rgba(16, 12, 12, 0.35);
  z-index: 999;
  background: var(--cc-secondary);
  color: var(--cc-secondary-text);
}

.login-dropdown form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-dropdown input {
  padding: 0.5rem;
  border-radius: 3px;
  border: 1px solid rgba(234, 211, 205, 0.3);
  background: rgba(61, 33, 26, 0.55);
  color: var(--cc-secondary-text);
}

.login-dropdown button {
  border: none;
  padding: 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  background: var(--cc-accent);
  color: var(--cc-accent-text);
  transition: background 0.2s ease, transform 0.1s ease;
}

.login-dropdown button:hover {
  background: #086f7f;
  transform: translateY(-1px);
}

.login-dropdown.show {
  display: block;
}

.signup-link {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.signup-link a {
  text-decoration: none;
}

.signup-link a:hover {
  text-decoration: underline;
}

/* === Dashboard Dropdown === */
.dashboard-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  border-radius: 4px;
  padding: 0.5rem 0;
  min-width: 180px;
  z-index: 1000;
  background: var(--cc-header);
  border: 1px solid rgba(234, 211, 205, 0.14);
  box-shadow: 0 16px 30px rgba(16, 12, 12, 0.35);
}

.dashboard-dropdown li {
  list-style: none;
}

.dashboard-dropdown a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
  color: var(--cc-header-text);
}

.dashboard-dropdown.show {
  display: block;
}

.hidden {
  display: none !important;
}

/* === Mobile Navbar Background Fix === */
@media (max-width: 768px) {
  .nav-links ul {
    background-color: var(--cc-header);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    position: static;
  }

  .nav-links ul.active {
    display: flex;
  }

  .nav-links ul > li {
    width: 100%;
  }

  .nav-links a {
    width: 100%;
    color: #d5d5d5;
  }

  /* ✅ Mobile dropdown now expands inline and pushes other links down */
  .dropdown-menu {
    position: static;
    background: rgba(0, 0, 0, 0.3);
    width: 100%;
    margin-top: 0.5rem;
    padding-left: 1rem;
    box-shadow: none;
    border-radius: 4px;
    display: none;
  }

  .dropdown-menu.show {
    display: block;
  }

  .dropdown-menu a {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    color: var(--cc-header-text);
  }

  .dropdown-menu a:hover {
    background-color: rgba(234, 211, 205, 0.14);
    color: var(--cc-header-text);
  }
}
