/* Netflix-style Gallery Layout */
:root {
  --primary-bg: #141414;
  --secondary-bg: #000000;
  --text-color: #ffffff;
  --text-secondary: #b3b3b3;
  --highlight-color: #008cff;
  --card-hover-scale: 1.05;
  --row-spacing: 50px;
  --row-height: 280px; /* Fixed height per row, widths will be dynamic */
  --card-margin: 10px;
  --card-min-width: 180px; /* Minimum width for portrait images */
  --card-max-width: 500px; /* Maximum width for panoramic images */
  --transition-speed: 0.3s;
}

/* Hide the body background image on gallery page */
body:has(.netflix-gallery)::after {
  display: none;
}

/* Main container - Unified grid for all content */
.netflix-gallery {
  background-color: rgba(0, 4, 20, 0.98);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden; /* Changed from 'clip' to 'hidden' to allow sticky positioning */
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 40px 4% 60px 4%;
}

/* Force logo visibility on gallery page */
body:has(.netflix-gallery) .logo,
.netflix-gallery ~ * .logo,
body .logo {
  opacity: 1 !important;
  transform: translateY(0) !important;
  height: 75px !important;
  display: flex !important;
  align-items: center !important;
  overflow: visible !important;
}

body:has(.netflix-gallery) .logo img,
.netflix-gallery ~ * .logo img,
body .logo img {
  height: 75px !important;
  width: auto !important;
}

/* Ensure content appears above glow */
.netflix-gallery > * {
  position: relative;
  z-index: 2;
}

/* Page header */
.gallery-header {
  text-align: center;
  padding: 40px 0;
  background-color: var(--secondary-bg);
  margin-bottom: 30px;
}

.gallery-header h1 {
  font-size: 3rem;
  margin: 0;
  color: var(--text-color);
}

/* Category row - Made invisible with display: contents */
.content-row {
  display: contents;
}

/* First content row after hero - spacing handled by bridge */
.content-row:first-of-type {
  margin-top: 0;
}

/* Hero Transition Bridge - Spans full width outside grid */
.hero-transition-bridge {
  position: relative;
  height: 0px;
  width: 100%;
  overflow: hidden;
  background: transparent;
  z-index: 2;
  grid-column: 1 / -1;
  margin-left: -4%;
  margin-right: -4%;
}

.bridge-content {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Remove bridge effects for clean look */
.bridge-pattern {
  display: none;
}

.bridge-glow {
  display: none;
}

/* Bridge Animations */
@keyframes bridgePatternFlow {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0, 100% 100%, 0 0;
  }
  100% {
    background-position: 60px 60px, 30px 30px, 30px 30px, 800px 800px, 0% 0%, 40px 40px;
  }
}

@keyframes bridgeGlow {
  0% {
    opacity: 0.3;
    transform: translateX(-10%);
  }
  100% {
    opacity: 0.7;
    transform: translateX(10%);
  }
}

.row-header {
  display: none;
}

/* Grid row container - Made invisible with display: contents */
.row-container {
  display: contents;
}

/* Content card - Grid layout */
.content-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  cursor: pointer;
  margin: 0;
}

.content-card:hover {
  transform: scale(var(--card-hover-scale));
  z-index: 10;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Card image */
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter var(--transition-speed) ease;
}

.content-card:hover .card-img {
  filter: brightness(0.7);
}

/* Play button */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 140, 255, 0.8);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.content-card:hover .play-button {
  opacity: 1;
}

.play-button i {
  color: white;
  font-size: 20px;
  margin-left: 4px; /* Offset for play icon */
}

/* Card info overlay */
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
  text-align: left;
}

.content-card:hover .card-info {
  opacity: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 5px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.8rem;
  margin: 0;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

/* Row navigation arrows - HIDDEN */
.row-nav {
  display: none !important;
}

/* Video modal */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.video-modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
}

.modal-video {
  width: 100%;
  display: block;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1001;
  transition: background-color var(--transition-speed) ease;
}

.close-modal:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.close-modal i {
  color: white;
  font-size: 20px;
}

/* Video Enhancement Styles for Azure Content */

/* Video placeholder styles */
.video-placeholder {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 100%;
  border-radius: 4px;
  border: 2px dashed #7f8c8d;
  transition: all 0.3s ease;
}

.video-placeholder:hover {
  border-color: #e74c3c;
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.placeholder-content {
  text-align: center;
  color: #ecf0f1;
  padding: 20px;
}

.placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.7;
  display: block;
}

.placeholder-text {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.placeholder-filename {
  font-size: 0.8rem;
  opacity: 0.8;
  word-break: break-word;
  max-width: 180px;
  margin: 0 auto;
}

/* Video thumbnail styles */
.video-thumb {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Video thumbnail container */
.video-thumbnail {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
}

/* Thumbnail status indicator */
.thumbnail-status {
  color: #e74c3c;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Enhanced play button for videos */
.content-card[data-video] .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.content-card[data-video] .play-button:hover {
  background: rgba(0, 140, 255, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Special styling for videos without thumbnails */
.content-card[data-needs-thumbnail="true"] {
  border: 2px solid #e74c3c;
  border-radius: 8px;
}

.content-card[data-needs-thumbnail="true"] .card-info {
  background: linear-gradient(to top, rgba(231, 76, 60, 0.2), transparent);
}

/* Hover effects for video cards */
.content-card[data-video]:hover .video-thumbnail {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* Loading state for thumbnails */
.video-thumb[data-loading="true"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Dark mode support for placeholders */
@media (prefers-color-scheme: dark) {
  .video-placeholder {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-color: #555;
  }

  .video-placeholder:hover {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
  }

  .placeholder-content {
    color: #f0f0f0;
  }
}

/* Integration with existing Netflix-style gallery */
.netflix-gallery .content-card[data-video] {
  transition: all 0.3s ease;
}

.netflix-gallery .content-card[data-video]:hover {
  transform: scale(1.05);
  z-index: 100;
}

/* Status indicators for admin/management views */
.gallery-admin .content-card[data-needs-thumbnail="true"]::after {
  content: "⚠️ NEEDS THUMBNAIL";
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e74c3c;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  z-index: 20;
}

/* Hero Carousel - Spans full width outside grid */
.hero-carousel {
  position: relative;
  height: 100vh;
  min-height: 400px;
  margin-bottom: 0;
  margin-top: 0;
  overflow: hidden;
  background-color: rgba(0, 4, 20, 0.98);
  grid-column: 1 / -1;
  margin-left: -4%;
  margin-right: -4%;
}

/* Static Gallery Title */
.gallery-static-title {
  position: relative;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

/* Smooth transition zone between hero and content */
.hero-carousel::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(to bottom, transparent 0%, transparent 40%, rgba(0, 4, 20, 0.4) 60%, rgba(0, 4, 20, 0.8) 80%, rgba(0, 4, 20, 0.98) 100%);
  z-index: 3;
  pointer-events: none;
}

/* Carousel Slides */
.carousel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 1;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.slide-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, var(--primary-bg) 0%, rgba(20, 20, 20, 0.9) 15%, transparent 60%, rgba(0, 0, 0, 0.7));
}

.slide-info {
  position: absolute;
  bottom: 10%;
  left: 4%;
  max-width: 40%;
  text-align: left;
  z-index: 3;
}

.slide-desc {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.slide-buttons {
  display: flex;
  gap: 15px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--highlight-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}

.play-btn:hover {
  background-color: rgba(0, 140, 255, 0.9);
}

.play-btn i {
  margin-right: 8px;
}

.see-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}

.see-more-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.see-more-btn i {
  margin-right: 8px;
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  bottom: 8%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

.carousel-prev,
.carousel-next {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
  margin: 0 15px;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-indicators {
  display: flex;
  gap: 10px;
}

.carousel-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.carousel-indicator.active {
  background-color: var(--highlight-color);
  transform: scale(1.2);
}

/* Highlight animation for category rows */
@keyframes highlightRow {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(0, 140, 255, 0.2);
  }
  100% {
    background-color: transparent;
  }
}

.content-row.highlight {
  animation: highlightRow 2s ease;
}

/* Section Dividers */
.section-divider {
  position: relative;
  margin: 40px 4% 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 140, 255, 0.3) 20%, rgba(0, 140, 255, 0.8) 50%, rgba(0, 140, 255, 0.3) 80%, transparent 100%);
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.section-divider::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 140, 255, 0.6) 50%, transparent 100%);
  animation: dividerGlow 3s ease-in-out infinite;
  z-index: 1;
}

.section-divider-text {
  position: relative;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  color: var(--text-color);
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1px solid rgba(0, 140, 255, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 3;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-divider-text::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, rgba(0, 140, 255, 0.2) 0%, rgba(0, 140, 255, 0.1) 50%, rgba(0, 140, 255, 0.2) 100%);
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section-divider:hover .section-divider-text::before {
  opacity: 1;
}

@keyframes dividerGlow {
  0% {
    left: -100%;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Alternative divider style for variety */
.section-divider.style-2 {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
}

.section-divider.style-2::before {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
}

.section-divider.style-2::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Filtered Grid Layout */
.filtered-grid-container {
  display: none;
  padding: 0;
  margin-top: 40px;
  grid-column: 1 / -1;
}

.filtered-grid-container.active {
  display: block;
}

.filtered-grid-header {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 30px;
  color: var(--text-color);
  text-align: center;
}

.filtered-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 0;
}

.filtered-grid .content-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  margin: 0;
  white-space: normal;
  overflow: hidden;
}

/* Ensure images scale properly in grid mode */
.filtered-grid .content-card .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Adjust card info positioning for flexible height cards */
.filtered-grid .content-card .card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

/* Ensure play button is properly centered in grid cards */
.filtered-grid .content-card .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Hide original rows when in grid mode - must override mobile rules */
.netflix-gallery.grid-mode .content-row {
  display: none !important;
}

.netflix-gallery.grid-mode .section-divider {
  display: none !important;
}

/* Show original layout when not in grid mode */
.netflix-gallery:not(.grid-mode) .filtered-grid-container {
  display: none;
}

/* Responsive grid adjustments */
@media (max-width: 1400px) {
  .row-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .filtered-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

@media (max-width: 992px) {
  .row-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .filtered-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .netflix-gallery {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px 4%;
    padding-top: 250px; /* Add space below filter on mobile - increased to clear filter */
  }

  .content-card {
    margin-bottom: 15px;
  }
}

@media (max-width: 576px) {
  .netflix-gallery {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px 3%;
  }

  .content-card {
    margin-bottom: 12px;
  }
}

@media (max-width: 768px) {
  .filtered-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filtered-grid-header {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
}

@media (max-width: 576px) {
  .filtered-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filtered-grid-header {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  :root {
    --row-height: 240px;
    --card-min-width: 160px;
    --card-max-width: 450px;
  }

  .featured-info {
    max-width: 50%;
  }
}

@media (max-width: 992px) {
  :root {
    --row-height: 220px;
    --card-min-width: 150px;
    --card-max-width: 400px;
    --row-spacing: 40px;
  }

  .featured-info {
    max-width: 60%;
  }

  .featured-title {
    font-size: 2rem;
  }

  /* Adjust hero carousel for smaller screens */
  .hero-carousel {
    margin-top: 0;
    height: 100vh;
    min-height: 350px;
  }

  /* Responsive bridge adjustments */
  .hero-transition-bridge {
    height: 0px;
  }

  .particle {
    width: 2.5px;
    height: 2.5px;
  }
}

@media (max-width: 768px) {
  :root {
    --row-height: 250px;
    --card-min-width: 100%;
    --card-max-width: 100%;
    --card-margin: 0;
  }

  .gallery-header h1 {
    font-size: 2.5rem;
  }

  .row-header {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  /* Single column layout - no horizontal scrolling */
  .row-container {
    overflow: visible;
    white-space: normal;
    padding: 0;
    margin: 0;
  }

  .content-card {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/10;
    margin: 0 0 20px 0 !important;
  }

  /* Hide navigation arrows on mobile */
  .row-nav {
    display: none;
  }

  .featured-info {
    max-width: 80%;
  }

  .featured-title {
    font-size: 1.8rem;
  }

  .featured-desc {
    font-size: 1rem;
  }

  /* Mobile hero carousel adjustments */
  .hero-carousel {
    margin-top: 0;
    height: 80vh;
    min-height: 350px;
  }

  .gallery-static-title {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
  }

  .slide-info {
    bottom: 20% !important;
    left: 4%;
    max-width: 70%;
  }

  .slide-desc {
    font-size: 1rem;
    line-height: 1.5;
    display: none; /* Hide description on mobile */
  }

  /* Mobile bridge adjustments - reduce height significantly */
  .hero-transition-bridge {
    height: 0px;
  }

  .particle {
    width: 2px;
    height: 2px;
  }

  /* Adjust carousel navigation position */
  .carousel-nav {
    bottom: 8%;
  }

  /* Improve card readability on mobile */
  .card-title {
    font-size: 1.1rem;
  }

  .card-desc {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }

  /* Better touch targets for navigation */
  .row-nav {
    width: 50px;
    height: 120px;
  }

  .row-nav i {
    font-size: 28px;
  }

  /* Optimize carousel navigation for touch */
  .carousel-prev,
  .carousel-next {
    width: 50px;
    height: 50px;
  }

  .carousel-prev i,
  .carousel-next i {
    font-size: 20px;
  }

  .carousel-indicator {
    width: 12px;
    height: 12px;
  }

  /* Content row spacing */
  .content-row {
    padding: 0 3%;
    margin-bottom: 15px;
    margin-top: 20px;
  }

  /* Extra space for first content row below filter */
  .content-row:first-of-type {
    margin-top: 130px;
  }
}

@media (max-width: 768px) {
  .section-divider-text {
    font-size: 1rem;
    padding: 10px 20px;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 576px) {
  :root {
    --row-height: 200px;
    --card-min-width: 140px;
    --card-max-width: 350px;
    --card-margin: 8px;
    --row-spacing: 30px;
  }

  .gallery-header h1 {
    font-size: 2rem;
  }

  .row-header {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }

  /* Ensure content rows are visible */
  .content-row {
    display: block !important;
    min-height: 200px;
  }

  .row-container {
    min-height: 200px;
  }

  .featured-info {
    max-width: 90%;
  }

  .featured-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .featured-desc {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }

  .featured-button {
    padding: 8px 16px;
    font-size: 1rem;
  }

  .section-divider-text {
    font-size: 0.85rem;
    padding: 10px 18px;
    letter-spacing: 0.5px;
  }

  /* Very small screen hero carousel adjustments */
  .hero-carousel {
    margin-top: 0;
    height: 70vh;
    min-height: 300px;
  }

  .gallery-static-title {
    font-size: 1.9rem;
    margin-bottom: 0.6rem;
  }

  .slide-info {
    bottom: 8%;
    left: 3%;
    max-width: 75%;
  }

  .slide-desc {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* Very small screen bridge adjustments */
  .hero-transition-bridge {
    height: 0px;
  }

  .particle {
    width: 1.5px;
    height: 1.5px;
  }

  /* Larger cards for better mobile experience */
  .card-title {
    font-size: 1rem;
  }

  .card-desc {
    font-size: 0.85rem;
  }

  /* Better touch targets */
  .row-nav {
    width: 45px;
    height: 100px;
  }

  .row-nav i {
    font-size: 24px;
  }

  /* Play button sizing */
  .play-button {
    width: 55px;
    height: 55px;
  }

  .play-button i {
    font-size: 22px;
  }

  /* Carousel touch optimization */
  .carousel-prev,
  .carousel-next {
    width: 45px;
    height: 45px;
    margin: 0 10px;
  }

  .carousel-indicator {
    width: 10px;
    height: 10px;
  }

  .carousel-indicators {
    gap: 8px;
  }

  /* Content row spacing */
  .content-row {
    padding: 0 2%;
    margin-bottom: 35px;
  }

  .row-container {
    padding: 15px 0;
  }
}

/* Extra small screens (≤420px) - Ensure content is always visible */
@media (max-width: 420px) {
  :root {
    --row-height: 220px;
    --card-min-width: 160px;
    --card-max-width: 380px;
    --card-margin: 10px;
  }

  /* Force content rows to be visible */
  .content-row {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 220px;
    padding: 0 3%;
  }

  .row-container {
    min-height: 220px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure cards are visible and properly sized */
  .content-card {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 160px !important;
    height: 220px !important;
  }

  /* Adjust row header for very small screens */
  .row-header {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  /* Ensure filtered grid works on very small screens */
  .filtered-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px 0;
  }

  .filtered-grid .content-card {
    min-height: 220px;
  }
}
