/**
 * cockpit-sidebar-navigation.css
 * Dedicated stylesheet for AUTOGRADING Scientific System Navigation Architecture.
 * Modular CSS enforcing SOLID (SRP), SoC, Apple HIG & Material 3 standards.
 * Responsive: Mobile 360px -> Tablet 768px -> Desktop 1440px+.
 */

/* ====================================================================
   1. PEDAGOGICAL NAVIGATION SECTION HEADERS & PILLS
   ==================================================================== */
.cockpit-sidebar .nav-section-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 10px 4px 10px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: var(--muted, #64748b) !important;
}

.cockpit-sidebar .section-pill,
.cockpit-sidebar .sidebar-system-info {
  display: none !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 1px 7px !important;
  border-radius: 999px !important;
  line-height: 1.3 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.cockpit-sidebar .pill-indigo {
  background: rgba(79, 70, 229, 0.12) !important;
  color: #4f46e5 !important;
}
.cockpit-sidebar .pill-amber {
  background: rgba(217, 119, 6, 0.14) !important;
  color: #b45309 !important;
}
.cockpit-sidebar .pill-emerald {
  background: rgba(5, 150, 105, 0.14) !important;
  color: #047857 !important;
}

[data-theme="dark"] .cockpit-sidebar .pill-indigo {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #a5b4fc !important;
}
[data-theme="dark"] .cockpit-sidebar .pill-amber {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fcd34d !important;
}
[data-theme="dark"] .cockpit-sidebar .pill-emerald {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #6ee7b7 !important;
}

/* Nav Item Micro Polish */
.cockpit-sidebar .nav-item {
  transition: background 0.15s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease !important;
}
.cockpit-sidebar .nav-item:hover {
  background: var(--surface-3, rgba(0, 0, 0, 0.04)) !important;
}
.cockpit-sidebar .nav-item.active {
  background: var(--primary-soft, #e0f2fe) !important;
  color: var(--primary-text, #0369a1) !important;
  font-weight: 650 !important;
}
[data-theme="dark"] .cockpit-sidebar .nav-item.active {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #38bdf8 !important;
}

/* ====================================================================
   2. BOTTOM UTILITIES TRAY (Zalo, Sổ tay cẩm nang, Trợ lý hỗ trợ)
   ==================================================================== */
.cockpit-sidebar .utility-actions-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  margin: 6px 0 2px 0 !important;
}

.cockpit-sidebar .utility-actions-row .btn-util-icon,
.cockpit-sidebar .utility-actions-row .nav-item {
  flex: 1 1 0% !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 33.33% !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  background: var(--surface-2, #ffffff) !important;
  color: var(--text-muted, #64748b) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 0 4px !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.cockpit-sidebar .utility-actions-row .btn-util-icon:hover,
.cockpit-sidebar .utility-actions-row .nav-item:hover {
  background: var(--surface-3, #f1f5f9) !important;
  color: var(--text, #0f172a) !important;
  border-color: var(--primary, #0284c7) !important;
}

.cockpit-sidebar .utility-actions-row .btn-util-icon svg,
.cockpit-sidebar .utility-actions-row .nav-item svg {
  flex-shrink: 0 !important;
}

[data-theme="dark"] .cockpit-sidebar .btn-util-icon {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] .cockpit-sidebar .btn-util-icon:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
  border-color: #38bdf8 !important;
}

/* ====================================================================
   3. MOBILE BOTTOM DOCK (5-Tab Apple HIG Standard)
   ==================================================================== */
@media (max-width: 1024px) {
  .mobile-bottom-dock {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: var(--surface-1, #ffffff) !important;
    border-top: 1px solid var(--border, #e2e8f0) !important;
    z-index: 3800 !important;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
  }

  [data-theme="dark"] .mobile-bottom-dock {
    background: #0f172a !important;
    border-color: #1e293b !important;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.3) !important;
  }

  .mobile-bottom-dock .dock-role-group:not([style*="display: none"]) {
    grid-column: 1 / -1 !important;
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: space-around !important;
  }

  .mobile-bottom-dock .dock-role-group[style*="display: none"] {
    display: none !important;
  }

  .mobile-bottom-dock .dock-item {
    flex: 1 1 20% !important;
    max-width: 20% !important;
    height: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    background: transparent !important;
    border: none !important;
    color: var(--muted, #64748b) !important;
    font-size: 10px !important;
    font-weight: 550 !important;
    padding: 2px 0 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    position: relative !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-bottom-dock .dock-item .bi {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
  }

  .mobile-bottom-dock .dock-item svg {
    width: 19px !important;
    height: 19px !important;
    stroke-width: 2 !important;
  }

  .mobile-bottom-dock .dock-item span:not(.bi) {
    display: block !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 95% !important;
  }

  .mobile-bottom-dock .dock-item.active {
    color: var(--primary, #0284c7) !important;
    font-weight: 750 !important;
  }
  [data-theme="dark"] .mobile-bottom-dock .dock-item.active {
    color: #38bdf8 !important;
  }

  /* Mobile Drawer Sliding Polish */
  aside.cockpit-sidebar.open .utility-actions-row {
    display: flex !important;
  }
}
