/* ###### MENU ###### */

/* Admin account link (visible when admin is logged in) */
.admin-nav-link {
  background: none;
  border: none;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  padding: 0.375rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease;
  text-decoration: none;
  z-index: 10;
}

.admin-nav-link .material-symbols-outlined {
  font-size: 1.75rem;
}

.admin-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

#cimer {
  height: 10rem;
  margin-bottom: -8.5rem;
  margin-left: 3rem;
  margin-right: 3rem;
  transform: translateY(-1rem);
  transition: transform 0.3s ease;
  transform-origin: center top;
  position: relative;
}
.menu-bg {
  width: 100%;
  position: sticky;
  top: 0;
  background-color: #0f5238;
  z-index: 50;
  overflow: visible;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);

  .dark & {
    background-color: oklch(21.6% 0.006 56.043);
  }
}
.menu-bar {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-block: 1.5rem;
}
.menu-part {
  display: flex;
  flex: 1;
  gap: 3rem;
  align-items: center;
}
.menu-element {
  display: flex;
  flex: 1;
  justify-content: center;
  color: #ffffff;
  font-weight: 500;
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.75rem;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;

  &:hover {
    color: #d1fae5;
  }

  &.selected {
    color: #ffffff;
    font-weight: 800;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 0.25rem;
  }
}

/* Dropdown */
.menu-dropdown {
  position: relative;
  display: flex;
  flex: 1;
  justify-content: center;
  .menu-element {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    cursor: pointer;
    background: none;
  }
  .dropdown-arrow {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
  }
  &.open .dropdown-arrow {
    transform: rotate(180deg);
  }
  .dropdown-panel {
    position: absolute;
    top: 100%;
    margin-top: 0.5rem;
    width: 12rem;
    background-color: #1B4332;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    .dropdown-item {
      display: block;
      padding: 0.5rem 1rem;
      font-size: 0.875rem;
      color: #ffffff;
      transition: background-color 0.15s ease;
    }

    .dropdown-item:hover {
      background-color: #2D6A4F;
    }

    .dropdown-item.selected {
      background-color: #2D6A4F;
      font-weight: 700;
      border-left: 3px solid #ffffff;
      padding-left: calc(1rem - 3px);
    }
  }

  &.open .dropdown-panel {
    opacity: 1;
    visibility: visible;
  }
}

/* Keep outermost dropdown panels inside the viewport */
@media (max-width: 1250px) {
  .mobile-pali-link + .menu-part > .menu-dropdown:first-child .dropdown-panel {
    left: 0;
  }
  .menu-bar > a + .menu-part > .menu-dropdown:last-child .dropdown-panel {
    right: 0;
  }
}

/* ###### MOBILE NAV (< 950px) ###### */

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #ffffff;
  flex-shrink: 0;
}

.hamburger-btn .material-symbols-outlined {
  font-size: 2rem;
}

.mobile-pali-link {
  display: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  flex: 1;
}

/* Mobile slide-in drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 75vw;
  max-width: 300px;
  height: 100%;
  background-color: rgb(251 249 244);
  z-index: 200;
  flex-direction: column;
  gap: 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 16px rgba(0,0,0,0.3);
}

.mobile-drawer-nav {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
  display: block;
  opacity: 1;
}

.mobile-nav-drawer a,
.mobile-nav-drawer button {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  color: #1b1c19;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease;
  border-radius: 0.25rem;
}

.mobile-nav-drawer a:hover,
.mobile-nav-drawer button:hover {
  background-color: #f0f0f0;
}

.mobile-nav-drawer a.selected {
  font-weight: 700;
  background-color: #0f5238;
  color: #ffffff;
  border-left: none;
  padding-left: 1.5rem;
}

.mobile-nav-drawer button.selected {
  font-weight: 700;
  background-color: #0f5238;
  color: #ffffff;
}

.mobile-nav-drawer .mobile-drawer-dropdown-panel a.selected {
  background-color: transparent;
  color: #1b1c19;
  font-weight: 800;
  border-bottom: 2px solid #1b1c19;
  padding-bottom: calc(1rem - 2px);
  border-radius: unset;
}

.mobile-nav-drawer .mobile-drawer-dropdown-panel {
  display: none;
  flex-direction: column;
}

.mobile-nav-drawer .mobile-drawer-dropdown-panel.open {
  display: flex;
}

.mobile-nav-drawer .mobile-drawer-dropdown-panel a {
  padding-left: 2.5rem;
  font-size: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.mobile-drawer-toggle-btn {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background-color: #0f5238;
  border-bottom: none;
  flex-shrink: 0;
}

.mobile-drawer-header img {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
}

.mobile-drawer-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  margin: 0;
}

.mobile-drawer-toggle-btn .dropdown-arrow {
  font-size: 1.2rem;
}

.mobile-drawer-toggle-btn.open .dropdown-arrow {
  transform: rotate(180deg);
}

@media (max-width: 950px) {
  .hamburger-btn {
    display: flex;
    align-items: center;
  }

  .mobile-pali-link {
    display: block;
    border-bottom: none;
    padding-bottom: 0;
  }

  .menu-part {
    display: none;
  }

  #cimer {
    display: none;
  }

  .menu-bar {
    padding-block: 0.75rem;
    justify-content: flex-start;
    gap: 0;
  }

  .mobile-nav-drawer {
    display: flex;
  }
}
