/* ==========================================================================
   Dashboard Top Navigation — douniondashnav.css
   Scoped to .dash-top-nav — separate from:
     • dounion.css       → .top-nav
     • dosu-premium.css  → .premium-top-nav
   ========================================================================== */

/* ── Layout ── */
.dash-top-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-nav, 1000);
  height: var(--nav-height, 2.8125rem);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--color-primary, #36011f);
  box-shadow: 0 4px 20px rgba(54, 1, 31, 0.08);
  transition: box-shadow 0.35s ease, background 0.35s ease;
  padding: 0;
}

.dash-top-nav.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 30px rgba(54, 1, 31, 0.13);
}

/* ── Inner container ── */
.dash-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 0.75rem;
}

/* ── Logo ── */
.dash-logo-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.dash-logo-link:hover {
  opacity: 0.85;
}

.dash-logo-img {
  height: calc(var(--nav-height, 2.8125rem) - 0.5rem);
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(54, 1, 31, 0.15));
  transition: transform 0.3s ease;
}

.dash-logo-link:hover .dash-logo-img {
  transform: scale(1.06) rotate(-2deg);
}

.dash-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.dash-logo-main {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--color-primary, #36011f);
  letter-spacing: -0.5px;
}

.dash-logo-sub {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--color-secondary, #001d4d);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  opacity: 0.75;
  margin-top: 2px;
}

/* ── Hamburger toggle (mobile) ── */
.dash-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: calc(var(--nav-height, 2.8125rem) - 0.4rem);
  height: calc(var(--nav-height, 2.8125rem) - 0.4rem);
  background: rgba(54, 1, 31, 0.06);
  border: none;
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.dash-nav-toggle:hover {
  background: rgba(54, 1, 31, 0.12);
}

.dash-hamburger-box {
  width: 1.375rem;
  height: 1.1rem;
  position: relative;
}

.dash-hamburger-inner {
  display: block;
  width: 100%;
  height: 0.175rem;
  background: var(--color-primary, #36011f);
  border-radius: 2px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

.dash-hamburger-inner::before,
.dash-hamburger-inner::after {
  content: '';
  display: block;
  width: 100%;
  height: 0.175rem;
  background: var(--color-primary, #36011f);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.dash-hamburger-inner::before { top: -0.45rem; }
.dash-hamburger-inner::after  { bottom: -0.45rem; }

/* Animated X state */
.dash-nav-toggle.open .dash-hamburger-inner {
  background: transparent;
}
.dash-nav-toggle.open .dash-hamburger-inner::before {
  transform: rotate(45deg);
  top: 0;
}
.dash-nav-toggle.open .dash-hamburger-inner::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* ── Nav panel ── */
.dash-nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.dash-nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  height: 100%;
}

/* ── Nav items ── */
.dash-nav-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-secondary, #001d4d);
  text-decoration: none;
  border-radius: 0.4rem;
  transition: all 0.25s ease;
  position: relative;
}

.dash-nav-list li a:hover {
  background: rgba(54, 1, 31, 0.07);
  color: var(--color-primary, #36011f);
  transform: translateY(-1px);
}

.dash-nav-list li a img {
  height: 1.1rem;
  width: auto;
  display: block;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.dash-nav-list li a:hover img {
  opacity: 1;
  transform: scale(1.12) rotate(4deg);
}

/* ── Logout button (last item) ── */
.dash-nav-list li:last-child a {
  background: linear-gradient(135deg, var(--color-primary, #36011f) 0%, #590635 100%);
  color: #ffffff !important;
  border-radius: 1.25rem;
  padding: 0.3rem 0.9rem;
  border: none;
  box-shadow: 0 4px 12px rgba(54, 1, 31, 0.25);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dash-nav-list li:last-child a:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(54, 1, 31, 0.35);
  background: linear-gradient(135deg, #590635 0%, var(--color-primary, #36011f) 100%);
}

.dash-nav-list li:last-child a img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .dash-nav-toggle {
    display: flex;
  }

  .dash-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(280px, 80vw);
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: calc(var(--nav-height, 2.8125rem) + 1rem) 1.25rem 2rem;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
    transition: right 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
    align-items: flex-start;
    z-index: calc(var(--z-nav, 1000) - 1);
  }

  .dash-nav.open {
    right: 0;
  }

  .dash-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    height: auto;
    width: 100%;
  }

  .dash-nav-list li a {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    background: rgba(54, 1, 31, 0.03);
  }

  .dash-nav-list li:last-child a {
    margin-top: 0.75rem;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
  }
}
