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

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

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  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: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-base);
  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: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
  flex: 1;
}

.filter-btn {
  background-color: var(--color-bg-white);
  color: var(--color-text-dark);
  border: 2px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: var(--color-bg-white);
  border-color: var(--color-primary);
}

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

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

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

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


/* Search Bar */
.search-container {
  max-width: 800px;
  margin: 0 auto var(--spacing-xl);
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.search-input::placeholder {
  color: var(--color-text-dark);
  font-weight: 600;
}

.search-input:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.grade-level-select {
  min-width: 220px;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-bg-white);
  color: var(--color-text-dark);
  cursor: pointer;
  transition: all var(--transition-base);
  appearance: none;
  -webkit-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='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  padding-right: calc(var(--spacing-lg) + 16px);
}

.grade-level-select:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  animation: none;
}

.grade-level-select:focus {
  border-color: var(--color-primary);
  outline: none;
  animation: none;
}

/* Responsive: Stack on mobile */
@media (max-width: 640px) {
  .search-container {
    flex-direction: column;
  }

  .grade-level-select {
    width: 100%;
  }
}

/* ============================================
   NGSS Standards Search
   ============================================ */
/* NGSS + Featured Collection row */
.ngss-featured-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  margin: 0 auto var(--spacing-lg);
}

.ngss-search-wrapper {
  position: relative;
}

.ngss-input-group {
  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);
  overflow: hidden;
  padding: 0 4px 0 0;
  cursor: text;
}

.ngss-input-group:hover {
  border-color: var(--color-focus);
  color: var(--color-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ngss-input-group:focus-within {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ngss-search-icon {
  padding: 0 0 0 var(--spacing-md);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ngss-search-input {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) var(--spacing-xs);
  font-size: var(--font-size-base);
  font-weight: 600;
  border: none;
  outline: none;
  background: transparent;
  min-width: 380px;
  color: var(--color-text-dark);
}

.ngss-search-input::placeholder {
  color: var(--color-text-dark);
  font-weight: 600;
}

.ngss-input-group:hover .ngss-search-input::placeholder {
  color: var(--color-focus);
}

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

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

/* 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-featured-row {
    flex-direction: column;
    align-items: center;
    padding: 0 var(--spacing-md);
  }

  .ngss-search-container {
    width: 100%;
  }

  .ngss-search-input {
    min-width: 0;
  }
}

/* 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;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.item-info-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.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;
}

/* Notebook Icon Button */
.notebook-icon-btn {
  width: 28px;
  height: 28px;
  background: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: none;
  border: none;
  flex-shrink: 0;
  padding: 0;
  color: var(--color-primary);
  align-self: flex-start;
  animation: notebookPulse 2s ease-in-out infinite;
}

@keyframes notebookPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.notebook-icon-btn:hover,
.notebook-icon-btn:focus-visible {
  animation: none;
  transform: scale(1.2);
  opacity: 1;
  background: none;
  box-shadow: none;
  color: var(--color-primary);
}

.notebook-icon-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 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;
}

/* Social Share Icons */
.card-share-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 4px;
}

.card-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.card-share-btn svg {
  width: 20px;
  height: 20px;
}

.card-share-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
}

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

.card-share-btn.share-bluesky:hover {
  color: #0085ff;
}

.card-share-btn.share-facebook: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: var(--spacing-md) var(--spacing-xl);
  background-color: var(--color-bg-light);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

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

.copy-attribution-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--spacing-xs);
  padding: 4px 12px;
  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-accent);
  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(241, 143, 1, 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;
  }

  /* ── 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: 32px;
    height: 32px;
  }

  .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: var(--spacing-sm) var(--spacing-md);
  }

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

  .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;
  }
}

@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-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-stats {
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: 6px;
  }

  .lesson-pdf-btn,
  .five-e-pdf-btn,
  .edp-pdf-btn,
  .exit-ticket-btn,
  .rubric-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,
  .exit-ticket-btn svg,
  .rubric-btn svg {
    width: 14px;
    height: 14px;
  }

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

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

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

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

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

/* ============================================
   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);
}

/* ============================================
   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;
}

.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-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,
  .exit-ticket-btn,
  .rubric-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,
  .exit-ticket-btn svg,
  .rubric-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;
  }
}

/* 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-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.copyright-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: var(--color-text-dark);
  margin-left: 4px;
}

.filter-btn.active .category-badge {
  background-color: rgba(255, 255, 255, 0.3);
  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, #ff6b6b 0%, #ee5a24 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(238, 90, 36, 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;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3);
  }
  50% {
    box-shadow: 0 2px 16px rgba(238, 90, 36, 0.5);
  }
}

/* ============================================
   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-actions {
  display: flex;
  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 {
  animation: none;
}
}

/* ============================================
   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 button in gallery header */
.collection-filter-btn {
  position: relative;
  white-space: nowrap;
}

.collection-heart-emoji {
  font-size: 1em;
  line-height: 1;
}

.collection-filter-btn.active {
  background-color: var(--color-heart) !important;
  border-color: var(--color-heart) !important;
  color: white !important;
}

.collection-filter-btn:hover:not(.active) {
  border-color: var(--color-heart);
  color: var(--color-heart);
}

.collection-badge {
  background-color: var(--color-heart);
  color: white;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 5px;
}

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

/* "What's New" filter button */
.new-filter-btn {
  white-space: nowrap;
}

.new-filter-btn.active {
  background-color: #ee5a24 !important;
  border-color: #ee5a24 !important;
  color: white !important;
}

.new-filter-btn:hover:not(.active) {
  border-color: #ee5a24;
  color: #ee5a24;
}

.new-badge-count {
  background-color: #ee5a24;
  color: white;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 5px;
}

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

/* "Newest First" sort button */
.sort-newest-btn {
  white-space: nowrap;
}

.sort-newest-btn.active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: white !important;
}

.sort-newest-btn:hover:not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

/* 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-filter-btn {
  position: relative;
  white-space: nowrap;
}

.featured-icon-emoji {
  font-size: 1em;
  line-height: 1;
}

.featured-filter-btn.active {
  background-color: var(--color-star) !important;
  border-color: var(--color-star) !important;
  color: white !important;
}

.featured-filter-btn:hover:not(.active) {
  border-color: var(--color-star);
  color: var(--color-star);
}

.featured-badge {
  background-color: var(--color-star);
  color: white;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 5px;
}

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

@media (max-width: 600px) {
  .featured-label {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  .featured-label {
    font-size: 0.75rem;
  }
}

/* ============================================
   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-select {
  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);
  background-color: var(--color-bg-white);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.stems-grade-select:focus {
  border-color: var(--color-secondary);
  outline: none;
}

.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;
  }
}
