/* ==========================================================================
   SHARED LEFT-SIDE HAMBURGER NAVIGATION DRAWER
   ========================================================================== */

.header-left-group {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.header-left-group .logo-link {
  min-width: 0;
  text-align: left;
  align-items: flex-start;
}

.site-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--subtle-bg, rgba(255, 255, 255, 0.03));
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  z-index: 1002;
}

.site-menu-toggle:hover {
  background: var(--bg-tertiary, rgba(148, 163, 184, 0.12));
  border-color: var(--border-hover, rgba(148, 163, 184, 0.25));
}

.site-menu-toggle:focus-visible {
  outline: 2px solid var(--primary-accent, var(--accent, #38bdf8));
  outline-offset: 2px;
}

.site-menu-toggle .bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-menu-toggle.open .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-menu-toggle.open .bar:nth-child(2) {
  opacity: 0;
}

.site-menu-toggle.open .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.site-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.site-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(84vw, 310px);
  background: var(--bg-secondary, #0f172a);
  color: var(--text-primary);
  border-right: 1px solid var(--border-color);
  box-shadow: none;
  z-index: 2000;
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.28s, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.site-drawer.open {
  transform: translateX(0);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s, box-shadow 0.28s ease;
}

.site-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 1.8rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.site-drawer-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-drawer-brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.site-drawer-brand-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

.site-drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--subtle-bg, rgba(255, 255, 255, 0.03));
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-drawer-close:hover {
  background: var(--bg-tertiary, rgba(148, 163, 184, 0.12));
  color: var(--text-primary);
}

.site-drawer-body {
  padding: 1.4rem 1.2rem 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1 1 auto;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.drawer-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 1rem 0.4rem;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  min-height: 44px;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 1.45rem;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.drawer-nav-item i,
.drawer-nav-item svg {
  width: 20px;
  height: 20px;
  text-align: center;
  font-size: 1.45rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.drawer-nav-item:hover {
  background: var(--subtle-bg, rgba(255, 255, 255, 0.04));
  color: var(--text-primary);
}

.drawer-nav-item:hover i,
.drawer-nav-item:hover svg {
  color: var(--primary-accent, var(--accent, #38bdf8));
}

.drawer-nav-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--primary-accent, var(--accent, #38bdf8));
  font-weight: 600;
}

.drawer-nav-item.active i,
.drawer-nav-item.active svg {
  color: var(--primary-accent, var(--accent, #38bdf8));
}

.drawer-nav-item.danger:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fb7185;
}

.drawer-nav-item.danger:hover i,
.drawer-nav-item.danger:hover svg {
  color: #fb7185;
}

.drawer-nav-item.drawer-sub-item {
  padding-left: 3.4rem;
  min-height: 38px;
  font-size: 1.35rem;
}

.drawer-nav-item.drawer-sub-item i,
.drawer-nav-item.drawer-sub-item svg {
  width: 16px;
  height: 16px;
  font-size: 1.25rem;
}

body.drawer-open {
  overflow: hidden;
}

@media screen and (max-width: 768px) {
  .site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    height: auto !important;
    z-index: 1000 !important;
  }

  .header-container {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    padding: 0.9rem 1.4rem !important;
    min-height: 58px;
  }

  .header-left-group {
    gap: 1rem;
  }

  .header-left-group .logo-link {
    text-align: left !important;
    align-items: flex-start !important;
  }

  .logo-name {
    font-size: 1.55rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .logo-title {
    font-size: 1rem !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: left !important;
    line-height: 1.2 !important;
  }

  /* Replace legacy right-side mobile toggle with left-side drawer */
  .site-header .menu-toggle {
    display: none !important;
  }

  .site-header .main-nav {
    display: flex !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    justify-content: flex-end !important;
    flex-shrink: 0;
  }

  .site-header .nav-list {
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0.6rem !important;
    width: auto !important;
    margin: 0 !important;
  }

  .site-header .nav-list > li:not(.theme-toggle-container) {
    display: none !important;
  }

  .site-header .theme-toggle-container {
    margin-top: 0 !important;
    width: auto !important;
    gap: 0.6rem !important;
  }

  .site-main {
    padding-top: 8.6rem !important;
  }
}

@media print {
  .site-menu-toggle,
  .site-drawer,
  .site-drawer-backdrop {
    display: none !important;
  }
}
