/* ===== Gallery Page Styles ===== */

/* ===== Simple Intro Statement ===== */
.gallery-intro-statement {
  text-align: center;
  padding: 0.025rem 1rem 0.025rem;
  max-width: 1000px;
  margin: 50px auto;
  transition: all 0.5s ease;
}

.gallery-intro-statement h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  font-weight: 700;
}

.gallery-intro-statement p {
  font-size: 1.2rem;
  color: #6c757d;
  line-height: 1.6;
  margin: 0 auto;
}

.gallery-intro-statement.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px);
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* ===== Gallery Page Header ===== */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: url('../images/wallpaper/nav.avif') no-repeat center center;
  background-size: cover;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  gap: 2rem;
}

/* Left section with logo and title */
.gallery-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.gallery-logo {
  height: 50px;
  width: auto;
  display: block;
}

.gallery-title {
  font-size: 1.8rem;
  color: black;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

/* Main controls wrapper */
.gallery-controls-wrapper {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-grow: 1;
  justify-content: flex-end;
}

/* Trailer selection buttons - now with dual function */
.trailer-selection-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Button styles - with states for active slideshow */
.btn-header {
  padding: 0.5rem 1.2rem;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.btn-header:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
}

/* Active state for button when its gallery is displayed */
.btn-header.active {
  background-color: #2ecc71;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Slideshow running state */
.btn-header.slideshow-running {
  background-color: #3498db;
  animation: pulse 2s infinite;
}

/* Paused state */
.btn-header.slideshow-paused {
  background-color: #e67e22;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
  }
}

/* Swiper navigation buttons */
.swiper-button-next,
.swiper-button-prev {
  color: #e74c3c;
  background: rgba(255, 255, 255, 0.7);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 0;
  margin-top: 0;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 16px;
}

/* ===== Gallery Section ===== */
.gallery-section {
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  margin-top: 1rem;
  padding: 0;
}

/* Swiper container - FULL WIDTH (REDUCED BY 10%) */
.swiper {
  width: 100%;
  height: 67.5vh;
  max-height: 720px;
  min-height: 405px;
  position: relative;
  z-index: 1;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
  background: #0a0e17;
}

/* Starry background overlay - only for mobile portrait */
.swiper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

/* Desktop - even larger for big screens (REDUCED BY 10%) */
@media (min-width: 1025px) {
  .swiper {
    height: 72vh;
    max-height: 765px;
    min-height: 450px;
    background: #f8f9fa;
  }
}

/* Ultra-wide screens (REDUCED BY 10%) */
@media (min-width: 1600px) {
  .swiper {
    height: 76.5vh;
    max-height: 810px;
    min-height: 495px;
  }
}

/* Each slide fills swiper fully */
.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  position: relative;
  overflow: hidden;
}

/* Slide images - FILL FULL SPACE (For desktop) */
.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.swiper-slide img:hover {
  transform: scale(1.01);
}

/* Star particles - hidden by default (will be shown for mobile portrait) */
.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  width: 2px;
  height: 2px;
  animation: twinkle 3s infinite;
}

/* Shooting stars */
.shooting-star {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, white, transparent);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: shoot 5s infinite;
}

/* Twinkle animation for stars */
@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Shooting star animation */
@keyframes shoot {
  0% {
    opacity: 0;
    transform: translateX(-100px) translateY(var(--start-y, 0px));
  }
  10% {
    opacity: 1;
  }
  20% {
    opacity: 0;
    transform: translateX(100vw) translateY(calc(var(--start-y, 0px) + 50px));
  }
  100% {
    opacity: 0;
  }
}

/* Swiper pagination bullets - FIXED positioning */
.swiper-pagination {
  position: absolute !important;
  bottom: 10px !important;
  left: 0;
  right: 0;
  margin-top: 0;
  padding-bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.swiper-pagination-bullet {
  background: #e74c3c;
  opacity: 0.5;
  transition: all 0.3s ease;
  width: 10px;
  height: 10px;
  display: inline-block;
  margin: 0 4px;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.2);
  background: #e74c3c;
}

/* Hide pagination text/numbers if present */
.swiper-pagination-fraction,
.swiper-pagination-custom,
.swiper-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet,
.swiper-pagination-bullets-dynamic {
  font-size: 0;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 1024px) {
  .gallery-header {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .gallery-left {
    width: 100%;
    justify-content: center;
  }

  .gallery-controls-wrapper {
    width: 100%;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
  }

  .trailer-selection-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .swiper {
    height: 54vh;
    min-height: 315px;
  }
}

/* Mobile Landscape - Keep normal background */
@media (max-width: 768px) and (orientation: landscape) {
  .swiper {
    height: 67.5vh;
    min-height: 270px;
    background: #f8f9fa;
  }

  .swiper-slide img {
    object-fit: cover;
  }

  /* Hide stars in landscape */
  .star, .shooting-star {
    display: none;
  }
}

/* ===== MOBILE PORTRAIT ONLY - ADDED 7% TO FILL BOTTOM SPACE ===== */
@media (max-width: 768px) and (orientation: portrait) {
  .gallery-left {
    gap: 0.75rem;
  }

  .gallery-logo {
    height: 40px;
  }

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

  .trailer-selection-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .btn-header {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    min-width: 140px;
  }

  /* FINAL FIX: Added 7% more height (82vh = 75vh + 7vh) */
  .swiper {
    height: 82vh !important; /* Increased by 7% from 75vh */
    min-height: 428px !important; /* Increased proportionally */
    background: #0a0e17;
    position: relative;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .swiper::before {
    opacity: 1;
  }

  /* Make slide transparent and center content */
  .swiper-slide {
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
  }

  /* Image stays centered with more room for stars */
  .swiper-slide img {
    object-fit: contain !important;
    max-height: 70vh !important; /* Slightly increased to match new container */
    width: auto !important;
    max-width: 95% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    z-index: 2;
    background: transparent;
  }

  /* Navigation buttons */
  .swiper-button-next,
  .swiper-button-prev {
    width: 32px;
    height: 32px;
    background: rgba(231, 76, 60, 0.9);
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    z-index: 3;
  }

  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 14px;
    color: white;
  }

  /* Show stars for mobile portrait */
  .star {
    opacity: 0.7;
  }

  .shooting-star {
    opacity: 0.8;
  }
}

/* Small Mobile Devices Portrait - Added 7% */
@media (max-width: 480px) and (orientation: portrait) {
  .gallery-header {
    padding: 0.75rem;
  }

  .gallery-logo {
    height: 35px;
  }

  .gallery-title {
    font-size: 1.3rem;
  }

  .btn-header {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    min-width: 120px;
  }

  .trailer-selection-buttons {
    gap: 0.5rem;
  }

  /* Added 7% (77vh = 70vh + 7vh) */
  .swiper {
    height: 77vh !important; /* Increased by 7% from 70vh */
    min-height: 407px !important; /* Increased proportionally */
  }

  /* Adjust image size for smaller screens */
  .swiper-slide img {
    max-height: 65vh !important; /* Adjusted for new container height */
    max-width: 98% !important;
  }
}

/* Very Small Screens Portrait - Added 7% */
@media (max-width: 360px) and (orientation: portrait) {
  .gallery-title {
    font-size: 1.1rem;
  }

  .btn-header {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    min-width: 110px;
  }

  .trailer-selection-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .trailer-selection-buttons .btn-header {
    width: 100%;
    max-width: 200px;
  }

  /* Added 7% (72vh = 65vh + 7vh) */
  .swiper {
    height: 72vh !important; /* Increased by 7% from 65vh */
    min-height: 375px !important; /* Increased proportionally */
  }

  .swiper-slide img {
    max-height: 60vh !important; /* Adjusted */
    max-width: 99% !important;
  }
}

/* For very tall screens - Added 7% */
@media (max-height: 600px) and (max-width: 768px) and (orientation: portrait) {
  /* Added 7% (92vh = 85vh + 7vh) */
  .swiper {
    height: 92vh !important; /* Increased by 7% from 85vh */
  }

  .swiper-slide img {
    max-height: 80vh !important; /* Adjusted */
  }
}