/* ==========================================================================
   DEFORMITY CORRECTION HULL - SIDEBAR NAVIGATION (Clean & Executive)
   Left-hand navigation with icons, active indicators, and mobile drawer
   ========================================================================== */

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--dch-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(0, 28, 56, 0.15);
  transition: transform var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Brand Header */
.sidebar-brand {
  padding: 1.85rem 1.25rem;
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide desktop brand header on mobile: mobile header already has the logo */
@media (max-width: 900px) {
  .app-sidebar .sidebar-brand,
  .sidebar-brand {
    display: none !important;
  }
}

.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.brand-main-logo {
  display: block;
  width: 100%;
  max-width: 265px;
  height: auto;
  max-height: 98px;
  object-fit: contain;
  transition: transform var(--transition-base);
}

.brand-link:hover .brand-main-logo {
  transform: scale(1.03);
}

.mobile-brand-logo {
  height: 52px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--dch-blue-light);
  border: 1px solid rgba(2, 132, 199, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  color: #0369a1;
  align-self: flex-start;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
  animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
  0% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(2, 132, 199, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0);
  }
}

/* Navigation Menu */
.sidebar-nav {
  padding: 1.25rem 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  margin-top: 0.4rem;
}

/* Nav Link Item */
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  user-select: none;
  background: transparent;
  border: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-link svg.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: transform var(--transition-fast), color var(--transition-fast);
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

/* Hover State */
.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
}

.nav-link:hover svg.nav-icon {
  color: #ffffff;
}

/* Active State */
.nav-link.active {
  color: #ffffff;
  background: #0284c7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-link.active svg.nav-icon {
  color: #ffffff;
}

/* Physical Connection Beacon to Main Content on Desktop */
@media (min-width: 1025px) {
  .nav-link {
    position: relative;
    overflow: visible;
  }
  .nav-link.active::before {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 10px #38bdf8, 0 0 18px #0284c7;
    animation: navPulseAnchor 1.8s infinite ease-in-out;
    z-index: 20;
  }
  .nav-link.active::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, transparent);
    box-shadow: 0 0 8px #38bdf8;
    pointer-events: none;
    z-index: 15;
    transition: width 0.3s ease;
  }
  .nav-link.connecting-beam::after {
    width: 32px;
    right: -32px;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    box-shadow: 0 0 12px #38bdf8, 0 0 24px rgba(56, 189, 248, 0.8);
  }
}

@keyframes navPulseAnchor {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.9; }
  50% { transform: translateY(-50%) scale(1.4); opacity: 1; box-shadow: 0 0 14px #38bdf8, 0 0 24px #38bdf8; }
}

/* Submenu Dropdown Container (for Visiting) */
.nav-parent {
  display: flex;
  flex-direction: column;
}

.nav-arrow-icon {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-base);
  color: rgba(255, 255, 255, 0.5);
}

.nav-parent.open .nav-arrow-icon {
  transform: rotate(90deg);
  color: #ffffff;
}

.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 2.75rem;
  padding-right: 0.5rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--transition-base), opacity var(--transition-base), padding var(--transition-base);
}

.nav-parent.open .nav-submenu {
  max-height: 180px;
  opacity: 1;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
}

.subnav-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.subnav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.subnav-link.active {
  color: #38bdf8;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
}

/* Sidebar Footer & Quick Tools */
.sidebar-footer {
  padding: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 20, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Royal College Badge Card */
.sidebar-cpd-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cpd-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fef3c7;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cpd-text {
  font-size: 0.76rem;
  color: #ffffff;
  line-height: 1.25;
}

.cpd-text strong {
  display: block;
  font-size: 0.82rem;
  color: #fbbf24;
}

/* Action Button Row */
.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  z-index: 10000;
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform;
  box-sizing: border-box;
}

.mobile-header .btn {
  padding: 0.34rem 0.72rem !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

.mobile-menu-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--dch-navy);
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-menu-btn.active {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--dch-blue);
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 28, 56, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
