/* =================================================================
   DESIGN SYSTEM V5 - Te Kete Ako Educational Resources
   Source of Truth: DESIGN_BRIEF.md
   "Beautiful, Minimalist, Print-First, Modern"
   ================================================================= */

:root {
  /* Core Palette - Te Kete Ako Cultural Colors */
  --color-primary: #1a1a1a; /* Deep Charcoal */
  --color-secondary: #00b0b9; /* Turquoise Blue (Ocean) */
  --color-accent: #f5a623; /* Golden Yellow (Sun) */
  --color-maori-red: #d83c3e; /* Traditional Māori Red */
  --color-earth: #8b6f47; /* Earth Brown (Whenua) */
  --color-forest: #2c5f41; /* Deep Forest Green (Ngahere) */
  --color-cultural-teal: #40e0d0; /* Cultural Teal */

  /* Enhanced Cultural Palette */
  --color-cultural-light: #f0f8f0; /* Light Cultural Background */
  --color-cultural-accent: #e8f4f8; /* Light Teal Background */
  --color-warmth: #fef7ed; /* Warm Cream */
  --color-nature: #ecfdf5; /* Nature Green */

  /* Enhanced Neutrals */
  --color-background: #ffffff; /* Pure White Background */
  --color-surface: #ffffff; /* Pure White */
  --color-card-hover: #f8f9fa; /* Card hover state */
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #6c757d;
  --color-text-muted: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;

  /* Typography */
  --font-headings: "Montserrat", "Helvetica", "Arial", sans-serif;
  --font-body: "Lato", "Helvetica", "Arial", sans-serif;
  --font-special: "Merriweather", "Georgia", serif;

  /* Spacing & Layout */
  --spacing-unit: 8px;
  --content-width: 1600px;
  --sidebar-width: 300px;
  --header-height: 72px;

  /* Shadows & Effects */
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.25s ease;
  --transition-slow: 0.35s ease;
}

/* =================================================================
   GLOBAL STYLES & PRINT SETUP
   ================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  color: var(--color-primary);
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Print-specific styles - Enhanced A4 Printing */
@media print {
  @page {
    size: A4;
    margin: 2cm 1.5cm;
  }

  body {
    background-color: #fff !important;
    font-size: 12pt !important;
    line-height: 1.4 !important;
    color: #000 !important;
  }

  .no-print,
  .site-header,
  .site-footer,
  .left-sidebar {
    display: none !important;
  }

  .main-container {
    display: block !important;
    max-width: none !important;
    padding: 0 !important;
  }

  .content-area {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  h1 {
    font-size: 18pt !important;
    margin-bottom: 12pt !important;
    page-break-after: avoid;
    border-bottom: 2pt solid #000 !important;
    padding-bottom: 6pt !important;
  }

  h2 {
    font-size: 16pt !important;
    margin-top: 16pt !important;
    margin-bottom: 8pt !important;
    page-break-after: avoid;
  }

  h3 {
    font-size: 14pt !important;
    margin-top: 12pt !important;
    margin-bottom: 6pt !important;
    page-break-after: avoid;
  }

  h4,
  h5,
  h6 {
    font-size: 12pt !important;
    margin-top: 8pt !important;
    margin-bottom: 4pt !important;
    page-break-after: avoid;
  }

  p,
  li {
    font-size: 11pt !important;
    line-height: 1.4 !important;
    margin-bottom: 6pt !important;
    orphans: 3;
    widows: 3;
  }

  /* Ensure activity boxes print cleanly */
  .resource-card,
  section[style*="background-color"],
  div[style*="background-color"] {
    background: transparent !important;
    border: 1pt solid #ccc !important;
    padding: 8pt !important;
    margin: 8pt 0 !important;
    page-break-inside: avoid;
  }

  /* Links */
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Lists */
  ul,
  ol {
    margin-left: 12pt !important;
    padding-left: 0 !important;
  }

  li {
    margin-bottom: 4pt !important;
  }

  /* Grid layouts - convert to linear for print */
  .resource-grid,
  div[style*="display: grid"] {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }

  .resource-grid .resource-card {
    margin-bottom: 12pt !important;
    width: 100% !important;
  }

  /* Tables */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10pt !important;
  }

  th,
  td {
    border: 1pt solid #000 !important;
    padding: 4pt !important;
    text-align: left !important;
  }

  /* Page breaks */
  .page-break {
    page-break-before: always;
  }

  .avoid-break {
    page-break-inside: avoid;
  }

  /* Hide interactive elements */
  .filter-bar,
  .nav-dropdown,
  button,
  input[type="submit"] {
    display: none !important;
  }

  /* Ensure good contrast for printed text */
  * {
    color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}

/* =================================================================
   CORE LAYOUT (Main Content + Sidebar)
   ================================================================= */
.main-container {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1600px; /* Increased from var(--content-width) for wider layout */
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
}

/* Updated: Sidebar max-height increased for feature expansion */
.left-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding-right: calc(var(--spacing-unit) * 3);
  align-self: flex-start;
  position: sticky;
  top: calc(var(--spacing-unit) * 3);
  max-height: 2400px; /* Twice as tall for rich, feature-packed sidebars */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

.content-area {
  flex-grow: 1;
  background-color: var(--color-surface);
  padding: calc(var(--spacing-unit) * 4);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: none;
  min-height: 100vh; /* Ensures main content is at least viewport height */
}

.right-sidebar {
  width: 320px;
  flex-shrink: 0;
  padding-left: calc(var(--spacing-unit) * 3);
  align-self: flex-start;
  position: sticky;
  top: calc(var(--spacing-unit) * 3);
  max-height: 2400px; /* Twice as tall for rich, feature-packed sidebars */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

/* =================================================================
   PROFESSIONAL HEADER COMPONENT V2 - Te Kete Ako
   "Flashy, Cultural, Modern, Print-Friendly"
   ================================================================= */

/* Enhanced Header Design */
.site-header {
  background: linear-gradient(
    135deg,
    var(--color-forest) 0%,
    var(--color-secondary) 50%,
    var(--color-cultural-teal) 100%
  );
  border-bottom: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 10000;
  width: 100%;
  min-height: 90px;
  overflow: visible;
}

/* Cultural Pattern Overlay */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(245, 166, 35, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Koru-inspired decorative element */
.site-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: rgba(245, 166, 35, 0.1);
  border-radius: 50% 0 50% 0;
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.5;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 3);
  padding-bottom: 0;
  min-height: 90px;
  position: relative;
  z-index: 2;
}

/* Enhanced Brand/Logo */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-headings);
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  line-height: 1.2;
}

.brand-logo {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  display: inline-block;
}

.brand-logo-svg {
  width: 2.5rem;
  height: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  display: inline-block;
}

.brand-logo-full {
  height: 3.5rem;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  display: inline-block;
  transition: all 0.3s ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-main {
  white-space: nowrap;
  font-size: 1.95rem;
}

.nav-brand:hover {
  animation: title-glow 0.8s ease;
}

.nav-brand:hover .brand-logo,
.nav-brand:hover .brand-logo-svg,
.nav-brand:hover .brand-logo-full {
  animation: basket-fill 0.6s ease;
}

@keyframes title-glow {
  0%,
  100% {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  50% {
    text-shadow: 0 0 12px rgba(245, 166, 35, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  }
}

@keyframes basket-fill {
  0% {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }
  50% {
    filter: drop-shadow(0 2px 6px rgba(245, 166, 35, 0.15)) brightness(1.02);
  }
  100% {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }
}

/* Enhanced Navigation */
.main-nav {
  position: relative;
  align-self: flex-end;
  margin-bottom: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  align-items: flex-end;
  height: 100%;
  margin: 0;
  padding: 0;
}

.main-nav li {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.main-nav a {
  font-family: var(--font-body);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1.25rem;
  padding-bottom: 0.5rem;
  text-decoration: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: all 0.3s ease;
  border-radius: 0;
  gap: 0.1rem;
  height: 70px;
  backdrop-filter: blur(10px);
  margin-bottom: 0;
}

.main-nav a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: all 0.3s ease;
}

.main-nav a:hover::before {
  opacity: 1;
}

.main-nav a:hover {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.main-nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.4),
    inset 0 1px 3px rgba(255, 255, 255, 0.1);
  border-bottom: 3px solid var(--color-secondary);
}

/* Enhanced active page indicator */
.main-nav li.active > a::after,
.main-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-kowhai),
    transparent
  );
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.8);
  animation: active-glow 2s ease-in-out infinite;
}

@keyframes active-glow {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px rgba(245, 166, 35, 1);
  }
}

.main-nav a.active::after_old {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    white,
    var(--color-accent)
  );
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Navigation Icons */
.nav-icon {
  font-size: 1.3rem;
  margin-bottom: 0.1rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Navigation Text */
.nav-text-mi {
  font-size: 0.95rem;
  font-style: normal;
  opacity: 1;
  font-family: var(--font-body);
  font-weight: 700;
  display: block;
}

.nav-text-en {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2px;
  opacity: 0.75;
  display: block;
  margin-top: 0.1rem;
}

/* Authentication Navigation - Special Styling */
.auth-nav {
  align-self: center !important;
  align-items: center !important;
  margin-left: 1.5rem;
  height: auto !important;
  transform: translateY(-10px);
}

.auth-nav.main-nav li {
  align-items: center !important;
}

.auth-nav a {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  margin: 0 0.25rem;
  padding: 0.65rem 1.75rem;
  min-height: auto;
  height: auto !important;
  flex-direction: row !important;
  gap: 0.5rem !important;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.auth-nav a:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-nav .login-btn {
  background: rgba(245, 166, 35, 0.2);
  border-color: rgba(245, 166, 35, 0.5);
}

.auth-nav .register-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* My Kete special styling */
.my-kete-link a {
  background: linear-gradient(
    135deg,
    rgba(245, 166, 35, 0.3),
    rgba(245, 166, 35, 0.1)
  );
  border: 1px solid rgba(245, 166, 35, 0.5);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

.my-kete-link a:hover {
  background: linear-gradient(
    135deg,
    rgba(245, 166, 35, 0.4),
    rgba(245, 166, 35, 0.2)
  );
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.3);
}

/* User Menu Dropdown Styling */
.user-menu {
  position: relative;
}

.user-menu-toggle {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 25px !important;
  padding: 0.75rem 1.25rem !important;
  color: white !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(20px) !important;
}

.user-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.user-dropdown {
  background: white !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(20px) !important;
  margin-top: 0.75rem !important;
  overflow: hidden !important;
}

/* Enhanced Dropdown Navigation Menus */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: white;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.3s;
  z-index: 9999;
  margin-top: 0.5rem;
  backdrop-filter: blur(20px);
  overflow: hidden;
  pointer-events: none;
}

/* Keep dropdown visible when hovering nav item OR dropdown itself */
.main-nav li:hover .nav-dropdown,
.nav-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s, 0s, 0s;
  pointer-events: auto;
}

/* Cascade animation for dropdown items */
.main-nav li:hover .nav-dropdown li {
  animation: cascade-in 0.3s ease forwards;
  opacity: 0;
}

.main-nav li:hover .nav-dropdown li:nth-child(1) {
  animation-delay: 0.03s;
}
.main-nav li:hover .nav-dropdown li:nth-child(2) {
  animation-delay: 0.06s;
}
.main-nav li:hover .nav-dropdown li:nth-child(3) {
  animation-delay: 0.09s;
}
.main-nav li:hover .nav-dropdown li:nth-child(4) {
  animation-delay: 0.12s;
}
.main-nav li:hover .nav-dropdown li:nth-child(5) {
  animation-delay: 0.15s;
}
.main-nav li:hover .nav-dropdown li:nth-child(6) {
  animation-delay: 0.18s;
}
.main-nav li:hover .nav-dropdown li:nth-child(7) {
  animation-delay: 0.21s;
}
.main-nav li:hover .nav-dropdown li:nth-child(8) {
  animation-delay: 0.24s;
}
.main-nav li:hover .nav-dropdown li:nth-child(9) {
  animation-delay: 0.27s;
}
.main-nav li:hover .nav-dropdown li:nth-child(10) {
  animation-delay: 0.3s;
}
.main-nav li:hover .nav-dropdown li:nth-child(11) {
  animation-delay: 0.33s;
}
.main-nav li:hover .nav-dropdown li:nth-child(12) {
  animation-delay: 0.36s;
}
.main-nav li:hover .nav-dropdown li:nth-child(13) {
  animation-delay: 0.39s;
}

@keyframes cascade-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-dropdown ul {
  flex-direction: column;
  gap: 0;
  padding: 1rem;
  margin: 0;
  list-style: none;
}

.nav-dropdown li {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

.nav-dropdown a {
  padding: 0.75rem 1rem;
  font-weight: 500;
  border-radius: 8px;
  width: 100%;
  height: auto;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: auto;
  backdrop-filter: none;
  text-shadow: none;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

.nav-dropdown a::before {
  content: "";
  display: none;
}

.nav-dropdown a:hover {
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-cultural-teal)
  );
  color: white;
  transform: translateX(4px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 12px rgba(0, 176, 185, 0.25);
}

/* Dropdown Bilingual Styling - Te Reo Prominent */
.dropdown-mi {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 1;
  line-height: 1.3;
  text-align: left;
}

.dropdown-en {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 0.15rem;
  line-height: 1.2;
  text-align: left;
  padding-left: 1.5rem;
}

/* Wide dropdown for years */
.nav-dropdown-wide {
  min-width: 420px;
}

/* Year grid layout */
/* Year stage labels */
.year-stage-label {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  border-top: 1px solid var(--color-border-light);
}

.year-stage-label:first-child {
  border-top: none;
  padding-top: 0.5rem;
}

.year-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.75rem;
}

.year-grid li a {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0.75rem;
  min-height: 42px;
  gap: 0.4rem;
}

.year-grid .dropdown-mi {
  font-size: 0.85rem;
  display: inline;
}

.year-grid .dropdown-en {
  font-size: 0.7rem;
  display: inline;
  padding-left: 0;
  margin-top: 0;
}

/* Special styling for "View All" links */
.nav-dropdown a[href*="🔍"] {
  border-top: 1px solid var(--color-border-light);
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.nav-dropdown a[href*="→"]:hover {
  background: var(--color-cultural-light);
  color: var(--color-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .nav-text-mi {
    display: none;
  }

  .main-nav a {
    padding: 0.75rem 1rem;
    gap: 0.1rem;
  }

  .nav-text-en {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    min-height: auto;
    padding: 0.75rem 0;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    min-height: auto;
  }

  .nav-brand {
    font-size: 1.8rem;
  }

  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .main-nav a {
    padding: 0.6rem 1rem;
    min-height: auto;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.2rem;
  }

  .nav-icon {
    font-size: 1.1rem;
  }

  .nav-text-en {
    font-size: 0.75rem;
  }

  /* Stack auth buttons vertically on mobile */
  .auth-nav {
    width: 100%;
    margin-left: 0;
  }

  .auth-nav a {
    width: 100%;
    text-align: center;
    margin: 0.25rem 0;
  }

  /* Dropdowns on mobile - full width */
  .nav-dropdown {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    border-radius: 12px;
  }

  .nav-dropdown-wide {
    min-width: auto;
  }

  .year-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .year-stage-label {
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem 0.25rem;
  }
}

/* Print Styles - Hide header completely */
@media print {
  .site-header {
    display: none !important;
  }
}

/* Loading Animation for Brand */
@keyframes brandGlow {
  0%,
  100% {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  50% {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(245, 166, 35, 0.3);
  }
}

.nav-brand {
  animation: brandGlow 4s ease-in-out infinite;
}

/* Accessibility Improvements */
.main-nav a:focus,
.auth-nav a:focus,
.user-menu-toggle:focus {
  outline: 2px solid rgba(245, 166, 35, 0.8);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .site-header {
    background: var(--color-forest);
    border-bottom: 2px solid white;
  }

  .main-nav a {
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0.1rem;
  }
}

/* =================================================================
   PROFESSIONAL FOOTER COMPONENT - Te Kete Ako
   "Cultural, Informative, Professional"
   ================================================================= */
/* =================================================================
   PROFESSIONAL FOOTER COMPONENT - Te Kete Ako
   Matching header quality with bilingual content
   ================================================================= */

.site-footer {
  background: linear-gradient(
    135deg,
    var(--color-forest) 0%,
    var(--color-secondary) 50%,
    var(--color-cultural-teal) 100%
  );
  color: var(--color-surface);
  margin-top: auto;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

/* Cultural pattern overlay for footer */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 15% 85%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 85% 15%,
      rgba(245, 166, 35, 0.08) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.footer-content {
  position: relative;
  z-index: 2;
  max-width: 1600px;
  margin: 0 auto;
  padding: 3rem 2rem 1.5rem;
}

/* Footer Grid Layout */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

/* Footer Brand Section */
.footer-brand h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.6rem;
  color: white;
  font-weight: 700;
}

.footer-whakataukī {
  margin: 0 0 0.25rem 0;
  color: white;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 600;
}

.footer-tagline {
  margin: 0 0 1rem 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-style: italic;
}

.footer-description {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 400px;
}

/* Footer Sections */
.footer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-section h4 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(245, 166, 35, 0.3);
}

/* Bilingual section headers */
.footer-mi {
  display: block;
  font-size: 1.05rem;
  color: white;
  margin-bottom: 0.15rem;
}

.footer-en {
  display: block;
  font-size: 0.8rem;
  opacity: 0.7;
  font-weight: 500;
}

/* Footer Links */
.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-section li {
  margin: 0;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.25s ease;
  padding: 0.4rem 0;
  display: inline-block;
  position: relative;
}

.footer-section a::before {
  content: "";
  position: absolute;
  bottom: 0.3rem;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-secondary);
  transition: width 0.25s ease;
}

.footer-section a:hover {
  color: white;
  transform: translateX(3px);
}

.footer-section a:hover::before {
  width: 100%;
}

.footer-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.cultural-quote {
  background: rgba(255, 255, 255, 0.1);
  padding: calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-accent);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.cultural-quote-text {
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-special);
}

.cultural-quote-translation {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.5rem 0 1rem;
  text-align: center;
}

.footer-bottom-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-copyright,
.footer-location,
.footer-bottom a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer-bottom a:hover {
  color: white;
  text-decoration: underline;
}

.footer-separator {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  align-items: center;
}

.social-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.social-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Responsive footer */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: span 1;
    text-align: center;
  }

  .footer-description {
    max-width: 100%;
  }

  .footer-content {
    padding: 2rem 1.5rem 1rem;
  }

  .footer-bottom-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-separator {
    display: none;
  }
}

/* Print styles - Hide footer completely */
@media print {
  .site-footer {
    display: none !important;
  }
}

/* =================================================================
   CONTENT HIERARCHY NAVIGATION COMPONENTS
   "Professional navigation showing Unit → Lesson → Resource relationships"
   ================================================================= */

/* Content Hierarchy Breadcrumb */
.content-hierarchy-breadcrumb {
  background: linear-gradient(
    135deg,
    var(--color-cultural-light) 0%,
    var(--color-surface) 100%
  );
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.breadcrumb-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumb-path {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.breadcrumb-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.breadcrumb-link:hover {
  background: rgba(0, 176, 185, 0.1);
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb-parent {
  background: rgba(0, 176, 185, 0.15);
  border: 1px solid rgba(0, 176, 185, 0.2);
}

.breadcrumb-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.breadcrumb-separator {
  color: var(--color-text-secondary);
  font-weight: normal;
  opacity: 0.6;
}

.breadcrumb-icon {
  font-size: 1rem;
}

.lesson-context {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.lesson-number {
  background: var(--color-accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 500;
}

.lesson-duration {
  background: var(--color-secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 500;
}

/* Unit Context Bar */
.unit-context-bar {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.unit-context-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.unit-info {
  text-align: center;
  margin-bottom: 2rem;
}

.unit-title {
  color: white;
  margin: 0 0 0.75rem 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.unit-description {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.5;
}

/* Lesson Sequence Navigation */
.lesson-sequence {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sequence-item {
  position: relative;
}

.sequence-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 1rem;
  border-radius: 12px;
  min-width: 120px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sequence-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
  transform: translateY(-3px);
}

.sequence-link.current {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sequence-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.sequence-link.current .sequence-number {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  box-shadow: 0 0 0 3px rgba(0, 176, 185, 0.3);
}

.sequence-title {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

.sequence-item.completed .sequence-number {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.sequence-item.completed .sequence-link {
  color: rgba(255, 255, 255, 0.9);
}

/* Connecting lines between sequence items */
.sequence-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.5rem;
  width: 1rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transform: translateY(-1px);
  z-index: 1;
}

/* Responsive Design for Content Hierarchy */
@media (max-width: 768px) {
  .breadcrumb-container {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 0 1rem;
  }

  .breadcrumb-path {
    gap: 0.5rem;
  }

  .breadcrumb-link,
  .breadcrumb-current {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .lesson-context {
    gap: 0.75rem;
    font-size: 0.8rem;
  }

  .unit-context-container {
    padding: 0 1rem;
  }

  .unit-title {
    font-size: 1.4rem;
  }

  .unit-description {
    font-size: 1rem;
  }

  .lesson-sequence {
    gap: 0.75rem;
  }

  .sequence-link {
    min-width: 100px;
    padding: 0.75rem 0.5rem;
  }

  .sequence-number {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .sequence-title {
    font-size: 0.75rem;
  }

  /* Hide connecting lines on mobile */
  .sequence-item:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .lesson-sequence {
    flex-direction: column;
    align-items: center;
  }

  .sequence-link {
    width: 100%;
    max-width: 250px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .sequence-title {
    text-align: left;
    flex: 1;
  }
}

/* Print styles for hierarchy components */
@media print {
  .content-hierarchy-breadcrumb,
  .unit-context-bar {
    display: none !important;
  }
}

/* =================================================================
   ENHANCED COMPONENTS & FILTERING SYSTEM
   ================================================================= */

/* Sophisticated Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 4);
  padding: calc(var(--spacing-unit) * 3);
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    var(--color-background) 100%
  );
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1);
  min-width: 180px;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.filter-dropdown {
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-primary);
  transition: var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-light);
}

.filter-dropdown:hover {
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-medium);
}

.filter-dropdown:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0, 176, 185, 0.1);
}

/* Enhanced Resource Grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: clamp(1rem, 3vw, calc(var(--spacing-unit) * 3));
  margin-top: calc(var(--spacing-unit) * 3);
}

.resource-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 3vw, calc(var(--spacing-unit) * 3));
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1.5);
}

.resource-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-accent)
  );
  opacity: 0;
  transition: var(--transition-medium);
}

.resource-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  border-color: var(--color-secondary);
  text-decoration: none;
}

.resource-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-secondary),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resource-card:hover::after {
  opacity: 0.6;
}

/* Unit Plan Card Enhancements */
.unit-card .resource-card-title {
  padding-right: 5.5rem; /* Make room for year badge */
  transition: color 0.3s ease;
}

.year-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
}

.unit-card:hover .year-badge {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Rainbow year colors matching browse-heroes.js spectrum */
.year-badge[data-years="7"],
.year-badge[data-years="8"],
.year-badge[data-years="7-10"],
.year-badge[data-years="7-13"],
.year-badge[data-years="8-12"] {
  background: linear-gradient(135deg, #2b8aaa, #2a9b7e); /* Cyan-Teal (Y7-8) */
}

.year-badge[data-years="9"],
.year-badge[data-years="10"],
.year-badge[data-years="9-11"],
.year-badge[data-years="9-12"],
.year-badge[data-years="9-13"] {
  background: linear-gradient(135deg, #3fa856, #7ab83a); /* Green (Y9-10) */
}

.year-badge[data-years="11"],
.year-badge[data-years="12"],
.year-badge[data-years="13"],
.year-badge[data-years="10-13"],
.year-badge[data-years="11-13"] {
  background: linear-gradient(
    135deg,
    #c2b43a,
    #db8e3a
  ); /* Yellow-Orange (Y11-13) */
}

.unit-meta {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.unit-code {
  position: absolute;
  bottom: 12px;
  right: 12px;
  color: var(--color-border);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  font-family: "Courier New", monospace;
  opacity: 0.35;
  z-index: 1;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.unit-card:hover .unit-code {
  opacity: 0.65;
  color: var(--color-text-secondary);
}

.resource-card:focus {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
  transform: translateY(-2px);
}

.resource-card:active {
  transform: translateY(-1px);
}

.resource-card:hover::before {
  opacity: 1;
}

.resource-card-title {
  font-family: var(--font-headings);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 2);
  line-height: 1.4;
  transition: var(--transition-fast);
}

.resource-card:hover .resource-card-title {
  color: var(--color-secondary);
}

.resource-card-description {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.resource-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 1);
  margin-top: calc(var(--spacing-unit) * 2);
}

.resource-tag {
  background-color: var(--color-background);
  color: var(--color-text-secondary);
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Enhanced Sidebar - "Related Resources" */
/* =================================================================
   PROFESSIONAL SIDEBAR - Te Kete Ako
   Matching header/footer quality
   ================================================================= */

.left-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding-right: calc(var(--spacing-unit) * 3);
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-unit) * 2);
  align-self: stretch;
  height: fit-content;
  min-height: calc(100vh - var(--header-height) - var(--spacing-unit) * 4);
  max-height: calc(100vh - var(--header-height) - var(--spacing-unit) * 4);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.left-sidebar::-webkit-scrollbar {
  width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: 3px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Sidebar Widgets */
.sidebar-widget {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.sidebar-widget:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* Sidebar Widget Titles - Bilingual */
.sidebar-widget-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(245, 166, 35, 0.2);
}

.sidebar-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sidebar-title-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-mi {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.sidebar-en {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  opacity: 0.7;
  line-height: 1.2;
}

/* Sidebar Lists */
.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-widget li {
  margin: 0;
}

/* Sidebar Links */
.sidebar-widget a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  background: rgba(0, 0, 0, 0.02);
}

.link-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.sidebar-widget a:hover {
  background: linear-gradient(
    135deg,
    rgba(245, 166, 35, 0.12) 0%,
    rgba(44, 95, 65, 0.08) 100%
  );
  color: var(--color-primary);
  transform: translateX(4px);
  box-shadow: 0 2px 6px rgba(245, 166, 35, 0.15);
}

.sidebar-widget a:hover .link-icon {
  transform: scale(1.15);
}

/* Active link indicator */
.sidebar-widget a.active {
  background: linear-gradient(
    135deg,
    var(--color-secondary) 0%,
    var(--color-primary) 100%
  );
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.3);
}

.sidebar-widget a.active .link-icon {
  transform: scale(1.1);
}

/* Cultural Enhancement Elements */
.cultural-accent {
  position: relative;
}

.cultural-accent::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10px;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--color-maori-red),
    var(--color-earth)
  );
  border-radius: 2px;
}

/* Enhanced Hero Section */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 85%,
    var(--color-accent) 100%
  );
  color: var(--color-surface);
  padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 4);
  border-radius: var(--radius-lg);
  margin-bottom: calc(var(--spacing-unit) * 5);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  min-height: 400px;
  display: flex;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 4);
}

.hero-main {
  flex: 1;
  text-align: left;
}

.hero-title {
  font-family: var(--font-headings);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 1);
  color: var(--color-surface);
  line-height: 1.1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: calc(var(--spacing-unit) * 3);
  letter-spacing: 0.5px;
}

.whakatauki-container {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: calc(var(--spacing-unit) * 2.5);
  border-radius: var(--radius-lg);
  margin-bottom: calc(var(--spacing-unit) * 3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.whakatauki {
  font-family: var(--font-special);
  font-size: 1.6rem;
  font-style: italic;
  margin-bottom: calc(var(--spacing-unit) * 1);
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--color-surface);
}

.whakatauki-translation {
  font-size: 1rem;
  opacity: 0.8;
  font-style: italic;
  margin: 0;
}

.hero-stats {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.1);
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-accent);
  backdrop-filter: blur(5px);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-headings);
  color: var(--color-accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: calc(var(--spacing-unit) * 0.5);
}

.hero-cultural-pattern {
  position: absolute;
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle at center,
    rgba(245, 166, 35, 0.15) 0%,
    rgba(245, 166, 35, 0.08) 30%,
    transparent 70%
  );
  border-radius: 50%;
}

.hero-cultural-pattern::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.05) 10px,
    rgba(255, 255, 255, 0.05) 20px
  );
  border-radius: 50%;
}

/* Enhanced Section Headers */
.section-header {
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.section-title-main {
  font-family: var(--font-headings);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
  position: relative;
  display: inline-block;
}

.section-title-main::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-accent)
  );
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
  margin: 0;
}

/* What's New Section */
.whats-new-section {
  background: linear-gradient(135deg, var(--color-background) 0%, #f8fafc 100%);
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  margin-bottom: calc(var(--spacing-unit) * 5);
  box-shadow: var(--shadow-light);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
}

.news-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing-unit) * 3);
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--color-border);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-accent)
  );
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: var(--color-secondary);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card.featured {
  background: linear-gradient(135deg, var(--color-surface) 0%, #f0f9ff 100%);
  border-color: var(--color-secondary);
}

.news-card.featured::before {
  opacity: 1;
}

.news-icon {
  font-size: 2rem;
  margin-bottom: calc(var(--spacing-unit) * 2);
  display: block;
}

.news-title {
  font-family: var(--font-headings);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.news-description {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.news-badge {
  position: absolute;
  top: calc(var(--spacing-unit) * 2);
  right: calc(var(--spacing-unit) * 2);
  background: var(--color-accent);
  color: white;
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Featured Resources Section */
.featured-resources-section {
  margin-bottom: calc(var(--spacing-unit) * 5);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
}

.featured-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing-unit) * 3);
  display: flex;
  align-items: flex-start;
  gap: calc(var(--spacing-unit) * 2);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.featured-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-accent)
  );
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.featured-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-strong);
  text-decoration: none;
}

.featured-card:hover::before {
  opacity: 1;
}

.featured-card.primary-card {
  background: linear-gradient(135deg, var(--color-surface) 0%, #f0f9ff 100%);
  border-color: var(--color-secondary);
  border-width: 2px;
}

.featured-card.primary-card::before {
  opacity: 1;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-primary)
  );
}

.card-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-family: var(--font-headings);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
  line-height: 1.3;
}

.card-description {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  font-size: 0.95rem;
}

.card-meta {
  display: flex;
  gap: calc(var(--spacing-unit) * 1);
  flex-wrap: wrap;
}

.meta-tag {
  background: var(--color-background);
  color: var(--color-text-secondary);
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
}

.card-arrow {
  font-size: 1.5rem;
  color: var(--color-secondary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.featured-card:hover .card-arrow {
  transform: translateX(4px);
}

.featured-card:hover .card-title {
  color: var(--color-secondary);
}

/* =================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATION
   ================================================================= */

/* Mobile Navigation */
@media (max-width: 768px) {
  .site-header {
    position: static; /* Prevent header from taking up viewport space on mobile */
  }

  .nav-container {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 2);
  }

  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 1.5);
  }

  .main-nav a {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    font-size: 0.9rem;
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-text-en {
    font-size: 0.85rem;
  }

  .nav-text-mi {
    font-size: 0.75rem;
  }

  .nav-dropdown {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    min-width: 100%;
    z-index: 1002;
  }
}

/* Mobile Layout */
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
    padding: calc(var(--spacing-unit) * 2);
  }

  .left-sidebar {
    width: 100%;
    position: static;
    padding: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    max-height: none;
    overflow-y: visible;
  }

  .content-area {
    padding: calc(var(--spacing-unit) * 3);
  }

  /* Hero section mobile adjustments */
  .hero-section {
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
    min-height: 300px;
    text-align: center;
  }

  .hero-content {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 3);
  }

  .hero-main {
    text-align: center;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-stats {
    justify-content: center;
    gap: calc(var(--spacing-unit) * 2);
  }

  .hero-cultural-pattern {
    display: none;
  }

  /* What's New section mobile */
  .news-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
  }

  /* Featured cards mobile */
  .featured-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
  }

  .featured-card {
    flex-direction: column;
    text-align: center;
    gap: calc(var(--spacing-unit) * 2);
  }

  .card-arrow {
    display: none;
  }

  .resource-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
  }

  .filter-bar {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
  }

  .filter-group {
    min-width: 100%;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .nav-brand {
    font-size: 1.2rem;
  }

  .hero-section {
    padding: calc(var(--spacing-unit) * 3);
    min-height: 250px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .whakatauki {
    font-size: 1.3rem;
  }

  .whakatauki-translation {
    font-size: 0.9rem;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
  }

  .stat-item {
    align-items: center;
    text-align: center;
    min-width: 120px;
  }

  .section-title-main {
    font-size: 1.8rem;
  }

  .resource-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .resource-card {
    padding: calc(var(--spacing-unit) * 2);
    margin-bottom: 0.5rem; /* Add breathing room between cards */
  }

  h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  /* Improve touch targets on small screens */
  .filter-dropdown {
    min-height: 44px;
    font-size: 1rem;
  }

  .sidebar-widget a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* =================================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================================= */

/* Focus States */
*:focus {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary);
  color: var(--color-surface);
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .resource-card:hover {
    transform: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000;
    --color-text-secondary: #000;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.7);
  }

  .resource-card {
    border-width: 2px;
    border-color: #000;
  }

  .sidebar-widget {
    border-width: 2px;
    border-color: #000;
  }

  .key {
    border: 2px solid #000;
  }
}

/* Print Accessibility */
@media print {
  .skip-link {
    display: none !important;
  }
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mb-1 {
  margin-bottom: calc(var(--spacing-unit) * 1);
}
.mb-2 {
  margin-bottom: calc(var(--spacing-unit) * 2);
}
.mb-3 {
  margin-bottom: calc(var(--spacing-unit) * 3);
}
.mb-4 {
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.p-1 {
  padding: calc(var(--spacing-unit) * 1);
}
.p-2 {
  padding: calc(var(--spacing-unit) * 2);
}
.p-3 {
  padding: calc(var(--spacing-unit) * 3);
}
.p-4 {
  padding: calc(var(--spacing-unit) * 4);
}

.cultural-opening-section {
  background: linear-gradient(
    135deg,
    var(--color-secondary) 0%,
    var(--color-primary) 100%
  );
  color: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--radius-lg);
}

.text-italic {
  font-style: italic;
}

.section-title {
  font-family: var(--font-headings);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: calc(var(--spacing-unit) * 0.5);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.grid {
  display: grid;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gap-4 {
  gap: calc(var(--spacing-unit) * 4);
}

.mt-2 {
  margin-top: calc(var(--spacing-unit) * 2);
}

.activity-block {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 3);
  margin: calc(var(--spacing-unit) * 3) 0;
}

.cultural-protocol-box {
  background-color: var(--color-background);
  padding: calc(var(--spacing-unit) * 2);
  border-left: 4px solid var(--color-accent);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.differentiation-box {
  background-color: var(--color-background);
  padding: calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-sm);
  margin-top: calc(var(--spacing-unit) * 2);
}

.assessment-box {
  background-color: var(--color-background);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: var(--radius-md);
}

.reflection-section {
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--radius-lg);
}

.technique-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 3);
  box-shadow: var(--shadow-light);
}

.space-y-4 > *:not(:last-child) {
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.differentiation-support {
  background-color: #e6f7ed; /* Light green */
  border-color: #81c784; /* Medium green */
}

.differentiation-extension {
  background-color: #e3f2fd; /* Light blue */
  border-color: #64b5f6; /* Medium blue */
}

.handout-content {
  /* Styles for the main article/content area of a handout */
  line-height: 1.7;
  font-size: 1.05rem;
}

.handout-content h2 {
  font-size: 1.5rem;
  margin-bottom: calc(var(--spacing-unit) * 2);
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: calc(var(--spacing-unit) * 0.5);
}

.handout-questions {
  /* Styles for the questions section of a handout */
  margin-top: calc(var(--spacing-unit) * 4);
}

.question-block {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.question-block p strong {
  color: var(--color-primary);
}

.options-list {
  list-style: none;
  padding-left: 0;
  margin-top: calc(var(--spacing-unit) * 1.5);
}

.options-list li {
  margin-bottom: calc(var(--spacing-unit) * 1);
  padding-left: calc(var(--spacing-unit) * 2);
  position: relative;
}

.options-list li::before {
  content: "•"; /* Custom bullet point */
  color: var(--color-secondary);
  position: absolute;
  left: 0;
}

.answer-space {
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  min-height: 80px; /* Default height for answer space */
  margin-top: calc(var(--spacing-unit) * 1.5);
  padding: calc(var(--spacing-unit) * 1.5);
}

.answer-space-lg {
  min-height: 120px; /* Larger answer space */
}

/* PEEL Method Specific Styles */
.peel-component {
  background-color: var(--color-background);
  border-left: 4px solid var(--color-secondary);
  padding: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-sm);
}

.peel-point {
  border-left-color: #3b82f6; /* Blue */
}

.peel-evidence {
  border-left-color: #10b981; /* Green */
}

.peel-explanation {
  border-left-color: #f59e0b; /* Orange */
}

.peel-link {
  border-left-color: #8b5cf6; /* Purple */
}

.peel-component h4 {
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.peel-point h4 strong {
  color: #3b82f6;
}

.peel-evidence h4 strong {
  color: #10b981;
}

.peel-explanation h4 strong {
  color: #f59e0b;
}

.peel-link h4 strong {
  color: #8b5cf6;
}

.example-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: calc(var(--spacing-unit) * 1.5);
  border-radius: var(--radius-sm);
  margin-top: calc(var(--spacing-unit) * 1);
  font-size: 0.9rem;
}

.page-title {
  font-family: var(--font-headings);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.breadcrumb {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: calc(var(--spacing-unit) * 2);
  display: inline-block;
}

.breadcrumb:hover {
  text-decoration: underline;
}

/* Enhanced Cultural Design Elements */
.cultural-opening-section {
  background: linear-gradient(
    135deg,
    var(--color-forest) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.cultural-opening-section::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(255, 255, 255, 0.1) 8px,
    rgba(255, 255, 255, 0.1) 16px
  );
  border-radius: 50%;
  opacity: 0.3;
}

.cultural-highlight {
  background: var(--color-cultural-light);
  border-left: 4px solid var(--color-forest);
  padding: calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-sm);
  margin: calc(var(--spacing-unit) * 2) 0;
}

.cultural-pattern {
  position: relative;
}

.cultural-pattern::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-secondary) 10px,
    var(--color-accent) 10px,
    var(--color-accent) 20px
  );
  opacity: 0.6;
}

.maori-design-accent {
  position: relative;
  padding-left: calc(var(--spacing-unit) * 3);
}

.maori-design-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(
    180deg,
    var(--color-maori-red) 0%,
    var(--color-earth) 50%,
    var(--color-forest) 100%
  );
  border-radius: 3px;
}

/* Enhanced Typography Hierarchy */
h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  line-height: 1.4;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

h4 {
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

p {
  line-height: 1.7;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--color-text-primary);
}

/* Cultural Text Styles */
.te-reo {
  font-style: italic;
  color: var(--color-forest);
  font-weight: 500;
}

.cultural-quote {
  background: var(--color-cultural-accent);
  padding: calc(var(--spacing-unit) * 2);
  border-left: 4px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  font-style: italic;
  margin: calc(var(--spacing-unit) * 2) 0;
}

.emphasis-cultural {
  background: linear-gradient(
    120deg,
    transparent 0%,
    var(--color-cultural-light) 0%,
    var(--color-cultural-light) 100%,
    transparent 100%
  );
  padding: 2px 4px;
  border-radius: 3px;
}

.handout-footer {
  margin-top: calc(var(--spacing-unit) * 4);
  padding-top: calc(var(--spacing-unit) * 3);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--spacing-unit) * 3);
}

@media (min-width: 768px) {
  .handout-footer {
    grid-template-columns: 1fr 1fr;
  }
}

.curriculum-links-box {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 3);
}

.curriculum-links-box h3 {
  color: var(--color-secondary);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.curriculum-links-box p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* =================================================================
   VIDEO ACTIVITY COMPONENT
   ================================================================= */

.video-activity-container {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-unit) * 3;
  margin-bottom: var(--spacing-unit) * 4;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin-bottom: var(--spacing-unit) * 2;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-questions h2 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-unit) * 2;
}

.video-questions .question {
  background-color: var(--color-surface);
  padding: var(--spacing-unit) * 2;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-unit) * 2;
  border-left: 4px solid var(--color-secondary);
}

.video-questions .question p {
  font-weight: 600;
  margin-bottom: var(--spacing-unit) * 1;
}

.video-questions .answer-space {
  height: 100px;
  background-color: var(--color-background);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
}

@media print {
  .video-container {
    display: none !important;
  }
  .video-activity-container {
    background-color: transparent !important;
    border: none !important;
  }
}

/* =====================================================
   CONTENT RECOMMENDATION SYSTEM STYLES
   ===================================================== */

.recommendations-container {
  margin: calc(var(--spacing-unit) * 3) 0;
}

.recommendations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.recommendations-title {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.recommendations-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0.25rem 0 0 0;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
  margin-top: calc(var(--spacing-unit) * 2);
}

.recommendation-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.recommendation-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-forest)
  );
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.recommendation-card:hover::before {
  opacity: 1;
}

.recommendation-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--color-secondary);
}

.recommendation-link {
  display: block;
  padding: calc(var(--spacing-unit) * 2);
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.recommendation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.recommendation-title {
  font-family: var(--font-headings);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

.interaction-badge {
  background: var(--color-cultural-accent);
  color: var(--color-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  margin-left: 0.75rem;
  border: 1px solid var(--color-secondary);
}

.recommendation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.recommendation-subject,
.recommendation-level,
.recommendation-type {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--color-background);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.recommendation-subject {
  background: var(--color-cultural-light);
  color: var(--color-forest);
  border-color: var(--color-forest);
}

.recommendation-level {
  background: var(--color-warmth);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.recommendation-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reason-tag {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
  border-left: 3px solid var(--color-secondary);
  padding-left: 0.75rem;
  line-height: 1.3;
}

/* Smart Recommendations Widget for Sidebars */
.smart-recommendations {
  background: var(--color-cultural-light);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.smart-recommendations-title {
  font-family: var(--font-headings);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-forest);
  margin: 0 0 calc(var(--spacing-unit) * 1.5) 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.smart-recommendations-title::before {
  content: "🎯";
  font-size: 1.2rem;
}

.smart-recommendations-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.smart-recommendations-item {
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  padding-bottom: calc(var(--spacing-unit) * 1.5);
  border-bottom: 1px solid var(--color-border-light);
}

.smart-recommendations-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.smart-recommendation-link {
  display: block;
  text-decoration: none;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

.smart-recommendation-link:hover {
  color: var(--color-secondary);
}

.smart-recommendation-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.smart-recommendation-reason {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* Loading States */
.recommendations-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--spacing-unit) * 4);
  color: var(--color-text-muted);
}

.recommendations-loading::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .recommendations-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 1.5);
  }

  .recommendation-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .interaction-badge {
    margin-left: 0;
    align-self: flex-start;
  }

  .recommendation-meta {
    gap: 0.4rem;
  }

  .smart-recommendations {
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 1.5);
  }
}

/* Print Styles */
@media print {
  .recommendations-container,
  .smart-recommendations {
    display: none !important;
  }
}

/* =================================================================
   GAMIFICATION SYSTEM STYLES
   ================================================================= */

/* Achievement Display Container */
.achievements-display {
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    var(--color-cultural-light) 100%
  );
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing-unit) * 3);
  margin: calc(var(--spacing-unit) * 3) 0;
  box-shadow: var(--shadow-medium);
}

.achievement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--spacing-unit) * 3);
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 2);
}

.current-level {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 2);
}

.level-icon {
  font-size: 3rem;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.level-info h3 {
  color: var(--color-primary);
  margin: 0 0 calc(var(--spacing-unit) * 0.5) 0;
  font-size: 1.5rem;
}

.level-info p {
  color: var(--color-text-secondary);
  margin: 0;
  font-style: italic;
}

.level-stats {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  padding: calc(var(--spacing-unit) * 1.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  min-width: 80px;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-secondary);
  font-family: var(--font-headings);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Progress to Next Level */
.progress-to-next {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.progress-to-next h4 {
  margin: 0 0 calc(var(--spacing-unit) * 1.5) 0;
  color: var(--color-primary);
}

.progress-bar {
  background: var(--color-background);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  margin-bottom: calc(var(--spacing-unit) * 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-accent)
  );
  height: 100%;
  border-radius: 20px;
  transition: width 0.8s ease;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.3) 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.max-level {
  text-align: center;
  padding: calc(var(--spacing-unit) * 3);
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  border-radius: var(--radius-lg);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

/* Badges Display */
.badges-display h4 {
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-size: 1.3rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
}

.badge {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing-unit) * 2);
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 2);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.badge.earned {
  border-color: var(--color-secondary);
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    var(--color-cultural-light) 100%
  );
  box-shadow: var(--shadow-medium);
}

.badge.earned::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-secondary),
    var(--color-accent)
  );
}

.badge-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.badge-info h5 {
  margin: 0 0 calc(var(--spacing-unit) * 0.5) 0;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.badge-info p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Achievement Feedback */
.achievement-feedback {
  position: fixed;
  top: calc(var(--header-height) + calc(var(--spacing-unit) * 2));
  right: calc(var(--spacing-unit) * 3);
  z-index: 1000;
  max-width: 300px;
}

.feedback-message {
  background: var(--color-surface);
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing-unit) * 2);
  box-shadow: var(--shadow-strong);
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 1.5);
  animation: slideInRight 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
}

.feedback-message.success {
  border-color: var(--color-secondary);
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    var(--color-cultural-light) 100%
  );
}

.feedback-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.feedback-message p {
  margin: 0;
  color: var(--color-primary);
  font-weight: 500;
  line-height: 1.4;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Category Progress Bars */
.category-progress {
  margin: calc(var(--spacing-unit) * 2) 0;
}

.category-item {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.category-name {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
}

.category-mastery {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.category-progress-bar {
  background: var(--color-background);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.category-progress-fill {
  background: linear-gradient(
    90deg,
    var(--color-forest),
    var(--color-secondary)
  );
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

/* Game Integration Styles */
.game-achievements-widget {
  background: var(--color-cultural-light);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 2);
  margin: calc(var(--spacing-unit) * 2) 0;
}

.game-achievements-widget h4 {
  color: var(--color-primary);
  margin: 0 0 calc(var(--spacing-unit) * 1.5) 0;
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 1);
}

.game-achievements-widget h4::before {
  content: "🎮";
  font-size: 1.2rem;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: calc(var(--spacing-unit) * 1.5);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.quick-stat {
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  padding: calc(var(--spacing-unit) * 1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.quick-stat-number {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.quick-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-top: calc(var(--spacing-unit) * 0.25);
}

.recent-achievements {
  max-height: 120px;
  overflow-y: auto;
}

.recent-achievement {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 1);
  padding: calc(var(--spacing-unit) * 0.75);
  margin-bottom: calc(var(--spacing-unit) * 0.5);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.recent-achievement-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.recent-achievement-text {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Responsive Design for Gamification */
@media (max-width: 768px) {
  .achievement-header {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--spacing-unit) * 2);
  }

  .level-stats {
    justify-content: center;
    width: 100%;
  }

  .badges-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 1.5);
  }

  .badge {
    flex-direction: column;
    text-align: center;
    gap: calc(var(--spacing-unit) * 1.5);
  }

  .achievement-feedback {
    right: calc(var(--spacing-unit) * 1.5);
    left: calc(var(--spacing-unit) * 1.5);
    max-width: none;
  }

  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: calc(var(--spacing-unit) * 1);
  }
}

@media (max-width: 480px) {
  .achievements-display {
    padding: calc(var(--spacing-unit) * 2);
    margin: calc(var(--spacing-unit) * 2) 0;
  }

  .current-level {
    flex-direction: column;
    text-align: center;
    gap: calc(var(--spacing-unit) * 1);
  }

  .level-icon {
    font-size: 2.5rem;
  }

  .level-stats {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
  }

  .stat {
    min-width: 60px;
    padding: calc(var(--spacing-unit) * 1);
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }
}

/* Print Styles for Gamification */
@media print {
  .achievements-display,
  .achievement-feedback,
  .game-achievements-widget {
    display: none !important;
  }
}

/* =====================================================
   ACCESSIBILITY ENHANCEMENTS STYLES  
   ===================================================== */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Links */
.skip-links {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: 10000;
}

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: all var(--transition-fast);
}

.skip-link:focus {
  left: 0;
  top: 0;
  z-index: 10001;
}

/* Enhanced Focus Indicators */
.enhanced-focus,
body.enhanced-focus-indicators *:focus {
  outline: 3px solid var(--color-secondary) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(64, 224, 208, 0.2);
}

/* High Contrast Mode */
body.high-contrast {
  --color-primary: #000000;
  --color-secondary: #ffff00;
  --color-accent: #ffffff;
  --color-background: #000000;
  --color-surface: #000000;
  --color-text-primary: #ffffff;
  --color-text-secondary: #ffff00;
  --color-border: #ffffff;
}

body.high-contrast .recommendation-card,
body.high-contrast .sidebar-widget,
body.high-contrast .featured-card {
  border: 2px solid #ffffff !important;
  background: #000000 !important;
  color: #ffffff !important;
}

body.high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.high-contrast button {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
}

/* Large Text Mode */
body.large-text {
  font-size: 1.25em;
}

body.large-text h1 {
  font-size: 2.75rem;
}
body.large-text h2 {
  font-size: 2.25rem;
}
body.large-text h3 {
  font-size: 1.875rem;
}
body.large-text .nav-text-en,
body.large-text .nav-text-mi {
  font-size: 1.1rem;
}

/* Reduced Motion */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

body.pause-animations * {
  animation-play-state: paused !important;
}

/* Always Show Skip Links */
body.always-show-skip-links .skip-link {
  position: relative;
  left: 0;
  top: 0;
  display: inline-block;
  margin: 0.25rem;
}

/* =================================================================
   SMART ACTIVITY GENERATOR - Enhanced Te Ao Māori Design
   ================================================================= */

.smart-generator-container {
  background: linear-gradient(
    135deg,
    var(--color-forest) 0%,
    var(--color-cultural-teal) 100%
  );
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
}

.smart-generator-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="koru" patternUnits="userSpaceOnUse" width="20" height="20"><path d="M10,10 Q15,5 20,10 Q15,15 10,10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23koru)"/></svg>')
    repeat;
  opacity: 0.3;
  pointer-events: none;
}

.generator-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.generator-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.generator-subtitle {
  font-style: italic;
  opacity: 0.9;
  font-size: 1rem;
  color: var(--color-accent);
}

.generator-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 2;
}

.feature-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.8rem;
  text-align: center;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left var(--transition-slow);
}

.feature-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.feature-card:hover::before {
  left: 100%;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: white;
}

.feature-description {
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

.generator-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.generator-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.generator-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left var(--transition-slow);
}

.generator-btn:hover::before {
  left: 100%;
}

.generator-btn-primary {
  background: var(--color-accent);
  color: var(--color-primary);
}

.generator-btn-primary:hover {
  background: #f7b342;
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(245, 166, 35, 0.4);
}

.generator-btn-secondary {
  background: white;
  color: var(--color-forest);
}

.generator-btn-secondary:hover {
  background: #f8f9fa;
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
}

.btn-icon {
  font-size: 1.2rem;
}

.btn-text {
  font-weight: 700;
  font-size: 1rem;
}

.btn-subtext {
  font-size: 0.8rem;
  opacity: 0.8;
  font-style: italic;
}

.cultural-accent {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
}

.whakatau-ki {
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  font-weight: 500;
}

.translation {
  font-size: 0.9rem;
  opacity: 0.9;
  font-style: italic;
}

/* Enhanced Filter Bar */
.filter-bar {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-primary);
}

.enhanced-dropdown {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.8rem 1.2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-medium);
  min-width: 180px;
}

.enhanced-dropdown:hover {
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-medium);
  background: var(--color-card-hover);
}

.enhanced-dropdown:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0, 176, 185, 0.1);
}

/* Mobile Responsiveness for Generator */
@media (max-width: 768px) {
  .smart-generator-container {
    padding: 1.5rem;
    margin: 0 -1rem 2rem -1rem;
    border-radius: 0;
  }

  .generator-title {
    font-size: 1.5rem;
  }

  .generator-features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card {
    padding: 1.2rem;
  }

  .generator-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .generator-btn {
    width: 100%;
    min-width: auto;
  }

  .filter-bar {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .enhanced-dropdown {
    width: 100%;
    min-width: auto;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .feature-card,
  .generator-btn,
  .feature-card::before,
  .generator-btn::before {
    transition: none;
  }

  .feature-card:hover,
  .generator-btn:hover {
    transform: none;
  }
}

/* High Contrast Mode for Generator */
@media (prefers-contrast: high) {
  .smart-generator-container {
    background: #000000;
    border: 3px solid #ffffff;
  }

  .feature-card {
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    border: 2px solid #ffffff;
  }

  .generator-btn-primary {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
  }

  .generator-btn-secondary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
  }
}

/* Quick Accessibility Toolbar */
.quick-accessibility-toolbar {
  position: fixed;
  top: 50%;
  right: -50px;
  transform: translateY(-50%);
  z-index: 9999;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 0.5rem 0;
  box-shadow: var(--shadow-medium);
  transition: right var(--transition-medium);
}

.quick-accessibility-toolbar:hover,
.quick-accessibility-toolbar:focus-within {
  right: 0;
}

.a11y-tool-btn {
  display: block;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  border-radius: var(--radius-sm);
  margin: 0.25rem;
  transition: all var(--transition-fast);
}

.a11y-tool-btn:hover,
.a11y-tool-btn:focus {
  background: var(--color-cultural-light);
  color: var(--color-forest);
}

/* Print Styles - Hide accessibility tools */
@media print {
  .skip-links,
  .quick-accessibility-toolbar,
  .accessibility-panel,
  .modal {
    display: none !important;
  }
}

/* =================================================================
   PROFESSIONAL ANIMATIONS & MICRO-INTERACTIONS
   Modern polish for 2025 - smooth, subtle, delightful
   ================================================================= */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Page load animations - Hero section */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply animations to hero elements */
.hero-title {
  animation: fadeInUp 0.6s ease-out;
}

.hero-tagline {
  animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.whakatauki-container {
  animation: fadeInUp 1s ease-out 0.2s backwards;
}

/* Cascade stat cards */
.stat-item:nth-child(1) {
  animation: scaleIn 0.5s ease-out 0.4s backwards;
}

.stat-item:nth-child(2) {
  animation: scaleIn 0.5s ease-out 0.5s backwards;
}

.stat-item:nth-child(3) {
  animation: scaleIn 0.5s ease-out 0.6s backwards;
}

.stat-item:nth-child(4) {
  animation: scaleIn 0.5s ease-out 0.7s backwards;
}

/* Enhanced card hover effects */
.news-card,
.featured-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover,
.featured-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* News cards fade in on load */
.news-card:nth-child(1) {
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.news-card:nth-child(2) {
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.news-card:nth-child(3) {
  animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

/* Featured cards cascade */
.featured-card:nth-child(1) {
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.featured-card:nth-child(2) {
  animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

.featured-card:nth-child(3) {
  animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

/* Footer link hover - slide underline */
.footer-section a {
  position: relative;
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-section a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.footer-section a:hover::before {
  width: 100%;
}

.footer-section a:hover {
  color: var(--color-accent);
  padding-left: 0.5rem;
}

/* Sidebar widget hover effects */
.sidebar-widget {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-widget:hover {
  transform: translateX(4px);
  box-shadow: -3px 0 0 0 var(--color-accent);
}

.sidebar-widget a {
  transition: all 0.2s ease;
}

.sidebar-widget a:hover {
  color: var(--color-secondary);
  padding-left: 0.5rem;
}

/* Active page indicator subtle pulse */
@keyframes subtlePulse {
  0%,
  100% {
    box-shadow: 0 4px 8px rgba(245, 166, 35, 0.3);
  }
  50% {
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.5);
  }
}

.main-nav a.active {
  animation: subtlePulse 3s ease-in-out infinite;
}

/* Typography refinement - letter spacing */
h1,
.hero-title {
  letter-spacing: -0.02em;
}

h2,
.section-title-main {
  letter-spacing: -0.01em;
}

h3 {
  letter-spacing: 0;
}

.nav-text-mi {
  letter-spacing: 0.02em;
}

/* Focus indicators - beautiful keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Section titles fade in */
.section-title-main {
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.section-subtitle {
  animation: fadeIn 0.8s ease-out 0.3s backwards;
}

/* Card icon bounce on hover */
.news-card:hover .news-icon,
.featured-card:hover .card-icon {
  animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Card arrow slide on hover */
.featured-card .card-arrow {
  transition: transform 0.3s ease;
}

.featured-card:hover .card-arrow {
  transform: translateX(8px);
}

/* Button hover effects - enhanced */
.cta-buttons a {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-buttons a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Loading state improvements */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Print - disable all animations */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =================================================================
   DAILY WHAKATAUKĪ WIDGET - Sidebar
   Rotating daily proverb for cultural grounding
   ================================================================= */

.whakatauki-widget {
  background: linear-gradient(
    135deg,
    rgba(44, 95, 65, 0.08) 0%,
    rgba(245, 166, 35, 0.06) 100%
  );
  border-left: 4px solid var(--color-accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whakatauki-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  background: linear-gradient(
    135deg,
    rgba(44, 95, 65, 0.12) 0%,
    rgba(245, 166, 35, 0.09) 100%
  );
}

.whakatauki-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.whakatauki-mi {
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-forest);
  line-height: 1.5;
  margin: 0;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  border-left: 3px solid var(--color-accent);
}

.whakatauki-en {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
  padding-left: 0.5rem;
  font-style: italic;
}

/* Subtle animation on load */
.whakatauki-widget {
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Print styles - keep whakataukī visible */
@media print {
  .whakatauki-widget {
    page-break-inside: avoid;
    background: #f9f9f9 !important;
    border: 1pt solid #ccc !important;
    padding: 8pt !important;
    margin-bottom: 12pt !important;
  }

  .whakatauki-mi {
    font-size: 11pt !important;
    background: white !important;
  }

  .whakatauki-en {
    font-size: 9pt !important;
  }
}

/* =================================================================
   BROWSE PAGE HEROES - Subject & Year Level
   Dynamic hero sections that give each subject/year its own identity
   ================================================================= */

/* Unit Plans Hero */
.unit-plans-hero {
  background: linear-gradient(
    135deg,
    var(--color-secondary) 0%,
    var(--color-primary) 100%
  );
  color: white;
  padding: 2.5rem;
  border-radius: 16px;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: fadeInUp 0.6s ease-out;
}

.unit-plans-hero .hero-title {
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 1.5rem 0;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.unit-plans-hero .hero-title .title-mi {
  font-size: 1em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.unit-plans-hero .hero-title .title-en {
  font-size: 0.75em;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

.unit-plans-hero .hero-description {
  margin: 0 0 1.5rem 0;
  font-size: 1.05rem;
  line-height: 1.7;
  opacity: 0.95;
  max-width: 85%;
}

.unit-plans-hero .hero-pedagogy {
  background: rgba(255, 255, 255, 0.15);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.unit-plans-hero .hero-pedagogy p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: white;
}

.unit-plans-hero .hero-pedagogy strong {
  color: white;
  font-weight: 700;
}

.unit-plans-hero .hero-pedagogy cite a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.unit-plans-hero .hero-pedagogy cite a:hover {
  color: white;
  text-decoration-color: white;
}

.unit-plans-hero .hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.unit-plans-hero .hero-link {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.unit-plans-hero .hero-link:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.unit-plans-hero .hero-link-internal {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.unit-plans-hero .hero-link-internal:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
}

.unit-plans-hero .hero-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-weight: 600;
}

.unit-plans-hero .hero-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.unit-plans-hero .hero-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.unit-plans-hero .tool-section h3 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  opacity: 0.95;
}

.unit-plans-hero .tool-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.unit-plans-hero .tool-section a {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.unit-plans-hero .tool-section a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  .unit-plans-hero .hero-tools {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* =================================================================
   LESSONS, HANDOUTS & GAMES HERO SECTIONS
   Functional dashboards for each hub page
   ================================================================= */

.lessons-hero,
.handouts-hero,
.games-hero {
  background: linear-gradient(
    135deg,
    var(--color-secondary) 0%,
    var(--color-primary) 100%
  );
  color: white;
  padding: 2.5rem;
  border-radius: 16px;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: fadeInUp 0.6s ease-out;
}

/* Unique gradients for each page */
.lessons-hero {
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-primary) 100%
  );
}

.handouts-hero {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
}

.games-hero {
  background: linear-gradient(
    135deg,
    var(--color-secondary) 0%,
    var(--color-accent) 100%
  );
}

.lessons-hero .hero-title,
.handouts-hero .hero-title,
.games-hero .hero-title {
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 1.5rem 0;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lessons-hero .hero-title .title-mi,
.handouts-hero .hero-title .title-mi,
.games-hero .hero-title .title-mi {
  font-size: 1em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lessons-hero .hero-title .title-en,
.handouts-hero .hero-title .title-en,
.games-hero .hero-title .title-en {
  font-size: 0.75em;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

.lessons-hero .hero-tools,
.handouts-hero .hero-tools,
.games-hero .hero-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.lessons-hero .tool-section h3,
.handouts-hero .tool-section h3,
.games-hero .tool-section h3 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  opacity: 0.95;
}

.lessons-hero .tool-section,
.handouts-hero .tool-section,
.games-hero .tool-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lessons-hero .tool-section a,
.handouts-hero .tool-section a,
.games-hero .tool-section a {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.lessons-hero .tool-section a:hover,
.handouts-hero .tool-section a:hover,
.games-hero .tool-section a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  .lessons-hero .hero-tools,
  .handouts-hero .hero-tools,
  .games-hero .hero-tools {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Subject Hero */
.subject-hero {
  background: linear-gradient(
    135deg,
    var(--subject-color, var(--color-secondary)) 0%,
    rgba(255, 255, 255, 0.98) 100%
  );
  border-radius: 16px;
  padding: 0;
  margin-bottom: 3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 0;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Browse Page Heroes - Span Full Width */
.browse-page-hero {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding-left: calc(var(--spacing-unit) * 3);
  padding-right: calc(var(--spacing-unit) * 3);
}

.subject-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.subject-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.subject-hero .hero-icon {
  font-size: 5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
  animation: iconBounce 2s ease-in-out infinite;
  flex-shrink: 0;
  background: var(--subject-color, var(--color-secondary));
  color: white;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  max-width: 140px;
}

.subject-hero .hero-content {
  flex: 1;
  padding: 3rem 2.5rem;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.subject-hero .hero-title {
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--subject-color, var(--color-accent));
}

.subject-hero .hero-title-mi {
  font-size: 2.8rem;
  font-weight: 800;
  color: #000000;
  line-height: 1.1;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.subject-hero .hero-title-en {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333333;
  line-height: 1.2;
  opacity: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.subject-hero .hero-description-mi {
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.5;
}

.subject-hero .hero-description-en {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
}

.subject-hero .hero-main {
  grid-column: 1;
}

.subject-hero .hero-sidebar {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.subject-hero .hero-quick-links {
  background: linear-gradient(
    135deg,
    rgba(236, 253, 245, 0.9) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid var(--subject-color, var(--color-accent));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.subject-hero .hero-quick-links:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.subject-hero .quick-links-label {
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
  display: block;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.subject-hero .quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid var(--subject-color, var(--color-accent));
  border-radius: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.75rem;
}

.subject-hero .quick-link:last-child {
  margin-bottom: 0;
}

.subject-hero .quick-link:hover {
  background: var(--subject-color, var(--color-accent));
  color: white;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.subject-hero .quick-link-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.subject-hero .hero-pedagogy {
  font-size: 0.95rem;
  color: #2a2a2a;
  margin: 0;
  padding: 2rem 2.5rem;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(236, 253, 245, 0.95) 100%
  );
  border-left: 5px solid var(--color-forest);
  border-radius: 16px;
  line-height: 1.75;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.subject-hero .hero-pedagogy strong {
  color: var(--color-forest);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.subject-hero .hero-pedagogy strong::before {
  content: "📚";
  font-size: 1rem;
}

.subject-hero .hero-pedagogy p {
  margin: 0 0 1rem 0;
}

.subject-hero .hero-pedagogy p:last-child {
  margin-bottom: 0;
}

.subject-hero .hero-pedagogy cite {
  font-style: italic;
  color: var(--color-secondary);
  font-weight: 600;
  font-size: 0.9em;
}

.subject-hero .hero-pedagogy cite a {
  color: var(--color-secondary);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-secondary);
  transition: all 0.2s ease;
}

.subject-hero .hero-pedagogy cite a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  border-bottom-style: solid;
}

.subject-hero .hero-pedagogy .cultural-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(46, 95, 65, 0.2);
}

.subject-hero .hero-pedagogy .cultural-note strong {
  color: var(--color-accent);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.subject-hero .hero-pedagogy .cultural-note strong::before {
  content: "🌟";
  font-size: 1rem;
}

/* Separate Pedagogy Box Below Hero */
.hero-pedagogy-box {
  margin-bottom: 3rem;
  margin-top: -1rem;
  animation: fadeInUp 0.6s ease-out 0.3s both;
  background: linear-gradient(
    to bottom,
    rgba(236, 253, 245, 0.3) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  padding: 2rem 0;
  position: relative;
}

.hero-pedagogy-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(46, 95, 65, 0.2) 20%,
    rgba(46, 95, 65, 0.3) 50%,
    rgba(46, 95, 65, 0.2) 80%,
    transparent 100%
  );
}

.hero-pedagogy-box .hero-pedagogy {
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  padding: 2rem 3rem; /* Add comfortable padding */
}

.hero-pedagogy-box .hero-pedagogy .pedagogy-icon {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.2rem;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Year Level Hero - Rainbow Progression */
.year-hero {
  --year-color-start: #4a5899;
  --year-color-mid: #6b7bc2;
  --year-color-end: #c5d3f5;
  background: linear-gradient(
    90deg,
    var(--year-color-start) 0%,
    var(--year-color-mid) 50%,
    var(--year-color-end) 100%
  );
  border-radius: 20px;
  padding: 0;
  margin-bottom: 3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  align-items: stretch;
  color: white;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.year-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.year-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.year-hero .hero-year-badge {
  background: linear-gradient(
    135deg,
    var(--year-color-start) 0%,
    var(--year-color-mid) 100%
  );
  border-right: 3px solid rgba(255, 255, 255, 0.2);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.year-hero .hero-year-badge::before {
  content: "🎓";
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.year-hero .year-number {
  display: block;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.75rem;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.year-hero .year-stage {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.year-hero .hero-content {
  padding: 3rem;
  background: rgba(255, 255, 255, 0.98);
  position: relative;
  z-index: 2;
}

.year-hero .hero-title {
  margin: 0 0 2rem 0;
  font-size: 2.2rem;
  color: #1a1a1a;
  font-weight: 800;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Horizontal layout for info boxes */
.year-hero .hero-info-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.year-hero .hero-focus,
.year-hero .hero-development {
  background: linear-gradient(
    135deg,
    rgba(232, 237, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  line-height: 1.7;
  border-left: 5px solid #6b7bc2;
  box-shadow: 0 4px 12px rgba(74, 88, 153, 0.12);
  color: #1a1a1a;
}

.year-hero .hero-pedagogy {
  background: linear-gradient(
    135deg,
    rgba(255, 250, 242, 0.98) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  line-height: 1.7;
  border-left: 5px solid #f5a623;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.12);
  color: #1a1a1a;
  grid-column: 1 / -1;
}

.year-hero .hero-focus strong,
.year-hero .hero-development strong,
.year-hero .hero-pedagogy strong {
  color: #4a5899;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.year-hero .hero-pedagogy strong {
  color: #f5a623;
}

.year-hero .hero-focus strong::before,
.year-hero .hero-development strong::before {
  content: "📍";
  font-size: 1rem;
}

.year-hero .hero-pedagogy strong::before {
  content: "🎯";
  font-size: 1rem;
}

.year-hero .hero-focus p,
.year-hero .hero-development p,
.year-hero .hero-pedagogy p {
  margin: 0;
  font-size: 0.95rem;
}

.year-hero .hero-pedagogy cite {
  font-style: italic;
  color: #4a5899;
  font-weight: 600;
  font-size: 0.9em;
}

.year-hero .hero-pedagogy cite a {
  color: #4a5899;
  text-decoration: none;
  border-bottom: 1px dotted #4a5899;
  transition: all 0.2s ease;
}

.year-hero .hero-pedagogy cite a:hover {
  color: #f5a623;
  border-bottom-color: #f5a623;
  border-bottom-style: solid;
}

.year-hero .hero-transition {
  background: linear-gradient(
    135deg,
    rgba(245, 166, 35, 0.08) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  line-height: 1.7;
  border-left: 5px solid #f5a623;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.12);
  color: #1a1a1a;
  margin-bottom: 1.5rem;
}

.year-hero .hero-transition strong {
  color: #f5a623;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.year-hero .hero-transition strong::before {
  content: "🔄";
  font-size: 1rem;
}

.year-hero .hero-transition p {
  margin: 0;
  font-size: 0.95rem;
}

.year-hero .ministry-resource {
  margin-top: 0;
  padding-top: 0;
}

.year-hero .ministry-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(74, 88, 153, 0.1) 0%,
    rgba(255, 255, 255, 0.5) 100%
  );
  border: 2px solid #4a5899;
  border-radius: 8px;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.year-hero .ministry-link:hover {
  background: #4a5899;
  color: white;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(74, 88, 153, 0.25);
}

.year-hero .ministry-icon {
  font-size: 1.2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .subject-hero,
  .year-hero {
    flex-direction: column;
  }

  .subject-hero .hero-icon {
    font-size: 4.5rem;
    min-width: auto;
    max-width: none;
    width: 100%;
    padding: 2rem;
  }

  .subject-hero .hero-content {
    padding: 2rem 1.5rem;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .subject-hero .hero-sidebar {
    grid-column: 1;
  }

  .subject-hero .hero-title-mi {
    font-size: 2.2rem;
  }

  .subject-hero .hero-title-en {
    font-size: 1.3rem;
  }

  .year-hero {
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }

  .year-hero .hero-year-badge {
    min-width: auto;
    width: 100%;
  }

  .year-hero .hero-title {
    font-size: 2rem;
  }

  .year-hero .hero-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Print Styles */
@media print {
  .subject-hero,
  .year-hero {
    page-break-inside: avoid;
    background: #f5f5f5 !important;
    color: black !important;
    border: 1pt solid #ccc !important;
    box-shadow: none !important;
  }

  .year-hero .hero-content,
  .year-hero .hero-title {
    color: black !important;
  }

  .subject-hero .hero-quick-links {
    display: none !important;
  }
}

/* =================================================================
   AUTHENTICATION PAGES STYLES
   ================================================================= */

/* Auth Page Container */
.auth-container {
  max-width: 500px;
  margin: calc(var(--spacing-unit) * 4) auto;
  padding: calc(var(--spacing-unit) * 4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-medium);
}

.auth-container h1 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-size: 1.8rem;
}

.auth-container > p {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Auth Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-unit);
}

.form-group label {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  padding: calc(var(--spacing-unit) * 1.5);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
  background: var(--color-surface);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0, 176, 185, 0.1);
}

.form-group input::placeholder {
  color: var(--color-text-muted);
}

/* Auth Buttons */
.auth-button {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  border: none;
  padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-unit);
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Auth Messages */
.message {
  padding: calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-md);
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-unit);
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}

.message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 2px solid #bee5eb;
}

/* Auth Links */
.auth-links {
  text-align: center;
  margin-top: calc(var(--spacing-unit) * 2);
}

.auth-links p {
  margin: var(--spacing-unit) 0;
  color: var(--color-text-secondary);
}

.auth-links a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-links a:hover {
  text-decoration: underline;
  color: var(--color-primary);
}

/* Demo Accounts Box */
.demo-accounts {
  background: var(--color-cultural-accent);
  border: 1px solid #b3d9ff;
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-size: 0.9rem;
}

.demo-accounts h4 {
  margin: 0 0 var(--spacing-unit) 0;
  color: var(--color-primary);
  font-size: 1rem;
}

.demo-accounts p {
  margin: calc(var(--spacing-unit) * 0.5) 0;
  color: var(--color-text-secondary);
}

.demo-accounts strong {
  color: var(--color-primary);
  font-family: "Courier New", monospace;
  font-size: 0.95em;
}

/* Cultural Opening on Auth Pages */
.cultural-opening {
  background: var(--color-cultural-light);
  border-left: 4px solid var(--color-secondary);
  padding: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
  border-radius: var(--radius-md);
}

.cultural-opening h2 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-unit);
  font-size: 1.1rem;
}

.cultural-opening p:first-of-type {
  font-style: italic;
  color: var(--color-primary);
  margin-bottom: var(--spacing-unit);
  font-size: 1.1rem;
  font-family: var(--font-special);
}

.cultural-opening p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--spacing-unit);
}

.cultural-opening p:last-child {
  margin-bottom: 0;
}

/* User Menu (Dynamic - from auth-ui.js) */
.user-menu {
  position: relative;
}

.user-menu-toggle {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-unit);
  padding: var(--spacing-unit);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.user-menu-toggle:hover {
  background-color: var(--color-card-hover);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
  min-width: 200px;
  z-index: 1000;
  margin-top: var(--spacing-unit);
  overflow: hidden;
}

.user-dropdown-header {
  padding: calc(var(--spacing-unit) * 2);
  border-bottom: 1px solid var(--color-border-light);
}

.user-dropdown-name {
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.user-dropdown-email {
  font-size: 0.85em;
  color: var(--color-text-secondary);
}

.user-dropdown a {
  display: block;
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color var(--transition-fast);
}

.user-dropdown a:hover {
  background-color: var(--color-card-hover);
}

.user-dropdown button {
  width: 100%;
  text-align: left;
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font: inherit;
  transition: background-color var(--transition-fast);
}

.user-dropdown button:hover {
  background-color: #fff5f5;
}

/* Responsive Auth Pages */
@media (max-width: 768px) {
  .auth-container {
    margin: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 3);
  }

  .auth-container h1 {
    font-size: 1.5rem;
  }

  .auth-button {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    font-size: 1rem;
  }
}

/* Print Styles for Auth Pages */
@media print {
  .auth-container,
  .auth-form,
  .auth-button,
  .demo-accounts,
  .auth-links {
    display: none !important;
  }

  .cultural-opening {
    background: #f5f5f5 !important;
    border-left: 2pt solid black !important;
    page-break-inside: avoid;
  }
}

/* =================================================================
   MULTI-STEP ONBOARDING FLOW
   ================================================================= */

/* Onboarding Container */
.onboarding-container {
  max-width: 700px;
  margin: calc(var(--spacing-unit) * 4) auto;
  padding: calc(var(--spacing-unit) * 4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-medium);
}

/* Progress Indicator */
.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: calc(var(--spacing-unit) * 3) auto calc(var(--spacing-unit) * 4);
  max-width: 800px;
  padding: 0 calc(var(--spacing-unit) * 2);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-unit);
  position: relative;
  z-index: 1;
}

.progress-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all var(--transition-medium);
}

.progress-step.active .progress-circle {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  box-shadow: var(--shadow-medium);
  transform: scale(1.1);
}

.progress-step.completed .progress-circle {
  background: var(--color-secondary);
  color: white;
}

.progress-step.completed .progress-circle::before {
  content: "✓";
  font-size: 1.3rem;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.progress-step.active .progress-label {
  color: var(--color-primary);
  font-weight: 700;
}

.progress-line {
  flex: 1;
  height: 3px;
  background: var(--color-border);
  margin: 0 calc(var(--spacing-unit) * 1);
  position: relative;
  top: -20px;
}

.progress-step.completed ~ .progress-line {
  background: var(--color-secondary);
}

/* Onboarding Steps */
.onboarding-step {
  display: none !important;
  animation: fadeIn 0.3s ease-in;
}

.onboarding-step.active {
  display: block !important;
}

/* Ensure ONLY active step shows (override any other display rules) */
.onboarding-container .onboarding-step:not(.active) {
  display: none !important;
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-container h1 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-size: 1.9rem;
}

.step-description {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: calc(var(--spacing-unit) * 3);
  font-size: 1.05rem;
}

/* Role Selection Cards */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.role-card {
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: calc(var(--spacing-unit) * 4);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-medium);
  position: relative;
}

.role-card:hover {
  border-color: var(--color-secondary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.role-card.selected {
  border-color: var(--color-secondary);
  background: var(--color-cultural-accent);
  box-shadow: var(--shadow-medium);
}

.role-icon {
  font-size: 4rem;
  margin-bottom: calc(var(--spacing-unit) * 2);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.role-card h3 {
  margin-bottom: var(--spacing-unit);
  font-size: 1.3rem;
  color: var(--color-primary);
}

.role-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.role-check {
  position: absolute;
  top: calc(var(--spacing-unit) * 2);
  right: calc(var(--spacing-unit) * 2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.role-card.selected .role-check {
  display: flex;
}

/* Form Helper Text */
.form-help {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: calc(var(--spacing-unit) * 0.5);
  display: block;
}

/* Checkbox Groups */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1.5);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 1.5);
  padding: calc(var(--spacing-unit) * 1.5);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.checkbox-label:hover {
  border-color: var(--color-secondary);
  background: var(--color-card-hover);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-secondary);
}

.checkbox-label input[type="checkbox"]:checked + span {
  color: var(--color-primary);
  font-weight: 600;
}

/* Year Level Button Grid */
.year-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: calc(var(--spacing-unit) * 1.5);
}

.year-level-btn {
  position: relative;
  cursor: pointer;
}

.year-level-btn input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.year-level-btn span {
  display: block;
  padding: calc(var(--spacing-unit) * 2);
  text-align: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-fast);
  background: var(--color-surface);
}

.year-level-btn:hover span {
  border-color: var(--color-secondary);
  background: var(--color-card-hover);
}

.year-level-btn input[type="checkbox"]:checked + span {
  border-color: var(--color-secondary);
  background: var(--color-cultural-accent);
  color: var(--color-primary);
  box-shadow: var(--shadow-light);
}

/* Optional Section Styling */
.optional-section {
  background: var(--color-warmth);
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius-md);
  padding: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.optional-notice {
  background: white;
  padding: calc(var(--spacing-unit) * 2);
  border-radius: var(--radius-md);
  margin-bottom: calc(var(--spacing-unit) * 3);
  border-left: 4px solid var(--color-accent);
}

.optional-notice strong {
  color: var(--color-primary);
}

/* Terms Box */
.terms-box {
  background: var(--color-cultural-light);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: var(--radius-md);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.form-group-checkbox {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.checkbox-label-block {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--spacing-unit) * 1.5);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.6;
}

.checkbox-label-block input[type="checkbox"] {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-secondary);
  flex-shrink: 0;
}

.checkbox-label-block a {
  color: var(--color-secondary);
  text-decoration: underline;
  font-weight: 600;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: calc(var(--spacing-unit) * 2);
  margin-top: calc(var(--spacing-unit) * 3);
}

.btn-primary,
.btn-secondary {
  padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: var(--spacing-unit);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  flex: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-large {
  padding: calc(var(--spacing-unit) * 2.5) calc(var(--spacing-unit) * 4);
  font-size: 1.2rem;
}

/* School Search Autocomplete */
.school-search-wrapper {
  position: relative;
}

.school-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-medium);
  display: none;
}

.school-suggestions.active {
  display: block;
}

.school-suggestion-item {
  padding: calc(var(--spacing-unit) * 2);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-bottom: 1px solid var(--color-border-light);
}

.school-suggestion-item:last-child {
  border-bottom: none;
}

.school-suggestion-item:hover {
  background: var(--color-card-hover);
}

.school-suggestion-item.selected {
  background: var(--color-cultural-accent);
}

.school-name {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.school-details {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.school-loading {
  padding: calc(var(--spacing-unit) * 2);
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Responsive Onboarding */
@media (max-width: 768px) {
  .onboarding-container {
    margin: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 3);
  }

  .onboarding-progress {
    padding: 0 calc(var(--spacing-unit) * 1);
  }

  .progress-label {
    font-size: 0.7rem;
  }

  .progress-circle {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }

  .role-cards {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
  }

  .year-level-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* Print - Hide Onboarding */
@media print {
  .onboarding-container,
  .onboarding-progress {
    display: none !important;
  }
}
