/**
 * Science In A Snapshot - Stylesheet
 * Modern, responsive design with accessibility focus
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Color Palette */
  --color-primary: #2E86AB;
  --color-secondary: #A23B72;
  --color-accent: #F18F01;

  /* Category Colors */
  --color-life-science: #4CAF50;
  --color-earth-science: #795548;
  --color-physical-science: #2196F3;

  /* Neutrals */
  --color-text-dark: #212121;
  --color-text-medium: #333333;
  --color-text-light: #757575;
  --color-text-muted: #666666;
  --color-bg-light: #FAFAFA;
  --color-bg-white: #FFFFFF;
  --color-border: #E0E0E0;

  /* Interactive / Focus */
  --color-primary-dark: #1E40AF;
  --color-primary-hover: #1a6b8a;
  --color-accent-dark: #D97706;
  --color-focus: #3b82f6;
  --color-interactive: #667eea;
  --color-interactive-dark: #764ba2;

  /* Feature Colors */
  --color-heart: #e91e63;
  --color-heart-bg: #fce4ec;
  --color-star: #f59e0b;
  --color-error: #d32f2f;
  --color-success-text: #2E7D32;

  /* Alerts & Warnings */
  --color-warning-bg: #FFF9C4;
  --color-warning-text: #F57F17;
  --color-warning-border: #FBC02D;

  /* Callout Backgrounds */
  --color-pedagogical-bg: #E3F2FD;
  --color-pedagogical-border: #2E86AB;
  --color-udl-bg: #E8F5E9;
  --color-udl-border: #4CAF50;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: Georgia, 'Times New Roman', serif;

  /* Fluid Typography */
  --font-size-xs: clamp(0.75rem, 1vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 1.2vw, 1rem);
  --font-size-base: clamp(1rem, 1.5vw, 1.125rem);
  --font-size-lg: clamp(1.25rem, 2vw, 1.5rem);
  --font-size-xl: clamp(1.75rem, 3vw, 2.25rem);
  --font-size-2xl: clamp(2.5rem, 5vw, 4rem);

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.25);

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

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --container-max-width: 1400px;
  --content-max-width: 900px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-dark);
  background-color: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 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-width: 0;
}

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

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

h1 {
  font-size: var(--font-size-2xl);
}

h2 {
  font-size: var(--font-size-xl);
}

h3 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ============================================
   Layout Containers
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ============================================
   Hero Section with Parallax
   ============================================ */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.parallax-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transform: translateZ(0);
  will-change: transform;
}

.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3),
    rgba(0, 0, 0, 0.6)
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-bg-white);
  padding: var(--spacing-xl);
  max-width: 800px;
}

.hero-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1s ease;
}

/* Beta badge with glitch animation */
.beta-badge {
  display: inline-block;
  font-size: 0.35em;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(220, 38, 38, 0.85);
  border: 1px solid rgba(255, 80, 80, 0.6);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.3em;
  position: relative;
  animation: fadeInUp 1s ease 0.4s backwards, glitch 3s infinite 2s;
}

.beta-badge::before,
.beta-badge::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
}

.beta-badge::before {
  color: #0ff;
  animation: glitch-before 3s infinite 2s;
}

.beta-badge::after {
  color: #f0f;
  animation: glitch-after 3s infinite 2s;
}

@keyframes glitch {
  0%, 92%, 100% {
    transform: none;
  }
  93% {
    transform: translate(-2px, 1px);
  }
  94% {
    transform: translate(2px, -1px);
  }
  95% {
    transform: translate(-1px, -1px);
  }
  96% {
    transform: none;
  }
}

@keyframes glitch-before {
  0%, 92%, 100% {
    opacity: 0;
    transform: none;
  }
  93% {
    opacity: 0.6;
    transform: translate(-3px, 0);
  }
  94% {
    opacity: 0.6;
    transform: translate(3px, 1px);
  }
  95% {
    opacity: 0.6;
    transform: translate(-2px, -1px);
  }
  96% {
    opacity: 0;
    transform: none;
  }
}

@keyframes glitch-after {
  0%, 92%, 100% {
    opacity: 0;
    transform: none;
  }
  93% {
    opacity: 0.6;
    transform: translate(3px, 0);
  }
  94% {
    opacity: 0.6;
    transform: translate(-3px, -1px);
  }
  95% {
    opacity: 0.6;
    transform: translate(2px, 1px);
  }
  96% {
    opacity: 0;
    transform: none;
  }
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
  font-weight: 300;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-tagline {
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: var(--spacing-xl);
  text-shadow: 0 0 20px rgba(125, 211, 252, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease 0.4s backwards, taglineGlow 4s ease-in-out 1.5s infinite;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

@keyframes taglineGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(125, 211, 252, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3); }
  50% { text-shadow: 0 0 30px rgba(125, 211, 252, 0.7), 0 0 60px rgba(125, 211, 252, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3); }
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  justify-content: center;
  align-items: center;
}

.explore-btn,
.overview-btn,
.tutorial-btn {
  background-color: var(--color-accent);
  color: var(--color-bg-white);
  border: none;
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 1s ease 0.4s backwards;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

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

.overview-btn:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.tutorial-btn {
  background-color: #9b8ec4;
}

.tutorial-btn:hover {
  background-color: #8678b0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.explore-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.explore-btn:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.explore-btn:active {
  transform: translateY(0);
}

.arrow-down {
  font-size: 1.25rem;
  animation: bounce 2s infinite;
}

.hero-signature {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  width: 180px;
  height: auto;
  z-index: 3;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  animation: fadeInUp 1s ease 0.6s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ============================================
   Gallery Section
   ============================================ */
.gallery-section {
  padding: var(--spacing-2xl) 0;
  background-color: var(--color-bg-white);
  position: relative;
  /* overflow: hidden; REMOVED - breaks sticky positioning */
}

/* CSS Particles Background */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: floatUpDown ease-in-out infinite;
}

@keyframes floatUpDown {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(var(--drift-x), var(--drift-y));
  }
}

/* Ensure gallery content is above particles */
.gallery-section .container {
  position: relative;
  z-index: 1;
}

/* Gallery Header Wrapper (Sticky Container) */
.gallery-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-white);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0);
  margin-bottom: var(--spacing-xl);
}

/* Enhanced styling when stuck to top */
.gallery-header-wrapper.is-stuck {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Gallery Header (Logo + Filters) */
.gallery-header {
  padding: var(--spacing-md) 0;
  transition: padding 0.3s ease;
}

.gallery-header-wrapper.is-stuck .gallery-header {
  padding: 0.75rem 0;
}

.gallery-header .container {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.gallery-logo {
  width: 220px;
  height: auto;
  flex-shrink: 0;
  transition: width 0.3s ease;
}

/* Slightly smaller logo when stuck */
.gallery-header-wrapper.is-stuck .gallery-logo {
  width: 180px;
}

/* Category Filters */
.category-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--spacing-xs);
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.filter-btn {
  background: none;
  color: var(--color-text-dark);
  border: none;
  padding: 6px 10px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  border-radius: var(--radius-sm);
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.filter-btn:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

.filter-btn:hover::after {
  transform: scaleX(1);
}

.filter-btn.active {
  font-weight: 700;
  color: var(--color-primary);
}

.filter-btn.active::after {
  transform: scaleX(1);
}

.filter-btn[data-category="life-science"].active {
  color: var(--color-life-science);
}

.filter-btn[data-category="life-science"].active::after {
  background: var(--color-life-science);
}

.filter-btn[data-category="earth-space-science"].active {
  color: var(--color-earth-science);
}

.filter-btn[data-category="earth-space-science"].active::after {
  background: var(--color-earth-science);
}

.filter-btn[data-category="physical-science"].active {
  color: var(--color-physical-science);
}

.filter-btn[data-category="physical-science"].active::after {
  background: var(--color-physical-science);
}

.category-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-primary);
  color: white;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

.filter-btn[data-category="all"] .category-badge {
  background: var(--color-primary);
}

.filter-btn[data-category="life-science"] .category-badge {
  background: var(--color-life-science);
}

.filter-btn[data-category="earth-space-science"] .category-badge {
  background: var(--color-earth-science);
}

.filter-btn[data-category="physical-science"] .category-badge {
  background: var(--color-physical-science);
}


/* ============================================
   Smart Search Bar (in sticky header)
   ============================================ */
.header-search-grade {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 1;
  margin-left: auto;
  min-width: 0;
}

.smart-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  transition: all var(--transition-base);
  min-width: 200px;
  max-width: 320px;
  flex: 1 1 auto;
}

.smart-search-wrapper:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.smart-search-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.smart-search-icon {
  padding-left: 10px;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
  line-height: 1;
}

.smart-search-input {
  flex: 1;
  padding: 6px 8px 6px 6px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-dark);
  width: 100%;
  min-width: 0;
}

/* Hide native WebKit search clear button (we use a custom one) */
.smart-search-input::-webkit-search-cancel-button,
.smart-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.smart-search-input::placeholder {
  color: var(--color-text-light);
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.smart-search-clear {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-right: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.smart-search-clear:hover {
  background: var(--color-bg-light);
  color: var(--color-text-dark);
}

/* Compact search when stuck */
.gallery-header-wrapper.is-stuck .smart-search-wrapper {
  min-width: 180px;
}

.gallery-header-wrapper.is-stuck .smart-search-input {
  padding: 4px 6px 4px 4px;
  font-size: 0.82rem;
}

/* Grade Text Selector */
.grade-text-selector {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.grade-text-btn {
  background: none;
  border: none;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.grade-text-btn:hover {
  color: var(--color-primary-dark, #4338ca);
  text-decoration: underline solid;
  background: rgba(99, 102, 241, 0.06);
}

.grade-chevron {
  font-size: 0.75em;
  opacity: 0.7;
}

.grade-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 4px;
  min-width: 160px;
}

.grade-popover button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--color-text-dark);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.grade-popover button svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.grade-popover button:hover svg {
  opacity: 1;
  stroke: white;
}

.grade-popover button:hover {
  color: white;
}

.grade-popover button[data-grade="kindergarten"]:hover { background: #ec4899; }
.grade-popover button[data-grade="first-grade"]:hover  { background: #f59e0b; }
.grade-popover button[data-grade="second-grade"]:hover  { background: #10b981; }
.grade-popover button[data-grade="third-grade"]:hover   { background: #6366f1; }
.grade-popover button[data-grade="fourth-grade"]:hover  { background: #06b6d4; }
.grade-popover button[data-grade="fifth-grade"]:hover   { background: #8b5cf6; }

.grade-popover button.active {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
}

.grade-popover button.active svg {
  opacity: 1;
  stroke: white;
}

/* ============================================
   Filter Toggles Row (below hero)
   ============================================ */
.filter-toggles-row {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  align-items: center;
  margin: 0 auto var(--spacing-lg);
  padding: var(--spacing-xs) 0;
}

.filter-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-dark);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  position: relative;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
}

.filter-toggle:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

.filter-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.filter-toggle:hover::after {
  transform: scaleX(1);
}

.filter-toggle[aria-pressed="true"] {
  font-weight: 700;
  color: var(--color-primary);
}

.filter-toggle[aria-pressed="true"]::after {
  transform: scaleX(1);
}

.filter-toggle-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.filter-toggle-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--color-primary);
  color: white;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

.filter-toggle-label {
  line-height: 1;
}

.sort-btn-container {
  position: relative;
}

.sort-toggle {
  color: var(--color-text-dark);
  font-size: var(--font-size-sm);
}

.sort-btn-icon {
  flex-shrink: 0;
}

.sort-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  margin-top: 4px;
  overflow: hidden;
}

.sort-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text-dark);
  transition: background 0.15s ease;
}

.sort-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.sort-dropdown-item:hover {
  color: white;
}

.sort-dropdown-item:hover svg {
  opacity: 1;
  stroke: white;
}

.sort-dropdown-item[data-sort="newest"]:hover { background: #6366f1; }
.sort-dropdown-item[data-sort="oldest"]:hover { background: #8b5cf6; }
.sort-dropdown-item[data-sort="rating"]:hover { background: #f59e0b; }
.sort-dropdown-item[data-sort="views"]:hover { background: #06b6d4; }
.sort-dropdown-item[data-sort="popular"]:hover { background: #ef4444; }
.sort-dropdown-item[data-sort="songs"]:hover { background: #e67e22; }

.sort-dropdown-item.active {
  color: var(--color-interactive);
  font-weight: 600;
}

.sort-dropdown-item.active svg {
  opacity: 1;
  stroke: var(--color-interactive);
}

.sort-dropdown-item + .sort-dropdown-item {
  border-top: 1px solid var(--color-border);
}

/* Mobile: hide search+grade from sticky bar */
@media (max-width: 900px) {
  .header-search-grade {
    display: none;
  }
}

@media (max-width: 640px) {
  .filter-toggles-row {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .filter-toggle-label {
    display: none;
  }
  .collection-label {
    display: none;
  }
}

/* ============================================
   NGSS Standards Search (suggestions + active filter)
   ============================================ */

/* Suggestions Dropdown */
.ngss-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.ngss-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ngss-suggestion:hover,
.ngss-suggestion.highlighted {
  background: var(--color-bg-light);
}

.ngss-suggestion.zero-results {
  opacity: 0.5;
}

.ngss-suggestion-type {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.ngss-type-pe {
  background: #E8EAF6;
  color: #283593;
}

.ngss-type-dci {
  background: var(--color-udl-bg);
  color: var(--color-success-text);
}

.ngss-type-ccc {
  background: #FFF3E0;
  color: #E65100;
}

.ngss-suggestion-code {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

.ngss-suggestion-count {
  font-size: 0.78rem;
  color: var(--color-text-light);
  flex-shrink: 0;
}

.ngss-no-results {
  padding: 14px;
  text-align: center;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

/* Active Filter Banner */
.ngss-active-filter {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-sm);
}

.ngss-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  color: white;
  box-shadow: var(--shadow-sm);
}

.ngss-filter-pill strong {
  font-weight: 700;
}

.ngss-filter-pill .ngss-type-pe,
.ngss-filter-pill .ngss-type-dci,
.ngss-filter-pill .ngss-type-ccc {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.ngss-filter-count {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.ngss-filter-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  color: white;
  transition: all 0.2s ease;
  padding: 0;
}

.ngss-filter-remove:hover {
  background: rgba(255, 255, 255, 0.35);
}

@media (max-width: 640px) {
  .ngss-active-filter {
    padding: 0 var(--spacing-md);
  }
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Gallery Item Card */
.gallery-item {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  animation: fadeIn 0.5s ease;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: var(--color-bg-light);
  filter: blur(0);
}

/* Phenomenon hover overlay on gallery cards (desktop only) */
.card-hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 28px 12px 10px;
  font-size: var(--font-size-xs);
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

.gallery-item:hover .card-hover-overlay {
  opacity: 1;
}

/* Hide hover overlay on touch devices (no hover capability) */
@media (hover: none) {
  .card-hover-overlay {
    display: none;
  }
}

.image-container img,
.image-container picture {
  width: 100%;
  display: block;
}

.image-container img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-base), opacity 0.3s ease;
}

.gallery-item:hover .image-container img {
  transform: scale(1.05);
}

/* Item Info Section (Below Image) */
.item-info {
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--color-bg-white);
  border-top: 1px solid var(--color-border);
}

.item-info-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-info-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-post-divider {
  color: var(--color-border);
  font-size: 14px;
  opacity: 0.5;
  user-select: none;
  margin-left: auto;
}

.item-category {
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex: 1;
}

.item-category span {
  font-size: 1.25rem;
}

/* Card Actions Row (Educational Content + Storyline) */
.item-info-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

/* Educational Content Text Button */
.edu-content-btn {
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: all var(--transition-base);
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
}

.edu-content-btn:hover,
.edu-content-btn:focus-visible {
  text-decoration: underline;
  color: var(--color-primary-hover);
}

.edu-content-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Creative Commons License Icons */
.cc-license-link {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.cc-license-link:hover {
  opacity: 1;
}

.cc-icon {
  width: 22px;
  height: 22px;
}

/* Post Icons */
.card-post-btn,
.card-post-btn:link,
.card-post-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.card-post-btn svg {
  width: 18px;
  height: 18px;
}

.card-post-btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.card-post-btn.post-plat-x:hover {
  color: #000;
}

.card-post-btn.post-plat-bs:hover {
  color: #0085ff;
}

.card-post-btn.post-plat-fb:hover {
  color: #1877F2;
}

/* Creative Commons License Modal */
.cc-modal-content {
  background: white;
  border-radius: 16px;
  width: 95%;
  height: 95vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease-out;
  position: relative;
  z-index: 10001;
  display: flex;
  flex-direction: column;
}

.cc-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 0 0 16px 16px;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--color-text-light);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--spacing-md);
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

/* Load More Button */
.load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: var(--spacing-xl) 0;
}

.load-more-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin: 0;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.45);
}

.load-more-btn:active {
  transform: translateY(0);
}

.load-more-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

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

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

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

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  70% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalPopOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

/* ============================================
   Modal
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  animation: fadeIn 0.3s ease;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

/* Hide modal when not displayed */
.modal[style*="display: none"] .modal-overlay,
.modal:not([style*="display: flex"]):not(.active) .modal-overlay {
  display: none !important;
}

/* Modal prev/next navigation buttons */
.modal-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10002;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal-nav-btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.modal-prev-btn {
  left: max(0.5vw, 8px);
}

.modal-next-btn {
  right: max(0.5vw, 8px);
}

/* Hide modal nav on mobile — modal is full-screen, buttons would overlap content */
@media (max-width: 640px) {
  .modal-nav-btn {
    display: none;
  }
}

.modal-content {
  position: relative;
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  width: 95vw;
  max-width: 1400px;
  height: 95vh;
  height: 95dvh;
  max-height: 95vh;
  max-height: 95dvh;
  overflow: visible;
  box-shadow: var(--shadow-xl);
  animation: modalZoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal Content Animations */
@keyframes contentFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply staggered animations to modal content */
.modal-body.animated h2 {
  animation: contentFadeInUp 0.4s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.modal-body.animated h3 {
  animation: contentFadeInUp 0.4s ease forwards;
  animation-delay: 0.15s;
  opacity: 0;
}

.modal-body.animated p,
.modal-body.animated ul,
.modal-body.animated ol {
  animation: contentFadeInUp 0.4s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.modal-body.animated .pedagogical-tip {
  animation: contentFadeInUp 0.5s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.modal-body.animated .udl-suggestions {
  animation: contentFadeInUp 0.5s ease forwards;
  animation-delay: 0.35s;
  opacity: 0;
}

.modal-body.animated .ngss-link {
  animation: contentFadeInUp 0.4s ease forwards;
  animation-delay: 0.25s;
  opacity: 0;
}

/* Stagger multiple items of same type */
.modal-body.animated p:nth-of-type(1) { animation-delay: 0.2s; }
.modal-body.animated p:nth-of-type(2) { animation-delay: 0.25s; }
.modal-body.animated p:nth-of-type(3) { animation-delay: 0.3s; }
.modal-body.animated p:nth-of-type(4) { animation-delay: 0.35s; }
.modal-body.animated p:nth-of-type(n+5) { animation-delay: 0.4s; }

/* AI Disclaimer */
.ai-disclaimer {
  background-color: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning-border);
  padding: var(--spacing-md);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-disclaimer .warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--color-warning-text);
  animation: warningPulse 2s ease-in-out 3;
  animation-delay: 0.5s;
}

@keyframes warningPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  25% { transform: scale(1.3); opacity: 1; }
  50% { transform: scale(1); opacity: 0.7; }
  75% { transform: scale(1.2); opacity: 1; }
}

.ai-disclaimer p {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--color-text-dark);
  margin: 0;
}

/* Modal Header */
.modal-header {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: var(--spacing-md);
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.modal-thumbnail {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.modal-title-wrapper {
  min-width: 0;
}

/* Modal Recommendations ("more like this") */
.modal-recommendations {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.modal-recommendations-label {
  font-size: 0.7rem;
  color: var(--color-text-light);
  text-transform: lowercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.modal-rec-thumbs {
  display: flex;
  gap: 10px;
}

.modal-rec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  max-width: 75px;
}

.modal-rec-item:focus {
  outline: 2px solid var(--color-primary, #4a90d9);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.modal-rec-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.modal-rec-item:hover .modal-rec-thumb {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.modal-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-xs);
  word-wrap: break-word;
}

.modal-category {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.close-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-medium);
  cursor: pointer;
  border-radius: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.close-btn:hover {
  animation: spin 0.5s ease-in-out;
  color: #000;
}

.close-btn svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}

/* Modal Body */
.modal-body {
  padding: var(--spacing-xl);
  padding-bottom: calc(var(--spacing-xl) * 2); /* Extra bottom padding for scrolling */
  line-height: var(--line-height-relaxed);
  overflow-y: auto;
  flex: 1;
}

.modal-body h2 {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 2px solid var(--color-border);
  color: var(--color-primary);
}

.modal-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.modal-body ul,
.modal-body ol {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.modal-body li {
  margin-bottom: var(--spacing-xs);
}

.modal-body strong {
  font-weight: 600;
  color: var(--color-text-dark);
}

.modal-body code {
  background-color: var(--color-bg-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

/* Pedagogical Tip Callout */
.pedagogical-tip {
  background-color: var(--color-pedagogical-bg);
  border-left: 4px solid var(--color-pedagogical-border);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  border-radius: var(--radius-md);
}

.pedagogical-tip::before {
  content: "💡 Teaching Tip: ";
  font-weight: bold;
  color: var(--color-pedagogical-border);
  display: block;
  margin-bottom: var(--spacing-xs);
}

/* UDL Strategies Callout */
.udl-strategies {
  background-color: var(--color-udl-bg);
  border-left: 4px solid var(--color-udl-border);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  border-radius: var(--radius-md);
}

.udl-strategies::before {
  content: "♿ Universal Design for Learning: ";
  font-weight: bold;
  color: var(--color-udl-border);
  display: block;
  margin-bottom: var(--spacing-xs);
}

/* NGSS Links */
.ngss-link {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-bg-white);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
  margin: 0 4px;
}

.ngss-link:hover {
  background-color: var(--color-accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Modal Footer */
.modal-footer {
  padding: 6px var(--spacing-md);
  background-color: var(--color-bg-light);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.modal-footer .copyright {
  font-size: 0.7rem;
  color: var(--color-text-light);
  margin: 0;
}

.copy-attribution-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-attribution-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg-light);
}

.copy-attribution-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.image-modal-title-section .copy-attribution-btn {
  align-self: flex-start;
}

.loading-content {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--color-text-light);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background-color: var(--color-text-dark);
  color: var(--color-bg-light);
  padding: var(--spacing-xl) 0;
}

/* Footer Flexbox Container */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

/* Arkansas Section (Left) */
.footer-arkansas {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-xs);
}

.footer-arkansas-image {
  width: 100px;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.footer-arkansas-image:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.6));
}

.footer-arkansas-image:active {
  transform: scale(1.05);
}

.footer-arkansas-text {
  font-size: var(--font-size-sm);
  opacity: 0.8;
  margin: 0;
}

/* Copyright Section (Right) */
.footer-copyright {
  text-align: right;
}

.footer-copyright p {
  margin-bottom: var(--spacing-xs);
}

.footer-copyright p:last-child {
  margin-bottom: 0;
}

.footer-credits {
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

.footer-credits a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-credits a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-signature {
  height: 50px;
  width: auto;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.8;
  display: block;
  margin-top: var(--spacing-xs);
  margin-left: auto;
}

.footer-signature:hover {
  transform: scale(1.1);
  opacity: 1;
}

.footer-signature-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xs);
}

.footer-signature-row .footer-signature {
  margin-top: 0;
  margin-left: 0;
}

.footer-x-link {
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-x-link:hover {
  opacity: 1;
  transform: scale(1.1);
}

.footer-x-icon {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
  fill: #ffffff;
}

/* ============================================
   Image Viewer Modal
   ============================================ */
#image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#image-modal.active {
  display: flex;
}

#image-modal.active .modal-overlay {
  animation: fadeIn 0.5s ease forwards;
}

#image-modal.active .image-modal-content {
  animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Closing animation */
#image-modal.closing .modal-overlay {
  animation: fadeOut 0.3s ease forwards;
}

#image-modal.closing .image-modal-content {
  animation: modalPopOut 0.3s ease forwards;
}

/* Hide overlay when image modal is not active */
#image-modal:not(.active) .modal-overlay {
  display: none;
}

.image-modal-content {
  position: relative;
  background: var(--color-bg-white);
  padding: 0;
  border-radius: var(--radius-lg);
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* Image Modal Header */
.image-modal-header {
  background: var(--color-warning-bg);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0e6b3;
  position: relative;
  min-height: 60px;
  z-index: 1;
}

.image-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-bg-light);
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.image-modal-footer .image-credit {
  margin: 0;
  font-size: 0.7rem;
  color: var(--color-text-light);
  font-style: normal;
}

.image-modal-footer .copy-attribution-btn {
  font-size: 0.7rem;
}

.image-modal-header .header-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 70px;
  width: auto;
  z-index: 1;
}

.image-modal-title-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  position: relative;
  z-index: 2;
}

.image-modal-title {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-text-dark);
  font-weight: 600;
}

.image-modal-header .image-credit {
  margin: 0;
  text-align: left;
  font-size: 0.7rem;
  color: var(--color-text-light);
  font-style: normal;
}

/* Removed .image-modal-close-btn override - using base .close-btn styles */

.image-credit {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-md) 0;
  font-style: italic;
}

.image-modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: var(--spacing-lg);
  overflow: visible;
  position: relative;
  z-index: 2;
}

.image-modal-body img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* Indicate images are clickable */
.gallery-item .image-container img {
  cursor: pointer;
  transition: opacity var(--transition-base);
}

.gallery-item .image-container img:hover {
  opacity: 0.9;
}

/* ============================================
   Overview Video Modal
   ============================================ */
#overview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#overview-modal.active {
  display: flex;
}

/* Hide overlay when overview modal is not active */
#overview-modal:not(.active) .modal-overlay {
  display: none;
}

.video-modal-content {
  position: relative;
  background: var(--color-bg-white);
  padding: 0;
  border-radius: var(--radius-lg);
  max-width: 90vw;
  width: 800px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Video Modal Header */
.video-modal-header {
  background: var(--color-warning-bg);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0e6b3;
}

.video-modal-title {
  text-align: center;
  font-size: var(--font-size-xl);
  color: var(--color-text-dark);
  margin: 0;
  flex: 1;
}

/* Removed .video-modal-close-btn override - using base .close-btn styles */

.video-modal-body {
  position: relative;
  width: 100%;
  padding: var(--spacing-lg);
  padding-bottom: calc(56.25% + var(--spacing-lg)); /* 16:9 aspect ratio + padding */
  height: 0;
  overflow: hidden;
}

.video-modal-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

/* ============================================
   Arkansas Portal Modal
   ============================================ */
#arkansas-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#arkansas-modal.active {
  display: flex;
}

/* Hide overlay when Arkansas modal is not active */
#arkansas-modal:not(.active) .modal-overlay {
  display: none;
}

.arkansas-modal-content {
  position: relative;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  width: 95vw;
  max-width: 1400px;
  height: 90vh;
  box-shadow: var(--shadow-xl);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

.arkansas-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.arkansas-modal-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-text-dark);
}

.arkansas-modal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.arkansas-modal-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   The Visionary Modal
   ============================================ */
#visionary-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#visionary-modal.active {
  display: flex;
}

/* Hide overlay when visionary modal is not active */
#visionary-modal:not(.active) .modal-overlay {
  display: none;
}

.visionary-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 95vw;
  max-width: 1400px;
  height: 95vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.3s ease-out;
  overflow: hidden;
}

.visionary-modal-header {
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.visionary-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

/* Removed .visionary-modal-header .close-btn override - using base .close-btn styles */

.visionary-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl);
  padding-bottom: calc(var(--spacing-xl) * 2);
  align-items: start;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.visionary-text {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.visionary-text p {
  margin: 0;
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--color-text-dark);
  text-align: justify;
}

.visionary-signature {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: var(--spacing-lg);
}

.visionary-signature img {
  max-width: 300px;
  width: 100%;
  height: auto;
}

.visionary-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.visionary-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

/* Staggered Fade-In Animations */
.visionary-modal-body.animated .visionary-text p:nth-of-type(1) {
  animation: contentFadeInUp 0.5s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.visionary-modal-body.animated .visionary-text p:nth-of-type(2) {
  animation: contentFadeInUp 0.5s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.visionary-modal-body.animated .visionary-image {
  animation: slideInRight 0.6s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

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

/* Visionary Link Styling */
.visionary-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.visionary-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ============================================
   Scroll to Gallery Button
   ============================================ */
.scroll-to-gallery-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.scroll-to-gallery-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-gallery-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(241, 143, 1, 0.5);
}

.scroll-to-gallery-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.scroll-to-gallery-btn svg {
  width: 24px;
  height: 24px;
}

/* Modal Scroll-to-Top Button */
.modal-scroll-top-btn {
  position: absolute;
  bottom: 1rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.modal-scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.modal-scroll-top-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(46, 134, 171, 0.5);
}

.modal-scroll-top-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.modal-scroll-top-btn svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .hero-tagline {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }

  /* ── Mobile Modal: full-screen takeover ── */
  .modal {
    padding: 0;
  }

  .modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .ai-disclaimer {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-xs);
  }

  .ai-disclaimer .warning-icon {
    font-size: 1rem;
  }

  .ai-disclaimer p {
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .modal-header {
    grid-template-columns: 60px 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .modal-thumbnail {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 60px;
    height: 60px;
    margin-bottom: 0;
  }

  .modal-title-wrapper {
    grid-column: 2;
    grid-row: 1;
  }

  .modal-title {
    font-size: var(--font-size-md);
    margin-bottom: 2px;
  }

  .modal-category {
    font-size: var(--font-size-xs);
  }

  .close-btn {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    height: 44px;
  }

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

  .modal-recommendations {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: var(--spacing-xs);
  }

  .modal-rec-thumb {
    width: 40px;
    height: 40px;
  }

  .modal-rec-item {
    max-width: 45px;
  }

  .modal-rec-label {
    display: none;
  }

  .modal-body {
    padding: var(--spacing-md);
  }

  .modal-footer {
    padding: 4px var(--spacing-sm);
  }

  .modal-footer .copyright {
    font-size: 0.65rem;
  }

  .parallax-background {
    background-attachment: scroll;
  }

  .video-modal-content {
    width: 95vw;
    padding: var(--spacing-md);
  }

  .video-modal-title {
    font-size: var(--font-size-lg);
  }

  .hero-signature {
    width: 140px;
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .visionary-modal-body {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) * 2); /* Extra bottom padding for mobile */
  }

  .visionary-image {
    order: -1; /* Image on top for mobile */
  }

  .visionary-signature img {
    max-width: 200px;
  }

  .visionary-modal-content {
    width: 95vw;
    height: 95vh;
  }

  .visionary-modal-header {
    padding: 20px;
  }

  .visionary-modal-header h2 {
    font-size: 1.3rem;
  }

  .visionary-text p {
    text-align: left;
  }

  .scroll-to-gallery-btn {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }

  .scroll-to-gallery-btn svg {
    width: 20px;
    height: 20px;
  }

  .modal-scroll-top-btn {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }

  .modal-scroll-top-btn svg {
    width: 20px;
    height: 20px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }

  .footer-arkansas {
    align-items: center;
    text-align: center;
  }

  .footer-arkansas-image {
    width: 80px;
  }

  .footer-copyright {
    text-align: center;
  }
}

/* ============================================
   Image Viewer Modal — Mobile Full-Screen
   ============================================ */
@media (max-width: 768px) {
  #image-modal {
    padding: 0;
  }

  .image-modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .image-modal-header {
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 48px;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: 0;
    position: relative;
  }

  .image-modal-title-section {
    flex: 1 1 0;
    min-width: 0;
    order: 1;
  }

  .image-modal-title {
    font-size: var(--font-size-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .image-modal-header .image-credit {
    display: none;
  }

  .image-modal-header .modal-action-btn {
    order: 3;
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .image-modal-header .close-btn {
    order: 2;
    width: 44px;
    height: 44px;
  }

  .image-modal-header .header-logo {
    display: none;
  }

  .image-modal-body {
    padding: var(--spacing-sm);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #111;
  }

  .image-modal-body img {
    border-radius: 0;
  }

  .image-modal-body img {
    border-radius: var(--radius-sm);
  }

  .image-modal-footer {
    padding: var(--spacing-xs) var(--spacing-sm);
    padding-bottom: calc(var(--spacing-xs) + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
  }

  .image-modal-footer .image-credit {
    font-size: 0.6rem;
  }

  /* Simple fade instead of bouncy modalPop at full-screen */
  #image-modal.active .image-modal-content {
    animation: fadeIn 0.3s ease forwards;
  }

  #image-modal.closing .image-modal-content {
    animation: fadeOut 0.3s ease forwards;
  }
}

/* Landscape on phones — maximize content space */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  /* Image viewer: hide title, minimize chrome */
  .image-modal-title-section {
    display: none;
  }

  .image-modal-header {
    padding: 4px var(--spacing-sm);
    min-height: 40px;
  }

  .image-modal-body {
    padding: 2px;
  }

  .image-modal-footer {
    padding: 2px var(--spacing-sm);
  }

  .image-modal-footer .image-credit {
    font-size: 0.55rem;
  }

  /* Educational modal: compact everything */
  .modal-header {
    grid-template-columns: 40px 1fr auto;
    padding: 4px var(--spacing-sm);
  }

  .modal-thumbnail {
    width: 40px;
    height: 40px;
  }

  .modal-recommendations {
    display: none !important;
  }

  .modal-stats {
    padding: 4px var(--spacing-sm);
  }

  .modal-grade-selector {
    padding: 2px var(--spacing-xs);
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    padding: 0 var(--spacing-md);
  }

  .explore-btn,
  .overview-btn,
  .tutorial-btn {
    width: 100%;
    justify-content: center;
  }

  .hero-signature {
    width: 120px;
    bottom: 1rem;
    right: 1rem;
  }

  .site-footer {
    padding: var(--spacing-lg) 0;
  }

  .footer-arkansas-image {
    width: 65px;
  }

  .footer-arkansas-text,
  .footer-credits {
    font-size: var(--font-size-xs);
  }

  .gallery-header .container {
    flex-direction: column;
  }

  .gallery-header {
    padding: 0.5rem 0;
  }

  .gallery-header-wrapper.is-stuck .gallery-header {
    padding: 0.5rem 0;
  }

  .gallery-logo {
    width: 140px;
  }

  .gallery-header-wrapper.is-stuck .gallery-logo {
    width: 120px;
  }

  .category-filters {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
    justify-content: center;
  }

  /* ── Extra-compact modal for small phones ── */
  .ai-disclaimer {
    display: none; /* Hide AI disclaimer on small phones to save space */
  }

  .modal-recommendations {
    display: none !important; /* Hide "more like this" on phones — !important overrides JS inline style */
  }

  .modal-header {
    grid-template-columns: 50px 1fr auto;
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: var(--spacing-xs);
  }

  .modal-thumbnail {
    width: 50px;
    height: 50px;
  }

  .modal-title {
    font-size: var(--font-size-sm);
  }

  .modal-grade-selector {
    gap: 8px;
    padding: var(--spacing-xs);
  }

  .modal-grade-link {
    font-size: 0.75rem;
    padding: 4px 6px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal-stats {
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: 6px;
  }

  .lesson-pdf-btn,
  .five-e-pdf-btn,
  .edp-pdf-btn,
  .vocab-flashcard-btn,
  .exit-ticket-btn,
  .rubric-btn,
  .notice-wonder-btn,
  .talk-moves-btn,
  .diff-strategy-btn,
  .cer-btn,
  .probe-btn {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-width: 1.5px;
  }

  .lesson-pdf-btn svg,
  .five-e-pdf-btn svg,
  .edp-pdf-btn svg,
  .vocab-flashcard-btn svg,
  .exit-ticket-btn svg,
  .rubric-btn svg,
  .notice-wonder-btn svg,
  .talk-moves-btn svg,
  .diff-strategy-btn svg,
  .cer-btn svg,
  .probe-btn svg {
    width: 14px;
    height: 14px;
  }

  .stars-display .stars .star {
    font-size: 1rem;
  }

  .stars-display .rating-text {
    font-size: 0.7rem;
  }

  /* Icon-only for stats bar buttons on small phones */
  .modal-stats .lesson-pdf-btn span,
  .modal-stats .five-e-pdf-btn span,
  .modal-stats .edp-pdf-btn span,
  .modal-stats .vocab-flashcard-btn span,
  .modal-stats .exit-ticket-btn span,
  .modal-stats .rubric-btn span,
  .modal-stats .notice-wonder-btn span,
  .modal-stats .talk-moves-btn span,
  .modal-stats .diff-strategy-btn span,
  .modal-stats .cer-btn span,
  .modal-stats .probe-btn span {
    display: none;
  }

  .modal-stats .lesson-pdf-btn,
  .modal-stats .five-e-pdf-btn,
  .modal-stats .edp-pdf-btn,
  .modal-stats .vocab-flashcard-btn,
  .modal-stats .exit-ticket-btn,
  .modal-stats .rubric-btn,
  .modal-stats .notice-wonder-btn,
  .modal-stats .talk-moves-btn,
  .modal-stats .diff-strategy-btn,
  .modal-stats .cer-btn,
  .modal-stats .probe-btn {
    padding: 6px 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  /* Icon-only for favorite/feedback/share on small phones */
  .modal-stats .favorite-label,
  .modal-stats .share-label,
  .modal-stats .modal-feedback-btn span {
    display: none;
  }

  .modal-stats .modal-favorite-btn,
  .modal-stats .modal-feedback-btn,
  .modal-stats .modal-share-btn {
    padding: 6px 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  /* Hide views count on phones (visible on gallery cards) */
  .modal-stats .views-count {
    display: none;
  }

  .modal-body {
    padding: var(--spacing-sm);
  }

  .modal-footer {
    padding: 4px var(--spacing-xs);
  }

  .modal-scroll-top-btn {
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    right: 0.5rem;
    width: 40px;
    height: 40px;
  }

  /* Image viewer — icon-only action buttons on small phones */
  .image-modal-header .modal-action-btn span {
    display: none;
  }

  .image-modal-header .modal-action-btn {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .image-modal-body {
    padding: var(--spacing-xs);
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .hero-section,
  .category-filters,
  .search-container,
  .site-footer,
  .notebook-icon,
  .close-btn {
    display: none;
  }

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

  .modal {
    position: relative;
    padding: 0;
  }

  .modal-overlay {
    display: none;
  }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .parallax-background {
    background-attachment: scroll;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
  }

  .filter-btn {
    border-width: 3px;
  }
}


/* ============================================
   Ratings and Views System
   ============================================ */

/* Card Stats Container — Pill Badges */
.card-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px var(--spacing-sm);
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg-light);
}

/* Badge Base */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  position: relative;
  cursor: default;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.badge:hover,
.badge:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.badge:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

/* Tooltip above badge */
.badge[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background-color: var(--color-text-dark);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* Tooltip arrow */
.badge[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--color-text-dark);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.badge[data-tooltip]:hover::after,
.badge[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.badge[data-tooltip]:hover::before,
.badge[data-tooltip]:focus-visible::before {
  opacity: 1;
}

.badge-icon {
  font-size: 0.85em;
  line-height: 1;
}

/* Views Badge */
.badge-views {
  background-color: #F3E8FF;
  color: #6B21A8;
}

/* Rating Badge */
.badge-rating {
  background-color: #DCFCE7;
  color: #166534;
}

/* Comments Badge */
.badge-comments {
  background-color: #E0E7FF;
  color: #3730A3;
}

/* Legacy selectors for JS update compatibility */
.views-count,
.rating-value,
.comment-count {
  font-weight: 600;
}

/* Modal Stats */
.modal-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-light);
}

/* ============================================
   Google Workspace Export Bar
   ============================================ */
.modal-export-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-white);
  flex-wrap: wrap;
}

.export-bar-label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  margin-right: 4px;
  flex-shrink: 0;
}

.export-bar-label svg {
  height: 16px;
  width: auto;
}

.google-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--color-text-medium);
  font-size: var(--font-size-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}

.google-export-btn:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.google-export-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.google-export-btn svg {
  flex-shrink: 0;
}

/* Google Export Auth Dialog */
.google-export-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.google-export-dialog {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
}

.google-export-dialog h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0 0 var(--spacing-sm) 0;
}

.google-export-dialog p {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 0 0 var(--spacing-sm) 0;
}

.google-export-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.google-export-dialog-cancel {
  padding: 8px 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: none;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
}

.google-export-dialog-cancel:hover {
  border-color: var(--color-text-dark);
  color: var(--color-text-dark);
}

.google-export-dialog-continue {
  padding: 8px 20px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
}

.google-export-dialog-continue:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

/* Responsive: stack export buttons on small screens */
@media (max-width: 640px) {
  .modal-export-bar {
    gap: 6px;
    padding: 8px var(--spacing-sm);
  }

  .google-export-btn {
    font-size: 11px;
  }

  .export-bar-label {
    display: none;
  }
}

/* Export bar toggle — hidden by default on desktop, shown on phones */
.export-bar-toggle {
  display: none;
}

@media (max-width: 480px) {
  .export-bar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-bg-white);
    color: var(--color-text-medium);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    font-family: inherit;
    transition: background var(--transition-base);
  }

  .export-bar-toggle:hover,
  .export-bar-toggle:focus-visible {
    background: var(--color-bg-light);
  }

  .export-bar-chevron {
    transition: transform 0.2s ease;
  }

  .modal-export-bar:not(.export-bar-collapsed) .export-bar-chevron {
    transform: rotate(180deg);
  }

  .modal-export-bar.export-bar-collapsed .google-export-btn {
    display: none;
  }

  .modal-export-bar.export-bar-collapsed .export-bar-label {
    display: none;
  }

  .modal-export-bar {
    padding: 6px var(--spacing-sm);
  }
}

/* ============================================
   Modal Grade Selector Bar
   ============================================ */
.modal-grade-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-white);
}

.modal-grade-link {
  position: relative;
  display: inline-block;
  padding: 6px 8px;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.modal-grade-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-base), left var(--transition-base);
}

.modal-grade-link:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

.modal-grade-link:hover::after {
  width: 100%;
  left: 0;
}

.modal-grade-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.modal-grade-link.active {
  color: var(--color-primary);
  font-weight: 700;
}

.modal-grade-link.active::after {
  width: 100%;
  left: 0;
  height: 2.5px;
}

/* Grade switch content entrance animation */
@keyframes gradeContentSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-body.grade-switch-enter {
  animation: gradeContentSlideIn 0.35s ease-out;
}

/* ============================================
   Lesson PDF Download Button
   ============================================ */
.lesson-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.3s backwards;
}

.lesson-pdf-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.lesson-pdf-btn:hover,
.lesson-pdf-btn:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.lesson-pdf-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.lesson-pdf-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

@keyframes pdfBtnFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Generating state */
.lesson-pdf-btn.generating {
  opacity: 0.7;
  pointer-events: none;
  cursor: wait;
  animation: none;
}

.pdf-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   Engineering Challenge PDF Button
   ============================================ */
.edp-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.4s backwards;
}

.edp-pdf-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.edp-pdf-btn:hover,
.edp-pdf-btn:focus-visible {
  border-color: #2E7D32;
  color: #2E7D32;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.edp-pdf-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.edp-pdf-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ============================================
   Exit Ticket PDF Button
   ============================================ */
.exit-ticket-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.45s backwards;
}

.exit-ticket-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.exit-ticket-btn:hover,
.exit-ticket-btn:focus-visible {
  border-color: #00838F;
  color: #00838F;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.exit-ticket-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.exit-ticket-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ============================================
   Rubric PDF Button
   ============================================ */
.rubric-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.5s backwards;
}

.rubric-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.rubric-btn:hover,
.rubric-btn:focus-visible {
  border-color: #D84315;
  color: #D84315;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.rubric-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.rubric-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ============================================
   Notice & Wonder T-Chart PDF Button
   ============================================ */
.notice-wonder-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.55s backwards;
}

.notice-wonder-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.notice-wonder-btn:hover,
.notice-wonder-btn:focus-visible {
  border-color: #283593;
  color: #283593;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.notice-wonder-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.notice-wonder-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ============================================
   Talk Moves Prompt Card PDF Button
   ============================================ */
.talk-moves-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.6s backwards;
}

.talk-moves-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.talk-moves-btn:hover,
.talk-moves-btn:focus-visible {
  border-color: #1B5E20;
  color: #1B5E20;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.talk-moves-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.talk-moves-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.diff-strategy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.7s backwards;
}

.diff-strategy-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.diff-strategy-btn:hover,
.diff-strategy-btn:focus-visible {
  border-color: #6A1B9A;
  color: #6A1B9A;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.diff-strategy-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.diff-strategy-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.cer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.8s backwards;
}

.cer-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.cer-btn:hover,
.cer-btn:focus-visible {
  border-color: #F57F17;
  color: #F57F17;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.cer-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.cer-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Quick-Check Probe Button ── */

.probe-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.85s backwards;
}

.probe-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.probe-btn:hover,
.probe-btn:focus-visible {
  border-color: #E65100;
  color: #E65100;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.probe-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.probe-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Vocabulary Flashcard Button ── */
.vocab-flashcard-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin-left: 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.55s backwards;
}

.vocab-flashcard-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.vocab-flashcard-btn:hover,
.vocab-flashcard-btn:focus-visible {
  border-color: #0277BD;
  color: #0277BD;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.vocab-flashcard-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.vocab-flashcard-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.five-e-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: pdfBtnFadeIn 0.5s ease 0.35s backwards;
}

.five-e-pdf-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.five-e-pdf-btn:hover,
.five-e-pdf-btn:focus-visible {
  border-color: #7B1FA2;
  color: #7B1FA2;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.five-e-pdf-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.five-e-pdf-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Interactive Star Rating */
.interactive-stars {
  margin: var(--spacing-md) 0;
  padding: var(--spacing-md);
  background-color: var(--color-bg-light);
  border-radius: var(--radius-md);
  text-align: center;
}

.interactive-stars p {
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--color-text-dark);
}

.star-btn {
  font-size: 2em;
  color: var(--color-border);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  padding: 0 var(--spacing-xs);
}

.star-btn:hover {
  color: #FFB800;
  transform: scale(1.2);
}

.star-btn:active {
  transform: scale(1.1);
}

.rating-submitted {
  padding: var(--spacing-sm);
  background-color: var(--color-udl-bg);
  color: var(--color-success-text);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
}

/* ==========================================
   Comment Section Styles
   ========================================== */

/* Comment Section Container */
.comment-section {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 2px solid var(--color-border);
}

.comment-section-header {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: var(--spacing-md);
}

.comment-section-header span {
  font-weight: 400;
  color: var(--color-text-light);
  font-size: 0.9em;
}

/* Comment Form */
.comment-form {
  margin-bottom: var(--spacing-lg);
}

.comment-form textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.15);
}

.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-xs);
}

.comment-char-count {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.comment-submit-btn {
  padding: 8px 20px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), opacity var(--transition-fast);
}

.comment-submit-btn:hover {
  background-color: var(--color-primary-hover);
}

.comment-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sign-in Prompt */
.comment-signin-prompt {
  padding: var(--spacing-md);
  background-color: var(--color-bg-light);
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-light);
}

.comment-signin-prompt a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.comment-signin-prompt a:hover {
  text-decoration: underline;
}

/* Comment List */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.comment-empty {
  text-align: center;
  color: var(--color-text-light);
  font-style: italic;
  padding: var(--spacing-md) 0;
}

/* Individual Comment */
.comment-item {
  display: flex;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 600;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

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

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-xs);
  margin-bottom: 4px;
}

.comment-author {
  font-weight: 600;
  color: var(--color-text-dark);
  font-size: var(--font-size-sm);
}

.comment-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.comment-text {
  color: var(--color-text-dark);
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
}

.comment-delete-btn:hover {
  color: var(--color-error);
}

/* Gallery Card Comment Count */
.comment-count {
  color: var(--color-text-light);
  font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .card-stats {
    gap: 5px;
    padding: 8px;
  }

  .badge {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .modal-grade-selector {
    gap: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .modal-grade-link {
    font-size: var(--font-size-xs);
    padding: 4px 6px;
  }

  .modal-stats {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    justify-content: center;
  }

  .lesson-pdf-btn,
  .five-e-pdf-btn,
  .edp-pdf-btn,
  .vocab-flashcard-btn,
  .exit-ticket-btn,
  .rubric-btn,
  .notice-wonder-btn,
  .talk-moves-btn,
  .diff-strategy-btn,
  .cer-btn,
  .probe-btn {
    font-size: 0.7rem;
    padding: 5px 12px;
    border-width: 1.5px;
  }

  .lesson-pdf-btn svg,
  .five-e-pdf-btn svg,
  .edp-pdf-btn svg,
  .vocab-flashcard-btn svg,
  .exit-ticket-btn svg,
  .rubric-btn svg,
  .notice-wonder-btn svg,
  .talk-moves-btn svg,
  .diff-strategy-btn svg,
  .cer-btn svg,
  .probe-btn svg {
    width: 15px;
    height: 15px;
  }

  .modal-favorite-btn {
    padding: 5px 10px;
  }

  .modal-favorite-btn .favorite-label {
    font-size: 0.7rem;
  }

  .views-count {
    font-size: 0.75rem;
  }

  .star-btn {
    font-size: 1.5em;
  }

  .comment-section {
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
  }

  .comment-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 0.65em;
  }
}

/* ==========================================
   Authentication UI Styles
   ========================================== */

/* Auth Container - Top Right of Hero */
.auth-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

/* Sign In Button */
.sign-in-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  color: var(--color-text-medium);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sign-in-btn:hover {
  background: #f8f8f8;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.sign-in-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sign-in-btn svg {
  flex-shrink: 0;
}

/* User Avatar Button */
.user-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.user-avatar-btn:hover {
  transform: scale(1.05);
}

.user-avatar-btn:active {
  transform: scale(0.95);
}

/* User Avatar (Circle with Initials or Photo) */
.user-avatar,
.user-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 3px solid white;
  position: relative;
  overflow: hidden;
}

.user-avatar-large {
  width: 56px;
  height: 56px;
  font-size: 22px;
  flex-shrink: 0;
}

/* User Initials */
.user-initials {
  text-transform: uppercase;
  user-select: none;
}

/* User Avatar Background Image */
.user-avatar-bg,
.user-avatar-large-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.user-initials {
  position: relative;
  z-index: 2;
}

/* Dropdown Menu */
.user-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Menu Header */
.user-menu-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.user-menu-info {
  flex: 1;
  min-width: 0;
}

.user-name-menu {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-medium);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email-menu {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Menu Divider */
.user-menu-divider {
  height: 1px;
  background: var(--color-border);
}

/* Menu Items */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-medium);
  transition: background 0.2s ease;
  text-align: left;
}

.user-menu-item:hover {
  background: #f5f5f5;
}

.user-menu-item svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-container {
    top: 15px;
    right: 15px;
  }

  .sign-in-btn {
    font-size: 13px;
    padding: 8px 16px;
  }

  .user-avatar,
  .user-avatar-large {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .user-avatar-large {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .user-menu {
    min-width: 260px;
  }

  .user-menu-header {
    padding: 16px;
  }

  .user-name-menu {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
  }

  .sign-in-btn {
    font-size: 12px;
    padding: 6px 12px;
    gap: 6px;
  }

  .sign-in-btn svg {
    width: 16px;
    height: 16px;
  }

  .user-avatar,
  .user-avatar-large {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .user-avatar-large {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .user-menu {
    right: -10px;
    min-width: calc(100vw - 24px);
    max-width: 320px;
  }
}


/* ==========================================
   HOTSPOT STYLES
   ========================================== */

/* Hotspot container positioned over modal thumbnail */
.hotspot-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allow clicks to pass through container */
  z-index: 10;
}

/* Individual hotspot marker */
.hotspot {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid var(--color-interactive);
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--color-interactive);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  pointer-events: auto; /* Enable clicks on hotspots */
  animation: hotspot-pulse 2s infinite;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes hotspot-pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 15px rgba(102, 126, 234, 0);
  }
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.2);
  background: var(--color-interactive);
  color: white;
  animation: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.hotspot.active {
  background: var(--color-interactive);
  color: white;
  transform: translate(-50%, -50%) scale(1.2);
  animation: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

/* Hotspot tooltip */
.hotspot-tooltip {
  position: absolute;
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 320px;
  min-width: 280px;
  z-index: 100;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hotspot-tooltip.show {
  opacity: 1;
  transform: scale(1);
}

.hotspot-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.hotspot-tooltip-number {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
  flex-shrink: 0;
}

.hotspot-tooltip-label {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.hotspot-tooltip-fact {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.95;
}

.hotspot-tooltip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.hotspot-tooltip-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Tooltip arrow */
.hotspot-tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 10px solid transparent;
}

/* Arrow positioning based on tooltip placement */
.hotspot-tooltip.tooltip-top::before {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--color-interactive-dark);
}

.hotspot-tooltip.tooltip-bottom::before {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--color-interactive);
}

.hotspot-tooltip.tooltip-left::before {
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--color-interactive-dark);
}

.hotspot-tooltip.tooltip-right::before {
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--color-interactive);
}

/* Modal header needs relative positioning for hotspot container */
.modal-header {
  position: relative;
}

.modal-thumbnail {
  position: relative;
}

/* Mobile responsive hotspots */
@media (max-width: 768px) {
  .hotspot {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }

  .hotspot-tooltip {
    max-width: calc(100vw - 40px);
    min-width: 260px;
  }

  @keyframes hotspot-pulse {
    0%, 100% {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 20px rgba(102, 126, 234, 0);
    }
  }
}

@media (max-width: 480px) {
  .hotspot {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .hotspot-tooltip {
    padding: 16px;
    font-size: 0.95rem;
  }

  .hotspot-tooltip-label {
    font-size: 1.05rem;
  }

  .hotspot-tooltip-fact {
    font-size: 0.95rem;
  }
}

/* Hotspot toggle button */
.hotspot-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(102, 126, 234, 0.1);
  border: 2px solid var(--color-interactive);
  color: var(--color-interactive);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
  z-index: 3;
}

.hotspot-toggle-btn:hover {
  background: var(--color-interactive);
  color: white;
}

.hotspot-toggle-btn.hotspots-hidden {
  border-color: var(--color-border);
  color: var(--color-text-light);
  opacity: 0.5;
}

.hotspot-toggle-btn.hotspots-hidden:hover {
  border-color: #4CAF50;
  color: #388E3C;
  opacity: 1;
}

.hotspot-toggle-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Hidden state for hotspots */
.hotspot-container.hotspots-hidden .hotspot {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hotspot-container .hotspot {
  transition: opacity 0.3s ease, all 0.3s ease;
}

/* ============================================
   SENTENCE STEMS OVERLAY & MODAL ACTION BUTTONS
   ============================================ */

/* Unified Button Styling - All modal action buttons */
.modal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  margin-right: 0;
}

.modal-action-btn .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Individual button hover colors */
.hotspot-btn:hover {
  border-color: #4CAF50;
  color: #388E3C;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.sentence-stems-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.image-only-btn:hover {
  border-color: #1976d2;
  color: #1976d2;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.content-btn:hover {
  border-color: #e65100;
  color: #e65100;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Active state for sentence stems */
.sentence-stems-btn.active {
  background-color: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  color: #667eea;
}

/* Sentence Stems Overlay */
.sentence-stems-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease; /* Slower fade-in (was 0.4s) */
}

.sentence-stems-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Sentence Stems Card */
.sentence-stems-card {
  background: rgba(255, 255, 255, 0.92); /* Slightly more transparent (was 0.95) */
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px 40px;
  max-width: 650px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: scale(0.9);
  transition: transform 0.6s ease; /* Match slower fade-in */
}

.sentence-stems-overlay.show .sentence-stems-card {
  transform: scale(1);
}

/* Title and Subtitle */
.sentence-stems-title {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 8px 0;
  text-align: center;
}

.sentence-stems-subtitle {
  font-size: 14px;
  color: #7f8c8d;
  margin: 0 0 25px 0;
  text-align: center;
  font-style: italic;
}

/* Individual Sentence Stem Items */
.sentence-stem-item {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 12px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.sentence-stem-item:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateX(5px);
}

.sentence-stem-item:last-child {
  margin-bottom: 0;
}

/* Stem Number Circle */
.stem-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

/* Stem Content */
.stem-content {
  flex: 1;
}

.stem-content strong {
  display: block;
  font-size: 16px;
  color: #2c3e50;
  margin-bottom: 6px;
  line-height: 1.4;
}

.stem-description {
  font-size: 13px;
  color: #5a6c7d;
  margin: 0;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  .sentence-stems-card {
    max-width: 90%;
    padding: 25px 20px;
  }

  .sentence-stems-title {
    font-size: 20px;
  }

  .sentence-stem-item {
    gap: 15px;
    padding: 12px;
  }

  .stem-number {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .stem-content strong {
    font-size: 14px;
  }

  .stem-description {
    font-size: 12px;
  }

  .modal-action-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-width: 1.5px;
  }
}

@media (max-width: 480px) {
  .sentence-stems-card {
    max-width: 95%;
    padding: 20px 15px;
  }

  .sentence-stems-title {
    font-size: 18px;
  }

  /* Hide button text on very small screens, keep SVG icons only */
  .modal-action-btn span {
    display: none;
  }

  .modal-action-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    justify-content: center;
  }
}

/* Copyright & Terms Modal */
.copyright-modal-content {
  background: white;
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease-out;
  position: relative;
  z-index: 10001;
}

.copyright-modal-header {
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.copyright-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.copyright-modal-body {
  padding: 30px;
  line-height: 1.8;
}

.copyright-modal-body h3 {
  color: var(--color-interactive);
  font-size: 1.2rem;
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 600;
}

.copyright-modal-body h3:first-child {
  margin-top: 0;
}

.copyright-modal-body p {
  margin-bottom: 16px;
  color: #4a5568;
  font-size: 1rem;
}

.copyright-modal-body a {
  color: var(--color-interactive);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.copyright-modal-body a:hover {
  color: var(--color-interactive-dark);
  text-decoration: underline;
}

.copyright-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
  font-weight: 500;
  color: #2d3748;
}

.copyright-date {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #718096;
  font-style: italic;
}

.copyright-modal-body ul {
  margin: 0 0 16px 0;
  padding-left: 24px;
  color: #4a5568;
}

.copyright-modal-body li {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.6;
}

.copyright-modal-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--color-interactive-dark);
}

.copyright-link,
.privacy-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.copyright-link:hover,
.privacy-link:hover {
  color: var(--color-interactive);
}

/* Mobile responsive for copyright modal */
@media (max-width: 768px) {
  .copyright-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .copyright-modal-header {
    padding: 20px;
  }

  .copyright-modal-header h2 {
    font-size: 1.3rem;
  }

  .copyright-modal-body {
    padding: 20px;
  }

  .copyright-modal-body h3 {
    font-size: 1.1rem;
  }

  .copyright-modal-body p {
    font-size: 0.95rem;
  }
}

/* ============================================
   Feature: Category Count Badges
   ============================================ */
.category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  background-color: rgba(0, 0, 0, 0.1);
  color: white;
  margin-left: 4px;
}

.filter-btn.active .category-badge {
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.filter-btn[data-category="all"] .category-badge {
  background: var(--color-primary);
  color: white;
}

.filter-btn[data-category="life-science"] .category-badge {
  background: var(--color-life-science);
  color: white;
}

.filter-btn[data-category="earth-space-science"] .category-badge {
  background: var(--color-earth-science);
  color: white;
}

.filter-btn[data-category="physical-science"] .category-badge {
  background: var(--color-physical-science);
  color: white;
}

/* ============================================
   Feature: Image Card Titles
   ============================================ */
.item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-category {
  font-size: 0.8rem;
}

/* ============================================
   Feature: Skeleton Loading Placeholders
   ============================================ */
.skeleton-card {
  pointer-events: none;
}

.skeleton-image {
  width: 100%;
  height: 280px;
  background-color: var(--color-bg-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.skeleton-info {
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-title {
  width: 65%;
  height: 14px;
  border-radius: 4px;
  background-color: var(--color-bg-light);
}

.skeleton-category {
  width: 45%;
  height: 12px;
  border-radius: 4px;
  background-color: var(--color-bg-light);
}

.skeleton-stats {
  padding: 0 var(--spacing-md) var(--spacing-md);
}

.skeleton-bar {
  width: 80%;
  height: 12px;
  border-radius: 4px;
  background-color: var(--color-bg-light);
}

@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.shimmer {
  background-image: linear-gradient(
    90deg,
    var(--color-bg-light) 0px,
    #e8e8e8 40px,
    var(--color-bg-light) 80px
  );
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ============================================
   Feature: Back to Filters Floating Button
   ============================================ */
.back-to-filters-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  font-size: 0.9rem;
  font-weight: 600;
}

.back-to-filters-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-filters-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.back-to-filters-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.back-to-filters-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================
   Feature: "New" Badge on Recent Images
   ============================================ */
.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: linear-gradient(135deg, #3a9cc5 0%, #2E86AB 100%);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(46, 134, 171, 0.3);
  animation: badgePulse 2s ease-in-out infinite;
}

/* ============================================
   Feature: NGSS Standards Badges
   ============================================ */
.ngss-badges-container {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  pointer-events: none;
}

.ngss-badge {
  background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.ngss-badge-overflow {
  background: linear-gradient(135deg, #c96a30 0%, #b55a28 100%);
  font-style: italic;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(46, 134, 171, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 2px 16px rgba(46, 134, 171, 0.6);
    transform: scale(1.05);
  }
}

/* ============================================
   Feature: Discussion Questions Quick Card
   ============================================ */
.discussion-quick-card {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border: 1px solid #90CAF9;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  overflow: visible;
  transition: all 0.3s ease;
}

.dqc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.dqc-header:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dqc-icon {
  font-size: 1.25rem;
}

.dqc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-dark);
  flex: 1;
}

.dqc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  animation: dqcPulse 2s ease-in-out infinite;
}

@keyframes dqcPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(46, 134, 171, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(46, 134, 171, 0);
  }
}

.dqc-toggle {
  font-size: 1.1rem;
  color: var(--color-text-light);
  transition: transform 0.3s ease;
}

.discussion-quick-card.collapsed .dqc-toggle {
  transform: rotate(-90deg);
}

.dqc-list {
  padding: 0 18px 14px 40px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.discussion-quick-card.collapsed .dqc-list {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.dqc-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(144, 202, 249, 0.4);
  line-height: 1.5;
}

.dqc-list li:last-child {
  border-bottom: none;
}

.dq-text {
  display: block;
  font-size: 0.95rem;
  color: var(--color-text-dark);
}

.dq-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 2px;
  font-style: italic;
}

/* ---- Info Tip Tooltips for Bloom's / DOK ---- */
.dq-info-tip {
  position: relative;
  cursor: default;
  border-bottom: 1px dotted var(--color-text-light);
}

/* Tooltip bubble — positioned ABOVE to avoid clipping by modal-body overflow */
.dq-info-tip[data-info-tooltip]::after {
  content: attr(data-info-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: var(--color-text-dark);
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-line;
  width: max-content;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* Arrow pointing DOWN (tooltip is above) */
.dq-info-tip[data-info-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--color-text-dark);
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity var(--transition-fast);
}

/* Show on hover + keyboard focus */
.dq-info-tip[data-info-tooltip]:hover::after,
.dq-info-tip[data-info-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.dq-info-tip[data-info-tooltip]:hover::before,
.dq-info-tip[data-info-tooltip]:focus-visible::before {
  opacity: 1;
}

/* Focus ring for keyboard navigation */
.dq-info-tip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-radius: 2px;
}

/* DOK span (last tip) — left-align tooltip so it extends rightward */
.dq-meta .dq-info-tip:last-child[data-info-tooltip]::after {
  left: 0;
  transform: translateX(0) scale(0.95);
}
.dq-meta .dq-info-tip:last-child[data-info-tooltip]:hover::after,
.dq-meta .dq-info-tip:last-child[data-info-tooltip]:focus-visible::after {
  transform: translateX(0) scale(1);
}
.dq-meta .dq-info-tip:last-child[data-info-tooltip]::before {
  left: 12px;
  transform: none;
}

/* Mobile: tap triggers focus which shows tooltip */
@media (hover: none) {
  .dq-info-tip[data-info-tooltip]:focus::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  .dq-info-tip[data-info-tooltip]:focus::before {
    opacity: 1;
  }
  .dq-meta .dq-info-tip:last-child[data-info-tooltip]:focus::after {
    transform: translateX(0) scale(1);
  }
}

.dqc-copy-li {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px dashed var(--color-border);
}

.dqc-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-light);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dqc-copy-btn:hover {
  background: var(--color-interactive);
  color: white;
  border-color: var(--color-interactive);
}

.dqc-copy-btn:hover svg {
  stroke: white;
}

.dqc-copy-btn.copied {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.dqc-copy-btn svg {
  flex-shrink: 0;
}

.dqc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 18px 14px 18px;
  justify-content: flex-end;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.discussion-quick-card.collapsed .dqc-actions {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.dqc-actions .exit-ticket-btn,
.dqc-actions .rubric-btn,
.dqc-actions .notice-wonder-btn,
.dqc-actions .talk-moves-btn,
.dqc-actions .diff-strategy-btn,
.dqc-actions .cer-btn,
.dqc-actions .probe-btn {
  animation: none;
}
}

/* ============================================
   Feature: Standards Progression Viewer
   ============================================ */
.progression-card {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border: 1px solid #81C784;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  overflow: visible;
  transition: all 0.3s ease;
}

.progression-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.progression-header:hover {
  background: rgba(255, 255, 255, 0.3);
}

.progression-icon {
  display: flex;
  align-items: center;
  color: #2E7D32;
}

.progression-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-dark);
  flex: 1;
}

.progression-dci-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background-color: #2E7D32;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.progression-toggle {
  font-size: 1.1rem;
  color: var(--color-text-light);
  transition: transform 0.3s ease;
}

.progression-card.collapsed .progression-toggle {
  transform: rotate(-90deg);
}

.progression-body {
  padding: 0 18px 18px 18px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.progression-card.collapsed .progression-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.progression-narrative {
  font-size: 0.88rem;
  color: var(--color-text-light);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 0 4px;
}

/* Timeline container */
.progression-timeline {
  position: relative;
  padding-left: 28px;
}

/* Vertical connector line */
.progression-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: #A5D6A7;
  border-radius: 1px;
}

/* Each step */
.progression-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.progression-step:last-child {
  margin-bottom: 0;
}

.progression-step:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(2px);
}

/* Grade marker circle */
.progression-step-marker {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: white;
  color: #388E3C;
  border: 2px solid #A5D6A7;
  transition: all 0.25s ease;
  z-index: 1;
}

/* Active step styling */
.progression-step.active {
  background: rgba(46, 125, 50, 0.08);
}

.progression-step.active .progression-step-marker {
  background: #2E7D32;
  color: white;
  border-color: #2E7D32;
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.15);
}

.progression-step.active .progression-step-grade {
  color: #1B5E20;
  font-weight: 700;
}

/* Step content */
.progression-step-content {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.progression-step-grade {
  font-size: 0.8rem;
  font-weight: 600;
  color: #388E3C;
  margin-bottom: 2px;
}

.progression-step-text {
  font-size: 0.88rem;
  color: var(--color-text-dark);
  line-height: 1.5;
}

/* Tooltip for clickable steps */
.progression-step[title] {
  position: relative;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .progression-timeline {
    padding-left: 22px;
  }

  .progression-timeline::before {
    left: 12px;
  }

  .progression-step {
    gap: 10px;
    padding: 8px 8px;
  }

  .progression-step-marker {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .progression-step.active .progression-step-marker {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .progression-step-text {
    font-size: 0.82rem;
  }

  .progression-title {
    font-size: 0.9rem;
  }
}

/* ============================================
   Responsive: New Features
   ============================================ */
@media (max-width: 768px) {
  .back-to-filters-btn {
    bottom: 1.2rem;
    left: 1.2rem;
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .back-to-filters-btn span {
    display: none;
  }

  .category-badge {
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .new-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .ngss-badge {
    font-size: 9px;
    padding: 2px 6px;
  }

  .ngss-badges-container {
    gap: 3px;
  }

  .dqc-list {
    padding-left: 30px;
  }
}

/* ============================================
   Contact Form Modal
   ============================================ */
.contact-modal-content {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease-out;
  position: relative;
  z-index: 10001;
}

.contact-modal-header {
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.contact-header-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  margin: -60px 0;
}

.contact-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.contact-modal-body {
  padding: 30px;
}

.contact-intro {
  color: #4a5568;
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
}

.form-input,
.form-select,
.form-textarea {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: #2d3748;
  background: #f7fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-interactive);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  background: white;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #a0aec0;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.contact-submit-btn {
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.contact-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.contact-submit-btn:active {
  transform: translateY(0);
}

.contact-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spin-icon {
  animation: spin 1s linear infinite;
}

/* Success / Error states */
.contact-result {
  text-align: center;
  padding: 20px 0;
}

.contact-result .result-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.contact-result h3 {
  font-size: 1.4rem;
  color: #2d3748;
  margin-bottom: 8px;
}

.contact-result p {
  color: #4a5568;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.contact-result a {
  color: var(--color-interactive);
  text-decoration: none;
  font-weight: 500;
}

.contact-result a:hover {
  text-decoration: underline;
}

.contact-another-btn {
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.contact-another-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.contact-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--color-interactive);
}

/* Mobile responsive for contact modal */
@media (max-width: 768px) {
  .contact-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .contact-modal-header {
    padding: 20px;
  }

  .contact-modal-header h2 {
    font-size: 1.3rem;
  }

  .contact-header-logo {
    width: 140px;
    height: 140px;
    margin: -40px 0;
  }

  .contact-modal-body {
    padding: 20px;
  }

  .contact-submit-btn {
    padding: 12px 20px;
    font-size: 1rem;
  }
}

/* ============================================
   Favorites / My Collection System
   ============================================ */

/* My Collection filter toggle */
#my-collection-btn[aria-pressed="true"] {
  color: var(--color-heart);
}

#my-collection-btn[aria-pressed="true"]::after {
  background: var(--color-heart);
}

/* New filter toggle */
#new-filter-btn[aria-pressed="true"] {
  color: #ee5a24;
}

#new-filter-btn[aria-pressed="true"]::after {
  background: #ee5a24;
}

/* Favorite button in modal stats bar */
.modal-favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-white);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  animation: pdfBtnFadeIn 0.5s ease 0.45s backwards;
}

/* Feedback button gets slightly later stagger */
.modal-feedback-btn {
  animation: pdfBtnFadeIn 0.5s ease 0.5s backwards;
}

/* Share button styling */
.modal-share-btn {
  animation: pdfBtnFadeIn 0.5s ease 0.55s backwards;
}

.modal-share-btn:hover {
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.modal-share-btn:hover svg {
  stroke: var(--color-primary) !important;
}

.modal-share-btn.share-copied {
  border-color: var(--color-success);
  color: var(--color-success);
  background: rgba(76, 175, 80, 0.05);
}

.modal-favorite-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  transition: all var(--transition-base);
}

.modal-favorite-btn:hover {
  border-color: var(--color-heart);
  color: var(--color-heart);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.modal-favorite-btn:hover svg {
  stroke: var(--color-heart);
  fill: rgba(233, 30, 99, 0.1);
}

.modal-favorite-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.modal-favorite-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Favorited state */
.modal-favorite-btn.favorited {
  background-color: var(--color-heart-bg);
  border-color: var(--color-heart);
  color: var(--color-heart);
}

.modal-favorite-btn.favorited svg {
  fill: var(--color-heart);
  stroke: var(--color-heart);
}

.modal-favorite-btn.favorited .favorite-label::after {
  content: 'd';
}

.modal-favorite-btn:not(.favorited) .favorite-label::after {
  content: '';
}

/* Heart beat animation on toggle */
@keyframes heartBeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
  60% { transform: scale(1); }
}

.modal-favorite-btn.favorited svg {
  animation: heartBeat 0.6s ease-in-out;
}

/* Mobile responsive for modal stats with favorite button */
@media (max-width: 600px) {
  .modal-favorite-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .modal-favorite-btn svg {
    width: 14px;
    height: 14px;
  }

  .favorite-label {
    display: none;
  }

  .collection-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  .collection-label {
    display: none;
  }

  /* Extra-compact edu modal header for tiny screens */
  .modal-header {
    grid-template-columns: 40px 1fr auto;
    padding: 4px var(--spacing-xs);
  }

  .modal-thumbnail {
    width: 40px;
    height: 40px;
  }

  .modal-title {
    font-size: 0.8rem;
  }

  .modal-category {
    font-size: 0.6rem;
  }
}

/* Feedback button — inherits .modal-favorite-btn base, blue hover accent */
.modal-feedback-btn:hover {
  border-color: #2196F3;
  color: #2196F3;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.modal-feedback-btn:hover svg {
  stroke: #2196F3;
  fill: rgba(33, 150, 243, 0.1);
}

/* ============================================
   Featured Collection System
   ============================================ */

/* Featured Collection toggle */
#featured-pollination-btn[aria-pressed="true"] {
  color: var(--color-star);
}

#featured-pollination-btn[aria-pressed="true"]::after {
  background: var(--color-star);
}

/* ============================================
   Toast Notifications
   ============================================ */
.pwa-toast,
.app-toast {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: bottom 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-toast.visible,
.app-toast.visible {
  bottom: 24px;
}

/* PWA offline / online */
.pwa-toast.offline { background-color: #e53e3e; }
.pwa-toast.online  { background-color: #38a169; }

/* General toast types */
.app-toast.success { background-color: #38a169; }
.app-toast.error   { background-color: #e53e3e; }
.app-toast.warning { background-color: #d97706; }
.app-toast.info    { background-color: #3182ce; }

/* ============================================
   Feature: Sentence Stems Callout (Modal)
   ============================================ */
.sentence-stems-callout {
  background: #f5f3ff;
  border-left: 4px solid var(--color-secondary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin: var(--spacing-xl) 0 var(--spacing-lg);
}

.sentence-stems-callout .stems-header h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.sentence-stems-callout .stems-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
}

.stems-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.stem-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
}

.stem-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-secondary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.stem-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stem-text strong {
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
  line-height: 1.4;
}

.stem-skill {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  font-style: italic;
}

/* Poster Download Section */
.stems-download-section {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(162, 59, 114, 0.15);
}

.stems-download-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-medium);
  margin-bottom: var(--spacing-sm);
}

.stems-form {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.stems-name-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-fast);
}

.stems-name-input:focus {
  border-color: var(--color-secondary);
  outline: none;
}

.stems-grade-selector {
  position: relative;
}

.stems-grade-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-white);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-dark);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  white-space: nowrap;
}

.stems-grade-trigger:hover {
  border-color: var(--color-secondary);
}

.stems-grade-trigger .grade-chevron {
  font-size: 0.75em;
  opacity: 0.6;
}

.stems-grade-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 4px;
  min-width: 160px;
}

.stems-grade-popover button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--color-text-dark);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.stems-grade-popover button svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.stems-grade-popover button:hover svg {
  opacity: 1;
  stroke: white;
}

.stems-grade-popover button:hover {
  color: white;
}

.stems-grade-popover button[data-grade="Kindergarten"]:hover { background: #ec4899; }
.stems-grade-popover button[data-grade="1st Grade"]:hover    { background: #f59e0b; }
.stems-grade-popover button[data-grade="2nd Grade"]:hover    { background: #10b981; }
.stems-grade-popover button[data-grade="3rd Grade"]:hover    { background: #6366f1; }
.stems-grade-popover button[data-grade="4th Grade"]:hover    { background: #06b6d4; }
.stems-grade-popover button[data-grade="5th Grade"]:hover    { background: #8b5cf6; }
.stems-grade-popover button[data-grade="Lab"]:hover          { background: #f97316; }

.stems-grade-popover button.active {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
}

.stems-grade-popover button.active svg {
  opacity: 1;
  stroke: white;
}

.stems-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--color-secondary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.stems-download-btn:hover {
  background-color: #8a3060;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.stems-download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.stems-download-spinner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stems-download-spinner .spin-icon {
  animation: spin 1s linear infinite;
}

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

/* Mobile: stack the form vertically */
@media (max-width: 600px) {
  .stems-form {
    flex-direction: column;
    align-items: stretch;
  }

  .stems-name-input {
    min-width: unset;
  }

  .stems-download-btn {
    justify-content: center;
  }
}

/* ============================================
   Storyline Bundles
   ============================================ */

/* Card icon — in .item-info-actions row */
.storyline-icon-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: none;
  flex-shrink: 0;
  padding: 0;
  color: var(--color-interactive);
  align-self: flex-start;
  animation: storylinePulse 2s ease-in-out infinite;
}

@keyframes storylinePulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.storyline-icon-btn:hover,
.storyline-icon-btn:focus-visible {
  animation: none;
  transform: scale(1.2);
  opacity: 1;
  background: none;
  box-shadow: none;
  color: var(--color-interactive);
}

.storyline-icon-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Storyline filter toggle */
.storyline-btn-container {
  position: relative;
}

#storyline-btn[aria-pressed="true"] {
  color: var(--color-interactive);
}

#storyline-btn[aria-pressed="true"]::after {
  background: var(--color-interactive);
}

/* Storyline dropdown */
.storyline-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  max-width: 420px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  margin-top: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.storyline-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
  font-family: inherit;
  font-size: inherit;
}

.storyline-dropdown-item:hover {
  background: var(--color-bg-light);
}

.storyline-dropdown-item + .storyline-dropdown-item {
  border-top: 1px solid var(--color-border);
}

.storyline-dropdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.storyline-dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.storyline-dropdown-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-dark);
  line-height: 1.3;
}

.storyline-dropdown-meta {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* Storyline banner */
.storyline-banner {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--color-interactive) 0%, var(--color-interactive-dark) 100%);
  border-radius: var(--radius-md);
  color: white;
  margin: 0 auto var(--spacing-md);
  max-width: 800px;
  font-size: 0.9rem;
}

.storyline-banner-icon {
  flex-shrink: 0;
  stroke: white;
}

.storyline-banner-title {
  flex: 1;
  font-weight: 600;
}

.storyline-banner-guide-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  color: white;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.storyline-banner-guide-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.storyline-banner-clear {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.storyline-banner-clear:hover {
  color: white;
}

/* Storyline modal — z-index below educational modal so lessons open on top */
#storyline-modal {
  z-index: 999;
}

.storyline-modal-content {
  position: relative;
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  width: 95vw;
  max-width: 700px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalZoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.storyline-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.storyline-modal-title-section {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  flex: 1;
}

.storyline-modal-icon {
  flex-shrink: 0;
  color: var(--color-interactive);
  margin-top: 2px;
}

.storyline-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
  line-height: 1.3;
}

.storyline-modal-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin: 4px 0 0;
}

.storyline-modal-body {
  padding: var(--spacing-lg);
}

/* Description callout */
.storyline-description {
  background: var(--color-bg-light);
  border-left: 3px solid var(--color-interactive);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--color-text-medium);
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

/* Section headers */
.storyline-section {
  margin-bottom: var(--spacing-lg);
}

.storyline-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  margin: 0 0 var(--spacing-xs);
}

.storyline-driving-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-interactive);
  font-style: italic;
  margin: 0;
}

/* Progress dots */
.storyline-progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--spacing-md);
}

.storyline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-interactive);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.storyline-dot-connector {
  height: 2px;
  width: 32px;
  background: var(--color-interactive);
  opacity: 0.4;
}

/* Lesson cards */
.storyline-lesson-card {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.storyline-lesson-card:hover {
  border-color: var(--color-interactive);
  box-shadow: var(--shadow-sm);
  background: var(--color-bg-light);
}

.storyline-lesson-thumb img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.storyline-lesson-info {
  flex: 1;
  min-width: 0;
}

.storyline-lesson-day {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-dark);
  margin-bottom: 4px;
}

.storyline-lesson-focus {
  font-size: 0.85rem;
  color: var(--color-text-medium);
  line-height: 1.4;
}

.storyline-lesson-transition {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 4px;
  line-height: 1.3;
}

/* Action buttons */
.storyline-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) 0;
}

.storyline-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.storyline-download-btn {
  background: var(--color-bg-light);
  color: var(--color-text-dark);
  border: 1px solid var(--color-border);
}

.storyline-download-btn:hover {
  background: var(--color-border);
}

.storyline-start-btn {
  background: var(--color-interactive);
  color: white;
}

.storyline-start-btn:hover {
  background: var(--color-interactive-dark);
}

/* NGSS standards in storyline modal */
.storyline-standards {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}

.storyline-standards-label {
  font-size: 0.8rem;
  color: var(--color-text-light);
  font-weight: 600;
}

/* Storyline progress in educational modal */
.storyline-modal-progress {
  text-align: center;
  padding: 8px var(--spacing-md);
  background: linear-gradient(135deg, var(--color-interactive), var(--color-interactive-dark));
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Responsive: Storyline Bundles */
@media (max-width: 768px) {
  .storyline-dropdown {
    min-width: 280px;
    left: auto;
    right: 0;
    transform: none;
  }

  .storyline-banner {
    flex-wrap: wrap;
    font-size: 0.85rem;
  }

  .storyline-lesson-thumb img {
    width: 80px;
    height: 56px;
  }

  .storyline-actions {
    flex-direction: column;
  }

  .storyline-modal-body {
    padding: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .storyline-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .storyline-modal-header {
    border-radius: 0;
  }

  .storyline-label {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .storyline-lesson-card {
    flex-direction: column;
  }

  .storyline-lesson-thumb img {
    width: 100%;
    height: 120px;
  }

  .storyline-progress-dots {
    gap: 0;
  }

  .storyline-dot {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }

  .storyline-dot-connector {
    width: 16px;
  }
}

/* ============================================
   Song Feature
   ============================================ */

/* Gallery card song button */
.song-icon-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: none;
  flex-shrink: 0;
  padding: 0;
  color: #e67e22;
  align-self: flex-start;
  animation: songPulse 2.5s ease-in-out infinite;
}

@keyframes songPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.song-icon-btn:hover,
.song-icon-btn:focus-visible {
  animation: none;
  transform: scale(1.2);
  opacity: 1;
  background: none;
  box-shadow: none;
  color: #e67e22;
}

.song-icon-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Modal header song link */
.modal-song-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 2px 0;
  font-size: var(--font-size-sm);
  font-family: var(--font-body);
  color: #e67e22;
  cursor: pointer;
  transition: all var(--transition-base);
}

.modal-song-link:hover {
  color: #d35400;
  text-decoration: underline;
}

.modal-song-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Song player modal overlay */
.song-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.song-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.song-modal-container {
  position: relative;
  z-index: 1;
  background: var(--color-card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  max-width: 90vw;
  max-height: 90vh;
  width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.song-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.song-modal-title {
  font-family: var(--font-heading, sans-serif);
  font-size: var(--font-size-md, 1rem);
  color: var(--color-text-dark, #1a1a2e);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.song-modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text-light, #6b7280);
  transition: color var(--transition-base);
  flex-shrink: 0;
  margin-left: 8px;
}

.song-modal-close-btn:hover {
  color: var(--color-text-dark, #1a1a2e);
}

.song-modal-close-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.song-modal-video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

/* AI Generated badge in song modal header */
.song-modal-ai-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #e67e22;
  background: rgba(230, 126, 34, 0.1);
  border: 1px solid rgba(230, 126, 34, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Song actions row in educational modal header */
.modal-song-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}


/* Download bar at bottom of song player modal */
.song-modal-actions {
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.song-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: #e67e22;
  color: white;
  border: none;
  border-radius: var(--radius-md, 8px);
  font-size: var(--font-size-sm, 0.875rem);
  font-family: var(--font-body, sans-serif);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-base);
}

.song-download-btn:hover {
  background: #d35400;
}

.song-download-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Song modal responsive */
@media (max-width: 600px) {
  .song-modal-container {
    width: 95vw;
    max-width: none;
  }
}
