/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  /* Application core backgrounds */
  --bg-app: #f8fafc; /* slate-50 */
  --bg-panel: #ffffff;
  --bg-element: #f1f5f9; /* slate-100 */
  --bg-hover: #f8fafc; /* slate-50 */
  --bg-inverse: #0f172a; /* slate-900 */
  
  /* Borders */
  --border-subtle: #f1f5f9; /* slate-100 */
  --border-base: #e2e8f0; /* slate-200 */
  --border-strong: #cbd5e1; /* slate-300 */
  
  /* Text */
  --text-core: #0f172a; /* slate-900 */
  --text-muted: #64748b; /* slate-500 */
  --text-faint: #94a3b8; /* slate-400 */
  --text-inverse: #ffffff;
}

:root.dark {
  /* Application core backgrounds (Dark Theme) */
  --bg-app: #020617; /* slate-950 (Absolute background) */
  --bg-panel: #0f172a; /* slate-900 (Matches Sidenav) */
  --bg-element: #1e293b; /* slate-800 (Fields, Table Headers) */
  --bg-hover: #334155; /* slate-700 (Distinct hover highlights) */
  --bg-inverse: #f8fafc; /* slate-50 (For inverted blocks) */
  
  /* Borders (Dark theme) */
  --border-subtle: #1e293b; /* slate-800 */
  --border-base: #334155; /* slate-700 */
  --border-strong: #475569; /* slate-600 (Clear active borders) */
  
  /* Text (Dark theme - Enhanced for Legibility) */
  --text-core: #ffffff; /* pure white (Primary readables) */
  --text-muted: #cbd5e1; /* slate-300 (Secondary/Descriptions) */
  --text-faint: #94a3b8; /* slate-400 (Tertiary/Subtle) */
  --text-inverse: #0f172a; /* slate-900 */
}

/* --- Sidebar Theme Engine CSS Variables --- */
:root {
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(0, 0, 0, 0.06);
  --sidebar-text: #0f172a;
  --sidebar-muted: #64748b;
  --sidebar-hover-bg: rgba(0, 0, 0, 0.03);
  --sidebar-active-bg: rgba(37, 99, 235, 0.06);
}

.dark {
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.04);
  --sidebar-active-bg: rgba(255, 255, 255, 0.06);
}

/* Sidebar Custom Theme: Slate */
.sidebar-slate {
  --sidebar-bg: #e2e8f0; /* gorgeous darker slate background */
  --sidebar-border: rgba(15, 23, 42, 0.08);
  --sidebar-text: #0f172a;
  --sidebar-muted: #475569;
  --sidebar-hover-bg: rgba(15, 23, 42, 0.04);
  --sidebar-active-bg: rgba(15, 23, 42, 0.06);
}
.dark.sidebar-slate, .dark .sidebar-slate {
  --sidebar-bg: #0b1120; /* distinct elegant dark slate-950 */
  --sidebar-border: rgba(255, 255, 255, 0.15); /* crisp divided border line */
  --sidebar-text: #f8fafc; /* bright readable text */
  --sidebar-muted: #94a3b8; /* readable muted text */
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);
}

/* Sidebar Custom Theme: Navy (brand — matches the login/landing dark panel) */
.sidebar-indigo {
  --sidebar-bg: #0a1628; /* brand navy-950, same as the instructor login brand panel */
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #f8fafc;
  --sidebar-muted: #94a3b8;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(56, 189, 248, 0.14);
}
.dark.sidebar-indigo, .dark .sidebar-indigo {
  --sidebar-bg: #070f1d; /* even deeper navy in dark mode */
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(56, 189, 248, 0.16);
}

/* Force white logo to display whenever the sidebar is a dark theme */
.sidebar-indigo body > aside .dark\:hidden {
  display: none !important;
}
.sidebar-indigo body > aside .hidden.dark\:block {
  display: block !important;
}


/* ==========================================================================
   SIDEBAR CUSTOM CONTRAST THEME ENGINE OVERRIDES
   These rules cascade over hardcoded Tailwind utility classes in views.
   ========================================================================== */

/* 1. Sidenav Container & Card Boxes overrides */
.sidebar-slate body > aside {
  background-color: var(--sidebar-bg) !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-text) !important;
}

/* Profiles, footer borders, child divs styling */
.sidebar-slate body > aside div {
  border-color: var(--sidebar-border) !important;
}

/* 2. Text elements contrast alignment */
.sidebar-slate body > aside span,
.sidebar-slate body > aside p,
.sidebar-slate body > aside summary {
  color: var(--sidebar-text) !important;
}

/* Upper-case sidebar section titles (Workspace, System, Logs) - slightly muted for clean hierarchy */
.sidebar-slate body > aside p[class*="tracking"] {
  color: var(--sidebar-muted) !important;
  opacity: 0.8 !important;
}

/* Subtle labels / Version identifiers alignment */
.sidebar-slate body > aside span[class*="text-slate-500"] {
  color: var(--sidebar-muted) !important;
}

/* 3. Inactive / Hoverable Navigation Items styling */
.sidebar-slate body > aside nav a,
.sidebar-slate body > aside details summary,
.sidebar-slate body > aside div a {
  color: var(--sidebar-muted) !important;
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  --tw-ring-color: transparent !important;
}

.sidebar-slate body > aside nav a:hover,
.sidebar-slate body > aside details summary:hover {
  color: var(--sidebar-text) !important;
  background-color: var(--sidebar-hover-bg) !important;
}

/* Nested spans inside links inherit parent colors (active/inactive states) */
.sidebar-slate body > aside nav a span,
.sidebar-slate body > aside div a span {
  color: inherit !important;
}

/* Dynamic svg icons opacity support */
.sidebar-slate body > aside nav a svg,
.sidebar-slate body > aside summary svg {
  color: var(--sidebar-muted) !important;
  opacity: 0.8 !important;
  transition: all 0.2s ease;
}

.sidebar-slate body > aside nav a:hover svg,
.sidebar-slate body > aside summary:hover svg {
  color: var(--sidebar-text) !important;
  opacity: 1 !important;
}

/* 4. Active Navigation Highlights overrides — filled pill, matching the
   student portal sidebar (replaces the old flat left-border treatment). */
.sidebar-slate body > aside nav a.ring-1 {
  background-color: var(--sidebar-active-bg) !important;
  color: var(--brand-primary, #2563eb) !important;
  --tw-ring-color: transparent !important;
  box-shadow: none !important;
}

.sidebar-slate body > aside nav a.ring-1 svg {
  color: var(--brand-primary, #2563eb) !important;
  opacity: 1 !important;
}

/* High contrast support in Dark Mode for Active Items */
.dark.sidebar-slate body > aside nav a.ring-1,
.dark .sidebar-slate body > aside nav a.ring-1 {
  color: #3b82f6 !important; /* premium visible sky blue */
}

.dark.sidebar-slate body > aside nav a.ring-1 svg,
.dark .sidebar-slate body > aside nav a.ring-1 svg {
  color: #3b82f6 !important;
}

/* 5. Details elements containers styling */
.sidebar-slate body > aside details {
  border-color: transparent !important;
}

/* Appearance Customize dropdown box header overrides */
.sidebar-slate body > aside details summary[class*="group/appearance"] {
  background-color: transparent !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-text) !important;
}

.sidebar-slate body > aside details summary[class*="group/appearance"]:hover {
  background-color: var(--sidebar-hover-bg) !important;
}

/* Appearance Customize dropdown inner content panel */
.sidebar-slate body > aside details div[class*="bg-white"] {
  background-color: transparent !important;
  border-color: var(--sidebar-border) !important;
}

/* Accent Color swatches box */
.sidebar-slate body > aside details div[class*="bg-slate-50"] {
  background-color: var(--sidebar-hover-bg) !important;
  border-color: var(--sidebar-border) !important;
}

.sidebar-slate body > aside details div[class*="bg-slate-50"] button {
  border-color: var(--sidebar-border) !important;
}

/* 6. Footer card & Sign Out button areas */
.sidebar-slate body > aside div[class*="border-t"] {
  background-color: transparent !important;
  backdrop-filter: none !important;
  border-color: var(--sidebar-border) !important;
}

/* Sign Out button container / actual button */
.sidebar-slate body > aside div[class*="border-t"] form button,
.sidebar-slate body > aside div[class*="border-t"] button[class*="bg-white"] {
  background-color: transparent !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-text) !important;
}

.sidebar-slate body > aside div[class*="border-t"] form button:hover,
.sidebar-slate body > aside div[class*="border-t"] button[class*="bg-white"]:hover {
  background-color: rgba(239, 68, 68, 0.08) !important; /* elegant red hover glow */
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

/* Interface Mode toggle card */
.sidebar-slate body > aside #theme-toggle {
  background-color: var(--sidebar-hover-bg) !important;
  border-color: var(--sidebar-border) !important;
}
.sidebar-slate body > aside #theme-toggle span {
  color: var(--sidebar-text) !important;
}

/* ==========================================================================
   NAVY (brand) SIDEBAR CONTRAST OVERRIDES
   Same cascade as slate above, tuned for the dark navy ground. Active items
   use a filled sky-blue pill (matching the student portal navy sidebar and
   the login brand panel) rather than the slate theme's flat left border.
   ========================================================================== */

/* 1. Container */
.sidebar-indigo body > aside {
  background-color: var(--sidebar-bg) !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-text) !important;
}
.sidebar-indigo body > aside div {
  border-color: var(--sidebar-border) !important;
}

/* 2. Text elements */
.sidebar-indigo body > aside span,
.sidebar-indigo body > aside p,
.sidebar-indigo body > aside summary {
  color: var(--sidebar-text) !important;
}
.sidebar-indigo body > aside p[class*="tracking"] {
  color: var(--sidebar-muted) !important;
  opacity: 0.8 !important;
}
.sidebar-indigo body > aside span[class*="text-slate-500"] {
  color: var(--sidebar-muted) !important;
}

/* 3. Inactive / hoverable nav items */
.sidebar-indigo body > aside nav a,
.sidebar-indigo body > aside details summary,
.sidebar-indigo body > aside div a {
  color: var(--sidebar-muted) !important;
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  --tw-ring-color: transparent !important;
}
.sidebar-indigo body > aside nav a:hover,
.sidebar-indigo body > aside details summary:hover {
  color: var(--sidebar-text) !important;
  background-color: var(--sidebar-hover-bg) !important;
}
.sidebar-indigo body > aside nav a span,
.sidebar-indigo body > aside div a span {
  color: inherit !important;
}
.sidebar-indigo body > aside nav a svg,
.sidebar-indigo body > aside summary svg {
  color: var(--sidebar-muted) !important;
  opacity: 0.8 !important;
  transition: all 0.2s ease;
}
.sidebar-indigo body > aside nav a:hover svg,
.sidebar-indigo body > aside summary:hover svg {
  color: var(--sidebar-text) !important;
  opacity: 1 !important;
}

/* 4. Active nav item — filled sky pill, keeps rounded corners */
.sidebar-indigo body > aside nav a.ring-1 {
  background-color: var(--sidebar-active-bg) !important;
  color: #38bdf8 !important;
  --tw-ring-color: transparent !important;
  box-shadow: none !important;
}
.sidebar-indigo body > aside nav a.ring-1 svg {
  color: #38bdf8 !important;
  opacity: 1 !important;
}

/* 5. Details containers */
.sidebar-indigo body > aside details {
  border-color: transparent !important;
}
.sidebar-indigo body > aside details summary[class*="group/appearance"] {
  background-color: transparent !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-text) !important;
}
.sidebar-indigo body > aside details summary[class*="group/appearance"]:hover {
  background-color: var(--sidebar-hover-bg) !important;
}
.sidebar-indigo body > aside details div[class*="bg-white"] {
  background-color: transparent !important;
  border-color: var(--sidebar-border) !important;
}
.sidebar-indigo body > aside details div[class*="bg-slate-50"] {
  background-color: var(--sidebar-hover-bg) !important;
  border-color: var(--sidebar-border) !important;
}
.sidebar-indigo body > aside details div[class*="bg-slate-50"] button {
  border-color: var(--sidebar-border) !important;
}

/* 6. Footer + Sign Out */
.sidebar-indigo body > aside div[class*="border-t"] {
  background-color: transparent !important;
  backdrop-filter: none !important;
  border-color: var(--sidebar-border) !important;
}
.sidebar-indigo body > aside div[class*="border-t"] form button,
.sidebar-indigo body > aside div[class*="border-t"] button[class*="bg-white"] {
  background-color: transparent !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-text) !important;
}
.sidebar-indigo body > aside div[class*="border-t"] form button:hover,
.sidebar-indigo body > aside div[class*="border-t"] button[class*="bg-white"]:hover {
  background-color: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

/* Interface Mode toggle card */
.sidebar-indigo body > aside #theme-toggle {
  background-color: var(--sidebar-hover-bg) !important;
  border-color: var(--sidebar-border) !important;
}
.sidebar-indigo body > aside #theme-toggle span {
  color: var(--sidebar-text) !important;
}

/* Keep the "New Training" primary CTA blue on navy — don't let the generic
   nav-link override flatten it. */
.sidebar-indigo body > aside nav a[class*="bg-blue-600"] {
  background-color: #2563eb !important;
  color: #ffffff !important;
}
.sidebar-indigo body > aside nav a[class*="bg-blue-600"] svg,
.sidebar-indigo body > aside nav a[class*="bg-blue-600"] span {
  color: #ffffff !important;
}
.sidebar-indigo body > aside nav a[class*="bg-blue-600"]:hover {
  background-color: #1d4ed8 !important;
}

/* ==========================================================================
   ACTIVE NAV GLOW DOT — same active-item language as the student portal
   sidebar (filled pill + trailing glow dot). Applies across all sidebar
   themes; active links are marked with ring-1 in the layout.
   ========================================================================== */
body > aside a.ring-1::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--brand-primary, #2563eb);
  box-shadow: 0 0 8px var(--brand-primary, #2563eb);
  margin-left: auto;
  flex-shrink: 0;
}
/* When the active link already carries a right-aligned count badge,
   tuck the dot beside the badge instead of fighting it for the space. */
body > aside a.ring-1:has([class*="ml-auto"])::after {
  margin-left: 0.5rem;
}
/* Sky dot on the navy sidebar (matches the login brand accents) */
.sidebar-indigo body > aside a.ring-1::after {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

/* ==========================================================================
   SIDEBAR SCROLLBAR — thin, rounded, tinted from the sidebar palette so it
   fits every theme (the .custom-scrollbar class was previously undefined,
   which left the browser's default scrollbar on the navy sidebar).
   ========================================================================== */
.custom-scrollbar {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: color-mix(in srgb, var(--sidebar-muted) 35%, transparent) transparent;
}
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--sidebar-muted) 35%, transparent);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--sidebar-muted) 65%, transparent);
}


