/* ========================================
   Scholarion Student Information System by Atturra Styles
   ======================================== */

/* ========================================
   1. CSS CUSTOM PROPERTIES (VARIABLES)
   ======================================== */
:root {

  /* ------------------------------------
     Brand Colors
     Core brand identity colors
     ------------------------------------ */
  --scholarion-primary: #004c45;
  --scholarion-primary-dark: #0f3a3a; /* Darker Teal - Darker accent for hover states */  
  --scholarion-secondary: #2d8a8a;
  --scholarion-secondary-light: #a6d4d4; /* Light Teal - Lighter secondary for subtle elements */  
  --scholarion-secondary-rgb: 15, 107, 90;  /* Used for rgba() with opacity */
  --scholarion-tertiary: #6c757d;
  --scholarion-tertiary-light: #f8f9fa;
  --scholarion-tertiary-dark: #374151;
  --scholarion-accent: #d97706;

  /* ------------------------------------
     Neutrals & Surface Colors
     Background, foreground, and border colors
     ------------------------------------ */
  --scholarion-bg: #ffffff;
  --scholarion-fg: #afe0d0;
  --scholarion-surface: #ffffff;
  --scholarion-border: #e9ecef;
  --scholarion-text: #000;
  --scholarion-text-secondary: #1a7a7a;
  --scholarion-text-muted: #495057;

  /* ------------------------------------
     Semantic Feedback Colors
     Success, warning, danger, info states
     ------------------------------------ */
  --scholarion-success: #08bb82;
  --scholarion-warning: #f3a826;
  --scholarion-danger: #ff0000;
  --scholarion-danger-ring: color-mix(in oklab, var(--scholarion-danger), white 75%);

  /* ------------------------------------
     Alert System
     Alert background and spacing
     ------------------------------------ */
  --scholarion-alert: color-mix(in srgb, var(--scholarion-warning) 40%, white 60%);
  --scholarion-alert-padding-x: 1rem;
  --scholarion-alert-padding-y: 1rem;
  --scholarion-validation-colour: #78350f;

  /* ------------------------------------
     Visual Effects
     Gradients, shadows, elevation
     ------------------------------------ */
  --scholarion-grad-1: linear-gradient(135deg,
      var(--scholarion-primary) 0%,
      color-mix(in oklab, var(--scholarion-primary) 80%, black) 100%);
  --scholarion-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.01);
  --scholarion-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --scholarion-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
  --scholarion-shadow-colour: rgba(0, 0, 0, 0.01);
  --scholarion-shadow-colour-hover: rgba(0, 0, 0, 0.2);

  /* ------------------------------------
     Focus & Selection States
     User interaction feedback
     ------------------------------------ */
  --scholarion-selection-bg: var(--scholarion-secondary);
  --scholarion-selection-fg: #fff;
  --scholarion-caret: var(--scholarion-secondary);

  /* ------------------------------------
     Header Component Tokens
     ------------------------------------ */
  --scholarion-header-fg: #afe0d0;
  --scholarion-header-bg: var(--scholarion-primary);
  --scholarion-header-fg-muted: #afe0d0;
  --scholarion-header-hover: #0b1515;
  --scholarion-header-border: #e9ecef;  /* rgba(0, 0, 0, 0.12) */
  --scholarion-header-font: Poppins, sans-serif;
  --scholarion-header-title-font: var(--scholarion-header-font);
  --scholarion-header-title-weight: 400;

  /* ------------------------------------
     Footer Component Tokens
     ------------------------------------ */
  --scholarion-footer-font: var(--scholarion-header-font);
  --scholarion-footer-bg: var(--scholarion-primary);
  --scholarion-footer-fg: #afe0d0;
  --scholarion-footer-fg-muted: #afe0d0;
  --scholarion-footer-link: #afe0d0;
  --scholarion-footer-link-hover: #d97706;

  /* ------------------------------------
     Link Tokens
     ------------------------------------ */
  --scholarion-link: var(--scholarion-secondary);
  --scholarion-link-hover: var(--scholarion-accent);

  /* ------------------------------------
     Navigation Tokens
     ------------------------------------ */
  --scholarion-nav-active-colour: #fff;
  --scholarion-nav-hover-colour: #fff;
  --scholarion-nav-active-bg: color-mix(in srgb, var(--scholarion-secondary) 90%, white);
  --scholarion-nav-parent-bg: color-mix(in srgb, var(--scholarion-secondary) 92%, white);
  --scholarion-nav-child-bg: color-mix(in srgb, var(--scholarion-secondary) 95%, white);

  /* ------------------------------------
     Typography System
     Font families, sizes, line heights
     ------------------------------------ */
  --scholarion-font-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --scholarion-font-serif: "Georgia", "Times New Roman", serif;
  --scholarion-font-mono: "Consolas", "Courier New", monospace;
  
  /* Font Size Scale (fluid, responsive) */
  --scholarion-fs-100: 0.875rem;  /* 14px - small text */
  --scholarion-fs-200: 1rem;  /* 16px - body text */
  --scholarion-fs-300: 1.125rem;  /* 18px */
  --scholarion-fs-400: 1.25rem;  /* 20px */
  --scholarion-fs-500: 1.5rem;  /* 24px - h3 */
  --scholarion-fs-600: 1.75rem;  /* 28px - h2 */
  
  /* Line Height Scale */
  --scholarion-lh-tight: 1.2;
  --scholarion-lh-default: 1.5;
  --scholarion-lh-loose: 1.75;

  /* ------------------------------------
     Layout Dimensions
     ------------------------------------ */
  --scholarion-header-h: 90px;
  --scholarion-header-h-mobile: 72px;
  --scholarion-footer-h: 72px;
  --scholarion-nav-w: 280px;
  --scholarion-nav-w-collapsed: 60px;
  --scholarion-footer-pad-x: 16px;
  --scholarion-gap: 24px;


  /* ------------------------------------
     Readonly Field Tokens
     Distinctive styling for non-editable form fields
     ------------------------------------ */
  --scholarion-readonly-border: #ccc;
  --scholarion-readonly-bg: #f2f2f2;

  /* ------------------------------------
     Toast Notification Tokens
     Semantic colors for success and danger toasts
     ------------------------------------ */
  --scholarion-toast-success-bg: #f3fbf3;
  --scholarion-toast-success-border: #c8e9c5;
  --scholarion-toast-success-fg: #146c2e;
  --scholarion-toast-save-bg: #1e7e34;
  --scholarion-toast-danger-bg: #fef3f2;
  --scholarion-toast-danger-border: #f5c2c0;
  --scholarion-toast-danger-fg: #b42318;

  /* ------------------------------------
     Filter Pill Tokens
     Tab-style filter button colors
     ------------------------------------ */
  --scholarion-pill-border: #d1d5db;
  --scholarion-pill-bg: #ffffff;
  --scholarion-pill-fg: #374151;
  --scholarion-pill-hover-bg: #f3f4f6;
  --scholarion-pill-hover-border: #9ca3af;
  --scholarion-pill-card-border: #e5e7eb;
  --scholarion-pill-title-fg: #1f2937;

  /* ------------------------------------
     Subgrid Theme Tokens
     ------------------------------------ */
  --scholarion-grid-bg: #fff;
  --scholarion-grid-border: rgba(0, 0, 0, 0.08);
  --scholarion-grid-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  --scholarion-grid-header-bg: #f7f9fb;
  --scholarion-grid-header-fg: #1b1f2a;
  --scholarion-grid-row-hover: #f4f7fb;
  --scholarion-grid-row-alt: #fbfcfe;
  --scholarion-grid-text: #27313f;
  --scholarion-grid-muted: #637083;

  /* ------------------------------------
     Transitions
     ------------------------------------ */
  --scholarion-transition-fast: 0.2s ease;
  --scholarion-transition-normal: 0.3s ease;
  --scholarion-transition-slow: 0.5s ease;

}

:root {

  /* ------------------------------------
     Site Branding
     ------------------------------------ */
  --scholarion-logo-url: url("/images-sis-sp-logo.png"); /* Main site logo */
  --scholarion-logo-white-url: url("/images-sis-sp-logo.png"); /* White version for dark backgrounds */
  --scholarion-logo-height: 70px; /* Default logo height */
  --scholarion-logo-width: auto; /* Default logo width */
  --scholarion-logo-aria-label: "Scholarion Student Information System by Atturra"; /* Accessible label for logo */
  --scholarion-logo-alt-text: "Scholarion Student Information System by Atturra"; /* Alt text for img tags */
}
/* ========================================
   2. TIMETABLE CUSTOM PROPERTIES
   ======================================== */
:root {
  /* Timetable color scheme - using Atturra dark teal theme */
  /* Primary colors will inherit from brand colors */
  --timetable-colour-primary: var(--scholarion-primary);
  --timetable-colour-primary-light: var(--scholarion-primary);
  --timetable-colour-primary-dark: var(--scholarion-primary-dark);
  --timetable-colour-primary-accent: var(--scholarion-secondary);

  /* Secondary colors - complementary to dark teal */
  --timetable-colour-secondary: #d97706; /* Warm orange for contrast */
  --timetable-colour-secondary-light: #fbbf24; /* Light orange */
  --timetable-colour-secondary-dark: #b45309; /* Dark orange */

  /* Tertiary colors */
  --timetable-colour-tertiary: var(--scholarion-tertiary);
  --timetable-colour-tertiary-light: var(--scholarion-tertiary-light);
  --timetable-colour-tertiary-dark: #374151;

  /* Event type colors - harmonized with dark teal theme */
  --timetable-colour-core: #059669; /* Emerald green */
  --timetable-colour-core-light: rgba(5, 150, 105, 0.1);
  --timetable-colour-core-border: #047857;

  --timetable-colour-elective: #0891b2; /* Cyan blue */
  --timetable-colour-elective-light: rgba(8, 145, 178, 0.1);
  --timetable-colour-elective-border: #0e7490;

  --timetable-colour-sport: #ea580c; /* Orange red */
  --timetable-colour-sport-light: rgba(234, 88, 12, 0.1);
  --timetable-colour-sport-border: #c2410c;

  --timetable-colour-assembly: #7c3aed; /* Purple */
  --timetable-colour-assembly-light: rgba(124, 58, 237, 0.1);
  --timetable-colour-assembly-border: #6d28d9;

  --timetable-colour-break: #64748b; /* Slate */
  --timetable-colour-break-light: rgba(100, 116, 139, 0.1);
  --timetable-colour-break-border: #475569;

  /* Layout variables */
  --timetable-time-column-width: 100px;
  --timetable-day-header-height: 80px;
  --timetable-event-slot-height: 70px;
  --timetable-grid-gap: 1px;
  --timetable-border-radius: 8px;
  --timetable-border-radius-small: 4px;

  /* Typography - inheriting from brand where appropriate */
  --timetable-font-family-primary: var(--scholarion-font-sans);
  --timetable-font-size-base: 0.875rem;
  --timetable-font-size-small: 0.75rem;
  --timetable-font-size-tiny: 0.65rem;
  --timetable-font-weight-normal: 400;
  --timetable-font-weight-medium: 500;
  --timetable-font-weight-semibold: 600;
  --timetable-font-weight-bold: 700;

  /* Shadows - using existing brand shadows where appropriate */
  --timetable-shadow-small: var(--scholarion-shadow-sm);
  --timetable-shadow-medium: var(--scholarion-shadow-md);
  --timetable-shadow-large: var(--shadow-heavy);

  /* Transitions - using existing brand transitions where appropriate */
  --timetable-transition-fast: var(--scholarion-transition-fast);
  --timetable-transition-normal: var(--scholarion-transition-normal);
  --timetable-transition-slow: var(--scholarion-transition-slow);
}

/* ========================================
   3. BASE STYLES
   ======================================== */
body {
  font-family: var(--scholarion-font-sans);
  margin: 0;
  padding: 0 0 var(--scholarion-footer-h) 0;
  overflow-x: hidden;
  background-color: #f5f5f5;
}

/* ========================================
   4. HEADER & NAVIGATION
   ======================================== */

/* Navbar - Enhanced specificity for reliable styling */
.navbar,
nav.navbar,
.navbar.navbar-expand-lg,
nav.navbar.navbar-expand-lg {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%) !important;
  background-color: var(--scholarion-primary) !important;
  /* Fallback */
  height: var(--scholarion-header-h);
  box-shadow: var(--scholarion-shadow-sm);
  z-index: 1030;
  border-bottom: 3px solid var(--scholarion-secondary);
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100% !important;
}

/* Ensure navbar background persists on all states */
.navbar:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  z-index: -1;
}

/* Override any Bootstrap navbar variants */
.navbar-light,
.navbar-dark,
.navbar.navbar-light,
.navbar.navbar-dark {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%) !important;
  background-color: var(--scholarion-primary) !important;
}

/* Ensure container maintains background */
.navbar .container-fluid {
  background: transparent;
  position: relative;
  z-index: 1;
}

/* Site Logo - Primary img tag approach */
.navbar-brand .site-logo {
  height: var(--scholarion-logo-height);
  width: var(--scholarion-logo-width);
  max-height: var(--scholarion-logo-height);
  transition: height var(--scholarion-transition-normal);
  object-fit: contain;
}

/* Logo fallback using background-image */
.navbar-brand .logo-bg-fallback {
  background-image: var(--scholarion-logo-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  height: var(--scholarion-logo-height);
  width: var(--scholarion-logo-width);
  min-width: 200px;
  /* Ensure minimum width for visibility */
  transition: height var(--scholarion-transition-normal);
}

/* Legacy logo classes (kept for compatibility) */
.navbar-brand .logo {
  height: var(--scholarion-logo-height);
  width: var(--scholarion-logo-width);
  transition: height var(--scholarion-transition-normal);
  object-fit: contain;
}

.navbar-brand .logo-bg {
  background-image: var(--scholarion-logo-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  height: var(--scholarion-logo-height);
  width: var(--scholarion-logo-width);
  min-width: 200px;
  transition: height var(--scholarion-transition-normal);
}

/* White logo variants */
.navbar-brand .logo-white {
  height: var(--scholarion-logo-height);
  width: var(--scholarion-logo-width);
  transition: height var(--scholarion-transition-normal);
  object-fit: contain;
}

.navbar-brand .logo-white-bg {
  background-image: var(--scholarion-logo-white-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  height: var(--scholarion-logo-height);
  width: var(--scholarion-logo-width);
  min-width: 200px;
  transition: height var(--scholarion-transition-normal);
}

/* Logo error state styling */
.navbar-brand .logo-fallback {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive logo sizing */
@media (max-width: 992px) {
  .navbar-brand .site-logo,
  .navbar-brand .logo,
  .navbar-brand .logo-bg,
  .navbar-brand .logo-bg-fallback {
    height: 60px !important;
  }
}

@media (max-width: 768px) {
  .navbar-brand .site-logo,
  .navbar-brand .logo,
  .navbar-brand .logo-bg,
  .navbar-brand .logo-bg-fallback {
    height: min(50px, 8vw) !important;
    max-height: 50px;
  }
}

@media (max-width: 480px) {
  .navbar-brand .site-logo,
  .navbar-brand .logo,
  .navbar-brand .logo-bg,
  .navbar-brand .logo-bg-fallback {
    height: 40px !important;
  }
}

.navbar-brand .brand-text {
  font-family: var(--scholarion-font-serif);
  font-weight: 600;
  font-size: 1.1rem;
}

.navbar-nav .nav-link {
  color: white !important;
  font-weight: 500;
  transition: all var(--scholarion-transition-normal);
  border-radius: 4px;
  margin: 0 2px;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--scholarion-secondary-light) !important;
}

/* User Avatar Styles */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--scholarion-secondary);
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--scholarion-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--scholarion-primary);
}

/* ========================================
   5. LAYOUT CONTAINERS - FIXED FOR POWER PAGES STUDIO WITH PROPER SPACING
   ======================================== */
.main-container {
  display: flex;
  min-height: calc(100vh - var(--scholarion-header-h) - var(--scholarion-footer-h));
  margin-top: var(--scholarion-header-h);
  margin-bottom: 0;
}

/* FIXED: Main content area - remove problematic margin-left and add proper spacing */
.main-content {
  flex: 1;
  /* Remove the fixed margin-left that causes the wide left margin issue */
  margin-left: 0 !important;
  /* Add padding-left with extra spacing to account for sidebar + gap */
  padding-left: calc(var(--scholarion-nav-w) + 2rem);
  padding-top: 1.5rem;
  padding-right: 2rem;
  padding-bottom: 2rem;
  transition: padding-left var(--scholarion-transition-normal);
  overflow-y: auto;
  height: calc(100vh - var(--scholarion-header-h) - var(--scholarion-footer-h));
  max-height: none;
  width: 100%;
}

.main-content.sidebar-collapsed {
  padding-left: calc(var(--scholarion-nav-w-collapsed) + 2rem);
}

/* Ensure Power Pages Studio wrapper elements don't interfere */
.main-content .row.sectionBlockLayout {
  margin: 0 !important;
  padding: 8px !important;
  width: 100%;
}

.main-content .container {
  padding: 0 !important;
  max-width: none !important;
  width: 100%;
}

.main-content .col-lg-12.columnBlockLayout {
  padding: 0 !important;
  width: 100%;
  flex-grow: 1;
}

/* ========================================
   6. SIDEBAR NAVIGATION - FIXED JUMPY HOVER EFFECTS
   ======================================== */
.sidebar {
  width: var(--scholarion-nav-w);
  background: linear-gradient(180deg, var(--scholarion-tertiary-light) 0%, #ffffff 100%);
  border-right: 1px solid #dee2e6;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  transition: all var(--scholarion-transition-normal);
  position: fixed;
  top: var(--scholarion-header-h);
  left: 0;
  height: calc(100vh - var(--scholarion-header-h) - var(--scholarion-footer-h));
  overflow-y: auto;
  z-index: 1020;
}

.sidebar.collapsed {
  width: var(--scholarion-nav-w-collapsed);
  overflow-x: hidden;
}

/* Sidebar Header */
.sidebar-header {
  padding: 1rem;
  background: linear-gradient(135deg, var(--scholarion-primary-dark) 0%, var(--scholarion-primary) 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--scholarion-secondary);
}

.sidebar-header:hover {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
}

.sidebar-header .toggle-icon {
  font-size: 1.2rem;
  transition: transform var(--scholarion-transition-normal);
}

.sidebar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.sidebar-header .sidebar-title {
  font-weight: 600;
  font-family: var(--scholarion-font-sans);
  transition: opacity var(--scholarion-transition-normal);
}

.sidebar.collapsed .sidebar-title {
  opacity: 0;
  display: none;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav .nav-item {
  border-bottom: 1px solid #e9ecef;
  position: relative;
}

/* FIXED: Sidebar Navigation Items - Prevent jiggling on hover */
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: var(--scholarion-primary);
  text-decoration: none;
  transition: background-color var(--scholarion-transition-fast), color var(--scholarion-transition-fast), border-left-color
    var(--scholarion-transition-fast);
  gap: 0.75rem;
  font-weight: 500;
  border-left: 4px solid transparent; /* Always reserve space for border */
  padding-left: calc(1rem - 4px); /* Adjust padding to account for border */
  box-sizing: border-box; /* Ensure consistent box model */
}

.sidebar-nav .nav-link:hover {
  background: linear-gradient(90deg, var(--scholarion-secondary-light) 0%, transparent 100%);
  color: var(--scholarion-primary);
  border-left-color: var(--scholarion-secondary); /* Only change color, not width */
}

/* FIXED: Active States - Consistent spacing */
.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  color: #fff;
  border-left-color: var(--scholarion-secondary);
  font-weight: 600;
}

.sidebar-nav .nav-link.active-parent {
  background: linear-gradient(90deg, var(--scholarion-primary) 0%, rgba(74, 144, 194, 0.3) 100%);
  color: var(--scholarion-primary);
  border-left-color: var(--scholarion-secondary);
  font-weight: 600;
}

.sidebar-nav .nav-link.active-parent:hover {
  background: linear-gradient(90deg, var(--scholarion-primary) 0%, rgba(74, 144, 194, 0.3) 100%);
  color: var(--scholarion-primary);
  border-left-color: var(--scholarion-secondary);
}

/* FIXED: Dropdown Items - Completely prevent any movement */
.sidebar-nav .dropdown-item {
  display: block;
  padding: 0.625rem 1rem 0.625rem 3rem;
  color: var(--scholarion-tertiary);
  font-weight: 400;
  text-decoration: none;
  transition: background-color var(--scholarion-transition-fast), color var(--scholarion-transition-fast);

  /* Ensure absolutely no layout shifts */
  border: none;
  border-left: 3px solid transparent;
  margin: 0;
  box-sizing: border-box;
  position: relative;
  width: 100%;

  /* Lock all positioning properties */
  left: 0;
  right: 0;
  transform: none;

  /* Prevent any text or content shifts */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav .dropdown-item:hover {
  background-color: var(--scholarion-secondary-light);
  color: var(--scholarion-primary);
  border-left-color: var(--scholarion-secondary);

  /* Explicitly maintain all layout properties */
  padding: 0.625rem 1rem 0.625rem 3rem;
  margin: 0;
  transform: none;
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
}

.sidebar-nav .dropdown-item.active {
  background: linear-gradient(90deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--scholarion-secondary);

  /* Maintain consistency in active state */
  padding: 0.625rem 1rem 0.625rem 3rem;
  margin: 0;
  transform: none;
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
}

.sidebar-nav .dropdown-item.active:hover {
  background: linear-gradient(90deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  color: #fff;
  border-left-color: var(--scholarion-secondary);

  /* Lock everything in place for active hover */
  padding: 0.625rem 1rem 0.625rem 3rem;
  margin: 0;
  transform: none;
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
}

/* Ensure dropdown menu container is stable */
.sidebar-nav .dropdown-menu,
.sidebar-nav .collapse {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  position: static;
  width: 100%;
  background: transparent;
}

/* Navigation Icons and Text */
.sidebar-nav .nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.sidebar-nav .nav-text {
  transition: opacity var(--scholarion-transition-normal);
  font-weight: 500;
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  display: none;
}

/* Dropdown Menus */
.sidebar-nav .dropdown-menu {
  position: static;
  float: none;
  width: 100%;
  margin-top: -2px;
  padding-top: 2px;
  background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
  border: none;
  border-radius: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Collapsed Sidebar Behavior */
.sidebar.collapsed .fas.fa-chevron-down,
.sidebar.collapsed .ms-auto,
.sidebar.collapsed .dropdown-menu,
.sidebar.collapsed .collapse {
  display: none !important;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 0.875rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  border-left: none; /* Remove border in collapsed state */
  padding-left: 0.5rem; /* Reset padding in collapsed state */
}

.sidebar.collapsed .nav-link span:not(.nav-icon) {
  display: none;
}

.sidebar.collapsed .nav-icon {
  margin: 0 auto;
  width: auto;
}

.sidebar.collapsed .nav-link[data-bs-toggle="collapse"] {
  pointer-events: none;
}

.sidebar.collapsed .nav-link[data-bs-toggle="collapse"]:hover {
  background: none;
  border-left: none;
  padding-left: 0.5rem;
}

/* ========================================
   6. CONTENT COMPONENTS
   ======================================== */

     /* Loading spinners */
     .loading::before {
       font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif;
       /* Fallback added */
       font-weight: 900;
       /* Required for solid Font Awesome icons */
       content: "\f110";
       /* Unicode for fa-spinner icon */
  
       display: inline-block;
       /* Ensures the icon behaves correctly */
       margin-right: 0.5em;
       /* Adds some space between the icon and the text */
  
       /* Apply Font Awesome's spin animation */
       -webkit-animation: fa-spin 1s infinite linear;
       /* Slower spin: 2s, Faster: 1s */
       animation: fa-spin 1s infinite linear;
     }

/* Content Cards */
.content-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--scholarion-shadow-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.content-card-header {
  background: linear-gradient(135deg, var(--scholarion-tertiary-light) 0%, #ffffff 100%);
  padding: 1.25rem;
  border-bottom: 2px solid var(--scholarion-secondary);
  font-weight: 600;
  font-family: var(--scholarion-font-sans);
}

.content-card-header h1 {
  color: var(--scholarion-primary);
  font-family: var(--scholarion-font-sans);
  margin: 0;
}

.content-card-body {
  padding: 2rem;
}

/* Dashboard Widgets */
.dashboard-widget {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--scholarion-shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--scholarion-secondary);
}

.widget-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.widget-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--scholarion-primary-dark) 0%, var(--scholarion-primary) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
}

.widget-title {
  font-weight: 600;
  color: var(--scholarion-primary);
  margin: 0;
  font-family: var(--scholarion-font-sans);
}

/* Grade and Assignment Items */
.grade-item,
.assignment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.assignment-item {
  padding: 0.75rem 0;
}

.grade-item:last-child,
.assignment-item:last-child {
  border-bottom: none;
}

.grade-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
}

.due-date {
  font-size: 0.875rem;
  color: var(--scholarion-tertiary);
}

.due-soon {
  color: #dc3545;
  font-weight: 600;
}

.overdue {
  color: #dc3545;
  font-weight: 600;
}

/* ========================================
   7. NAVIGATION COMPONENTS
   ======================================== */

/* Breadcrumbs */
.breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-item a {
  color: var(--scholarion-primary-dark);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--scholarion-primary);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--scholarion-tertiary);
}

/* ========================================
   8. MODAL COMPONENTS
   ======================================== */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: var(--shadow-heavy);
}

.modal-header {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  color: white !important;
  border-radius: 12px 12px 0 0;
  padding: 1.5rem;
  border-bottom: none;
}

.modal-title {
  color: white !important;
  font-weight: 600;
  font-size: 1.25rem;
  font-family: var(--scholarion-font-sans);
}

.modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%) !important;
  opacity: 0.8;
  background: none;
  border: none;
}

.modal-header .btn-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.modal-header .btn-close:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* ========================================
   9. FOOTER
   ======================================== */
.footer {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  color: #fff;
  padding: 0.5rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--scholarion-footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 3px solid var(--scholarion-secondary);
  z-index: 1000;
}

.footer-column {
  flex: 1;
  text-align: center;
  padding: 0 1rem;
}

.footer-sl .list-inline {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-sl .list-inline li {
  list-style: none;
}

.footer-sl .list-inline a {
  color: #fff;
  font-size: 1.5rem;
  transition: color var(--scholarion-transition-normal);
}

.footer-sl .list-inline a:hover {
  color: var(--scholarion-secondary-light);
}

.footer-aoc a,
.footer-pp a {
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--scholarion-transition-normal);
}

.footer-aoc a:hover,
.footer-pp a:hover {
  color: var(--scholarion-secondary-light);
  text-decoration: underline;
}

.footer-pp .list-unstyled {
  margin: 0;
  padding: 0;
}

.footer-pp .list-unstyled li {
  list-style: none;
  margin-bottom: 0.25rem;
}

/* ========================================
   10. BUTTON STYLES & BOOTSTRAP OVERRIDES
   ======================================== */
.btn-primary,
.main-content .btn-primary,
.content-card .btn-primary,
.dashboard-widget .btn-primary {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 500;
  border-radius: 8px;
  transition: all var(--scholarion-transition-normal);
}

.btn-secondary{
    border-radius: 8px !important;
}

.btn-primary:hover,
.main-content .btn-primary:hover,
.content-card .btn-primary:hover,
.dashboard-widget .btn-primary:hover {
  background: linear-gradient(135deg, #0a2c4a 0%, var(--scholarion-primary) 100%);
  border: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 64, 106, 0.3);
}

.btn-primary:focus,
.main-content .btn-primary:focus,
.content-card .btn-primary:focus,
.dashboard-widget .btn-primary:focus {
  background: linear-gradient(135deg, var(--scholarion-primary) 0%, var(--scholarion-primary-dark) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(14, 64, 106, 0.25);
}

.btn-primary:active,
.main-content .btn-primary:active,
.content-card .btn-primary:active,
.dashboard-widget .btn-primary:active {
  background: var(--scholarion-primary) !important;
  border: none !important;
  color: white !important;
}

.btn-outline-primary {
  color: var(--scholarion-primary-dark);
  border-color: var(--scholarion-primary-dark);
  border-radius: 8px;
  transition: all var(--scholarion-transition-normal);
}

.btn-outline-primary:hover {
  background-color: var(--scholarion-primary-dark);
  border-color: var(--scholarion-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 81, 140, 0.3);
}

/* Button Size Variants */
.dashboard-widget .btn-sm {
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
}

.dashboard-widget .btn-lg {
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
}

.content-card .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   11. DROPDOWN & FORM COMPONENTS
   ======================================== */
.dropdown-menu {
  border: none;
  box-shadow: var(--scholarion-shadow-md);
  border-radius: 8px;
}

.dropdown-item:hover {
  background-color: var(--scholarion-secondary-light);
  color: var(--scholarion-primary);
}

.dropdown-header {
  background-color: var(--scholarion-tertiary-light);
  border-bottom: 1px solid #dee2e6;
}

.badge {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ========================================
   12. UTILITY CLASSES
   ======================================== */

/* Portrait Images */
.portrait {
  width: 200px;
  height: 200px;
  border: 1px solid rgba(0, 0, 0, 0.165);
  transition: transform var(--scholarion-transition-slow);
  object-fit: cover;
  transform: scale(1);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--scholarion-tertiary);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--scholarion-primary);
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDropdown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* ========================================
   13. RESPONSIVE DESIGN
   ======================================== */

/* Desktop Hover Effects */
@media (min-width: 769px) {
  .sidebar-nav .nav-item.dropdown-parent:hover .collapse:not([data-persistent="true"]) {
    display: block !important;
    animation: fadeInDropdown var(--scholarion-transition-fast);
  }

  .sidebar-nav .collapse.show {
    display: block !important;
  }

  .sidebar-nav .nav-item[data-dropdown-persistent="true"]:hover .collapse {
    display: block !important;
  }
}

/* Tablet Breakpoint */
@media (max-width: 992px) {
  .navbar-brand img {
    height: 60px !important;
    width: auto;
  }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
  /* Header Adjustments */
  .navbar-brand img {
    height: min(50px, 8vw) !important;
    width: auto;
    max-height: 50px;
  }

  .navbar-brand .brand-text {
    font-size: 0.8rem;
    font-weight: 600;
  }

  /* Sidebar Mobile Behavior */
  .sidebar {
    transform: translateX(-100%);
    width: var(--scholarion-nav-w);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  /* Main Content Mobile - FIXED */
  .main-content {
    padding-left: 0 !important;
    margin-left: 0 !important;
    padding: 1rem;
  }

  .main-content.sidebar-collapsed {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  .content-card-body {
    padding: 1.5rem;
  }

  /* Mobile Overlay */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    display: none;
  }

  .mobile-overlay.show {
    display: block;
  }

  /* Footer Mobile */
  .footer {
    padding: 0.25rem 0;
    height: auto;
    min-height: 50px;
  }

  .footer-column {
    padding: 0 0.5rem;
  }

  .footer-sl .list-inline {
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0;
  }

  .footer-sl .list-inline a {
    font-size: 1.5rem;
    padding: 0.25rem;
  }

  .footer .container-fluid {
    padding: 0 1rem;
  }

  .footer .row {
    text-align: center;
    margin: 0;
    min-height: auto;
  }

  .footer .col-md-4 {
    margin-bottom: 0;
    padding: 0;
  }

  .footer-sl {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
  }

  .footer-aoc,
  .footer-pp {
    display: none !important;
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  .navbar-brand img {
    height: 40px !important;
    width: auto;
  }

  .navbar-brand .brand-text {
    font-size: 0.7rem;
    font-weight: 600;
  }
}

/* Extra Small Devices */
@media (max-width: 360px) {
  .navbar-brand img {
    height: 35px !important;
    width: auto;
  }
}

/* ========================================
   14. BROWSER-SPECIFIC FIXES
   ======================================== */

/* Edge Browser Dropdown Fixes */
.sidebar-nav .nav-item[data-dropdown-persistent="true"] .collapse {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  transition: none !important;
}

.sidebar-nav .nav-item[data-dropdown-persistent="true"] .collapse.show {
  display: block !important;
}

/* ========================================
   LAYOUT FIXES FOR POWER PAGES STUDIO
   ======================================== */

/* Layout Fixes */
html, body {
  overflow-x: hidden;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Ensure content doesn't get cut off */
.main-content > * {
  max-width: 100%;
  overflow-x: auto;
}

/* Fix for any nested containers */
.main-content .container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Additional fixes for common Power Pages elements */
.main-content .page-header {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.main-content .page-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Fullscreen overlay background */
.overlay {
  position: fixed;          /* Stays fixed on screen */
  top: 0;
  left: 0;
  width: 100%;              /* Cover full width */
  height: 100%;             /* Cover full height */
  background-color: rgba(0,0,0,0.5); /* Greyed out background */
  display: flex;            /* Use flexbox for centering */
  justify-content: center;  /* Center horizontally */
  align-items: center;      /* Center vertically */
  z-index: 1050;            /* High z-index so it sits above content */
}

/* Hidden state (overlay not visible) */
.overlay.hidden {
  display: none;
}

.spinner-border {
  color: var(--scholarion-primary);
}

.hidden {
    display: none !important;
}

/* ========================================
   END OF STYLESHEET
   ======================================== */