/* ==========================================================================
   Sree vidya vidyalayam AMS - Modern Grouped Collapsible Sidebar Navigation
   ========================================================================== */

.sidebar {
  width: 260px !important;
  flex-shrink: 0 !important;
  background: #2b154e linear-gradient(180deg, #351e5e 0%, #200f38 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  height: 100vh !important;
  box-sizing: border-box !important;
}

.sidebar-logo-container {
  display: flex !important;
  align-items: center !important;
  padding: 1.2rem 1.25rem 1rem 1.25rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 0.4rem !important;
}

.sidebar-logo-sq {
  width: 46px !important;
  height: 46px !important;
  background: linear-gradient(135deg, #6d28d9 0%, #4a1d96 100%) !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  flex-shrink: 0 !important;
}

.sidebar-logo-sq i {
  font-size: 1.5rem !important;
  color: #ffffff !important;
}

.sidebar-brand-text {
  color: #ffffff !important;
  font-weight: 700 !important;
  margin: 0 0 0 12px !important;
  font-size: 1.35rem !important;
  letter-spacing: 0.5px !important;
  line-height: 1 !important;
}

/* --- Navigation Links Container --- */
.sidebar nav,
.sidebar .nav-links {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0.4rem 0 !important;
  min-height: 0 !important;
  scrollbar-width: none !important;
}

/* Subtle invisible scrollbar that reveals on hover if list overflows */
.sidebar nav::-webkit-scrollbar,
.sidebar .nav-links::-webkit-scrollbar {
  width: 4px !important;
  display: none !important;
}
.sidebar:hover nav::-webkit-scrollbar,
.sidebar:hover .nav-links::-webkit-scrollbar {
  display: block !important;
}
.sidebar nav::-webkit-scrollbar-track,
.sidebar .nav-links::-webkit-scrollbar-track {
  background: transparent !important;
}
.sidebar nav::-webkit-scrollbar-thumb,
.sidebar .nav-links::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px !important;
}
.sidebar nav::-webkit-scrollbar-thumb:hover,
.sidebar .nav-links::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45) !important;
}

/* --- Direct Links (e.g. Dashboard) --- */
.sidebar nav a.direct-link,
.sidebar .nav-links a.direct-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  padding: 0.58rem 1.25rem !important;
  margin: 2px 10px !important;
  color: #c4b5fd !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  position: relative !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.sidebar nav a.direct-link i,
.sidebar .nav-links a.direct-link i {
  width: 20px !important;
  font-size: 0.95rem !important;
  text-align: center !important;
  color: #a78bfa !important;
  transition: color 0.2s ease !important;
}
.sidebar nav a.direct-link:hover,
.sidebar .nav-links a.direct-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
.sidebar nav a.direct-link:hover i,
.sidebar .nav-links a.direct-link:hover i {
  color: #ffffff !important;
}
.sidebar nav a.direct-link.active,
.sidebar .nav-links a.direct-link.active {
  background: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4) !important;
}
.sidebar nav a.direct-link.active i,
.sidebar .nav-links a.direct-link.active i {
  color: #ffffff !important;
}

/* --- Accordion Group Container --- */
.nav-group {
  margin: 3px 10px !important;
  border-radius: 10px !important;
  transition: background 0.2s ease !important;
}

/* --- Group Header Button --- */
.nav-group-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.58rem 0.9rem !important;
  color: #c4b5fd !important;
  cursor: pointer !important;
  border-radius: 10px !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  user-select: none !important;
  transition: all 0.2s ease !important;
  background: transparent !important;
}

.nav-group-header:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
}

.nav-group.open > .nav-group-header {
  color: #ffffff !important;
  background: rgba(139, 92, 246, 0.16) !important;
}

.nav-group-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.nav-group-header-left i.group-icon {
  width: 20px !important;
  font-size: 0.92rem !important;
  text-align: center !important;
  color: #a78bfa !important;
  transition: color 0.2s ease !important;
}

.nav-group.open > .nav-group-header .group-icon {
  color: #c4b5fd !important;
}

.nav-group-chevron {
  font-size: 0.72rem !important;
  color: #8e7bb0 !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease !important;
  margin-left: 6px !important;
  flex-shrink: 0 !important;
}

.nav-group.open > .nav-group-header .nav-group-chevron {
  transform: rotate(180deg) !important;
  color: #ffffff !important;
}

/* --- Group Sub-Items Container --- */
.nav-group-items {
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease !important;
  padding: 0 0 0 6px !important;
  display: flex !important;
  flex-direction: column !important;
}

.nav-group.open > .nav-group-items {
  max-height: 400px !important;
  opacity: 1 !important;
  padding-top: 3px !important;
  padding-bottom: 5px !important;
}

/* --- Sub-Item Links --- */
.nav-group-items a,
.sidebar nav .nav-group-items a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0.44rem 0.85rem 0.44rem 1.9rem !important;
  margin: 1px 0 !important;
  color: #d1c4e9 !important;
  text-decoration: none !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  position: relative !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.nav-group-items a i,
.sidebar nav .nav-group-items a i {
  width: 16px !important;
  font-size: 0.78rem !important;
  text-align: center !important;
  color: #a78bfa !important;
  transition: color 0.18s ease !important;
}

.nav-group-items a:hover,
.sidebar nav .nav-group-items a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
.nav-group-items a:hover i {
  color: #ffffff !important;
}

/* Active Sub-item link */
.nav-group-items a.active,
.sidebar nav .nav-group-items a.active {
  background: #7c3aed !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35) !important;
}

.nav-group-items a.active i,
.sidebar nav .nav-group-items a.active i {
  color: #ffffff !important;
}

.nav-group-items a.active::before,
.sidebar nav .nav-group-items a.active::before {
  content: '' !important;
  position: absolute !important;
  left: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 4px !important;
  height: 14px !important;
  background: #ffffff !important;
  border-radius: 3px !important;
}

/* Active Indicator on Group Header when child is active and group collapsed */
.nav-group.has-active:not(.open) > .nav-group-header {
  background: rgba(124, 58, 237, 0.3) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}
.nav-group.has-active:not(.open) > .nav-group-header .group-icon {
  color: #a78bfa !important;
}

/* --- Logout Button --- */
.sidebar .logout {
  margin-top: auto !important;
  padding: 0.85rem 1rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sidebar .logout button {
  width: 100% !important;
  margin: 0 !important;
  background: #e65e4a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0.7rem 1rem !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0.6rem !important;
  transition: all 0.2s ease !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(230, 94, 74, 0.25) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  cursor: pointer !important;
}

.sidebar .logout button:hover {
  background: #f06a56 !important;
  box-shadow: 0 4px 12px rgba(230, 94, 74, 0.4) !important;
}

/* --- Slide-in Sidebar (Mobile & Special Overrides) --- */
.dashboard-slide-sidebar {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 2000 !important;
  transform: translateX(-100%) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  height: 100vh !important;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3) !important;
  border-radius: 0 20px 20px 0 !important;
}

.dashboard-slide-sidebar.open {
  transform: translateX(0) !important;
}

.dashboard-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(12, 8, 30, 0.6) !important;
  backdrop-filter: blur(2px) !important;
  z-index: 1999 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}

.dashboard-overlay.open,
.dashboard-overlay.show {
  opacity: 1 !important;
  pointer-events: auto !important;
}
