@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

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

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  transition: background-color 200ms ease, color 200ms ease;
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography Scale */
h1, h2, h3, h4, .font-heading {
  font-family: 'Outfit', sans-serif;
  color: var(--foreground);
  line-height: 1.2;
}

.text-xs   { font-size: 0.75rem; line-height: 1rem; }    /* 12px */
.text-sm   { font-size: 0.875rem; line-height: 1.25rem; } /* 14px */
.text-base { font-size: 1rem; line-height: 1.5rem; }     /* 16px */
.text-lg   { font-size: 1.25rem; line-height: 1.75rem; }  /* 20px */
.text-xl   { font-size: 1.75rem; line-height: 2.25rem; }  /* 28px */
.text-2xl  { font-size: 2.5rem; line-height: 3rem; }       /* 40px */

/* Container */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Glass Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.dark .site-header {
  background-color: rgba(17, 17, 17, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--foreground);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.logo-badge svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Header Search */
.header-search {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-left {
  position: absolute;
  left: 0.875rem;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--muted-foreground);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 2.5rem 0 2.625rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--card-foreground);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 150ms ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(100, 74, 64, 0.15);
}

.dark .search-input:focus {
  box-shadow: 0 0 0 2px rgba(255, 224, 194, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 0.625rem;
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: var(--foreground);
  background-color: var(--muted);
}

.search-clear-btn.visible {
  display: flex;
}

/* Actions Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: justify;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--card-foreground);
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  padding: 0.625rem;
}

.btn-icon:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--input);
}

.btn-icon:active {
  transform: scale(0.97);
}

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

/* Hero Section */
.hero-section {
  position: relative;
  padding: 3rem 0 2.25rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--background) 0%, var(--sidebar) 100%);
  overflow: hidden;
}

.hero-marquee-wrapper {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.dark .hero-marquee-wrapper {
  opacity: 0.22;
}

.hero-marquee-track {
  display: flex;
  gap: 0.875rem;
  width: max-content;
  animation: marqueeScroll 45s linear infinite;
  will-change: transform;
}

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

.hero-marquee-item {
  width: 180px;
  height: 110px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--muted);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, var(--background) 80%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  color: var(--muted-foreground);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 1.25rem auto;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.375rem 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.stat-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--muted-foreground);
  opacity: 0.5;
}

.stat-number {
  color: var(--chart-1);
}

.dark .stat-number {
  color: var(--chart-1);
}

/* Category Rail Section */
.category-rail-section {
  position: sticky;
  top: 4rem;
  z-index: 40;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  transition: background-color 200ms ease;
}

.category-rail-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-rail-scroll-container {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
  gap: 0.25rem;
}

.category-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding: 0.25rem 0.5rem;
  flex: 1;
  scroll-behavior: smooth;
  mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
}

.category-chips-wrapper.at-start {
  mask-image: linear-gradient(to right, black 0, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 24px), transparent 100%);
}

.category-chips-wrapper.at-end {
  mask-image: linear-gradient(to right, transparent 0, black 24px, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 24px, black 100%);
}

.category-chips-wrapper::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.rail-scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--card-foreground);
  cursor: pointer;
  transition: all 150ms ease;
  z-index: 5;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}

.rail-scroll-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.rail-scroll-btn:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.chip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
  user-select: none;
  position: relative;
  text-decoration: none;
}

.chip-item:hover {
  background-color: var(--accent);
  border-color: var(--input);
}

.chip-item.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.chip-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--muted);
}

.chip-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  transition: background-color 150ms ease, color 150ms ease;
}

.chip-item.active .chip-badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--primary-foreground);
}

.category-download-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 150ms ease;
}

.category-download-all-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.category-download-all-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Main Gallery Area */
.gallery-section {
  padding: 1.5rem 0 3rem 0;
  flex: 1;
}

.gallery-grid-container {
  columns: 5 280px;
  column-gap: 1.25rem;
  transition: opacity 150ms ease, transform 150ms ease;
}

.gallery-grid-container.crossfade-out {
  opacity: 0;
  transform: scale(0.98);
}

/* Gallery Card */
.gallery-card {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  position: relative;
  border-radius: var(--radius);
  background-color: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 250ms ease, box-shadow 250ms ease, border-color 200ms ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.gallery-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.15);
  border-color: var(--ring);
}

.gallery-card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.search-result-count {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
  font-weight: 600;
}

/* Shimmer Skeleton Placeholder */
.card-media-wrapper {
  position: relative;
  width: 100%;
  min-height: 180px;
  background-color: var(--muted);
  overflow: hidden;
}

.card-media-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background-color: var(--muted);
  color: var(--muted-foreground);
  text-align: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 180px;
  width: 100%;
}

.card-media-unavailable svg {
  width: 2rem;
  height: 2rem;
  opacity: 0.6;
}

.card-media-wrapper.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite linear;
  z-index: 1;
}

.dark .card-media-wrapper.loading::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
}

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

.card-media {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0;
  transition: opacity 300ms ease;
}

.card-media.loaded {
  opacity: 1;
}

/* Card Type Badge (Top Right) */
.card-type-badge {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: var(--radius);
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-type-badge svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Card Hover Scrim */
.card-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 40%, transparent 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.875rem;
  transition: opacity 250ms ease;
}

.gallery-card:hover .card-scrim {
  opacity: 1;
}

.card-title {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}

.card-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

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

.card-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Loading Sentinel & Empty State */
.loading-sentinel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
  gap: 0.75rem;
  color: var(--muted-foreground);
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--muted-foreground);
}

.empty-state-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem auto;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

/* Lightbox Modal */
.lightbox-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background-color: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.lightbox-dialog[open] {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  z-index: 10;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

.lightbox-counter {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.lightbox-media-container {
  max-width: 90vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-media {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transition: transform 200ms ease;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: all 150ms ease;
}

.lightbox-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn.prev { left: 1.5rem; }
.lightbox-nav-btn.next { right: 1.5rem; }

.lightbox-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lightbox-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lightbox-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.lightbox-meta {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms ease;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms ease;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 200ms ease forwards;
}

.toast-item.fade-out {
  animation: toastOut 200ms ease forwards;
}

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

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

/* Footer Section */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--sidebar);
  padding: 2.5rem 0;
  margin-top: auto;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-link {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-link:hover {
  color: var(--primary);
}

/* Scroll To Top Floating Button */
.scroll-to-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--card-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 200ms ease;
}

.scroll-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-to-top-btn:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* All Categories Modal Dialog */
.all-categories-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 92vw;
  max-width: 900px;
  max-height: 85vh;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  background-color: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  z-index: 120;
  overflow-y: auto;
}

.all-categories-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.all-categories-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.all-categories-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close-btn {
  background-color: var(--muted);
  border: 1px solid var(--border);
  color: var(--foreground);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
}

.modal-close-btn:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.all-categories-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.category-all-grid-btn {
  flex-shrink: 0;
}

.manifest-error-container {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--destructive);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.manifest-error-container h3 {
  font-size: 1.25rem;
  color: var(--foreground);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .gallery-grid-container {
    columns: 3 240px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.5rem 0;
  }
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .header-search {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 0.25rem;
  }
  .logo-text {
    display: inline-block;
    font-size: 1.125rem;
  }
  .hero-section {
    padding: 2.25rem 0 1.5rem 0;
  }
  .category-download-all-btn {
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    justify-content: center;
  }
  .category-download-all-btn span {
    display: none;
  }
  .gallery-grid-container {
    columns: 2 150px;
    column-gap: 0.75rem;
  }
  .gallery-card {
    margin-bottom: 0.75rem;
  }
  .card-scrim {
    padding: 0.5rem;
  }
  .card-title {
    font-size: 0.75rem;
  }
  .lightbox-nav-btn.prev { left: 0.5rem; }
  .lightbox-nav-btn.next { right: 0.5rem; }
  .lightbox-media-container {
    max-width: 95vw;
    max-height: 65vh;
  }
  .lightbox-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .lightbox-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .scroll-to-top-btn {
    bottom: 1rem;
    right: 1rem;
  }
}

/* Reduced Motion Fallback */
@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;
  }
  .hero-marquee-track {
    animation: none !important;
  }
  .gallery-card:hover {
    transform: none !important;
  }
}

/* Video Error Fallback */
.video-error-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: calc(var(--radius) * 1.5);
  color: #ffffff;
  max-width: 480px;
  backdrop-filter: blur(8px);
}

.video-error-fallback svg {
  opacity: 0.7;
}

.video-error-fallback p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

