/* Fullscreen Banner Styles */

/* Reset body and html */
html {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header should stay fixed at top */
header {
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-fixed);
}

/* Main container for scroll snap */
main {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  /* Smoother scrolling on webkit browsers */
  -webkit-overflow-scrolling: touch;
}

/* Slower scroll behavior */
@media (prefers-reduced-motion: no-preference) {
  main {
    scroll-behavior: smooth;
  }
}

/* Each fullscreen banner section */
.fullscreen-banner {
  position: relative;
  width: 100%;
  /* Banner takes full height of main container */
  height: 100%;
  min-height: 500px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  /* Add transition for smoother appearance */
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
  opacity: 0;
  animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Banner background image - only direct child img, not nested images */
.fullscreen-banner > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

/* Banner content overlay */
.banner-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-white);
  z-index: 10;
  max-width: 900px;
  width: 90%;
  padding: var(--spacing-2xl) var(--spacing-3xl);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  /* Ensure content doesn't overflow - use percentage for Swiper compatibility */
  max-height: 85%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Prevent content from being covered by fixed header */
  margin-top: calc(var(--header-height) / 2);
}

/* Initial state for animation - only for non-active slides */
.swiper-slide:not(.swiper-slide-active) .banner-content {
  opacity: 0;
  transform: translate(-50%, -40%);
}

/* Active slide content animation - entrance */
.swiper-slide-active .banner-content {
  animation: slideInUp 0.8s ease-out forwards;
}

/* Previous/Next slide content animation - exit */
.swiper-slide-prev .banner-content,
.swiper-slide-next .banner-content {
  animation: slideOutDown 0.6s ease-in forwards;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -35%);
  }
}

/* Stagger animation for child elements - entrance */
.swiper-slide-active .banner-content h2 {
  animation: fadeInUp 0.6s ease-out 0.2s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.swiper-slide-active .banner-content p {
  animation: fadeInUp 0.6s ease-out 0.4s forwards;
  opacity: 0;
  transform: translateY(20px);
}

/* Exit animation for child elements */
.swiper-slide-prev .banner-content h2,
.swiper-slide-next .banner-content h2,
.swiper-slide-prev .banner-content p,
.swiper-slide-next .banner-content p {
  animation: fadeOutDown 0.4s ease-in forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(15px);
  }
}

.banner-content h2 {
  font-family: var(--font-family-heading);
  font-size: clamp(1.75rem, 4vw, var(--font-size-5xl));
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-tight);
  letter-spacing: 0.02em;
}

.banner-content p {
  font-size: clamp(1rem, 2vw, var(--font-size-xl));
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  opacity: 0.95;
}

/* Hide scroll indicator on last banner */
.fullscreen-banner:last-of-type ~ .scroll-indicator {
  display: none;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .fullscreen-banner {
    min-height: 100vh;
  }
  
  .banner-content {
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 95%;
    max-height: 85%;
    margin-top: calc(var(--header-height-mobile) / 2);
  }
  
  .banner-content h2 {
    font-size: clamp(1.5rem, 5vw, var(--font-size-3xl));
    margin-bottom: var(--spacing-sm);
  }
  
  .banner-content p {
    font-size: clamp(0.875rem, 3vw, var(--font-size-base));
    line-height: 1.5;
  }
}

/* Small height screens */
@media (max-height: 600px) {
  .fullscreen-banner {
    min-height: 100vh;
  }
  
  .banner-content {
    padding: var(--spacing-sm) var(--spacing-md);
    max-height: 75%;
    top: 55%;
    margin-top: 0;
  }
  
  .banner-content h2 {
    font-size: clamp(1.25rem, 3vh, 2rem);
    margin-bottom: var(--spacing-xs);
  }
  
  .banner-content p {
    font-size: clamp(0.875rem, 2vh, 1.125rem);
    line-height: 1.4;
  }
}

/* Very small height screens */
@media (max-height: 500px) {
  .banner-content {
    padding: var(--spacing-xs) var(--spacing-sm);
    max-height: 70%;
    gap: var(--spacing-xs);
    top: 58%;
    margin-top: 0;
  }
  
  .banner-content h2 {
    font-size: clamp(1rem, 2.5vh, 1.5rem);
    margin-bottom: 0.25rem;
  }
  
  .banner-content p {
    font-size: clamp(0.75rem, 1.8vh, 1rem);
    line-height: 1.3;
  }
}

/* Tablet responsive */
@media (min-width: 768px) and (max-width: 1023px) {
  .banner-content h2 {
    font-size: clamp(2rem, 3.5vw, var(--font-size-4xl));
  }
  
  .banner-content p {
    font-size: clamp(1rem, 2vw, var(--font-size-lg));
  }
}

/* Tablet with small height */
@media (min-width: 768px) and (max-height: 700px) {
  .banner-content {
    max-height: 75%;
    top: 55%;
    margin-top: 0;
  }
  
  .banner-content h2 {
    font-size: clamp(1.5rem, 3vh, 2.5rem);
    margin-bottom: var(--spacing-sm);
  }
  
  .banner-content p {
    font-size: clamp(0.875rem, 2vh, 1.25rem);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  main {
    scroll-behavior: auto;
  }
  
  .fullscreen-banner {
    animation: none;
    opacity: 1;
  }
  
  .banner-content,
  .banner-content h2,
  .banner-content p,
  .banner-click-hint {
    animation: none !important;
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
  }
  
  .banner-content h2,
  .banner-content p {
    transform: translateY(0) !important;
  }
  
  /* Disable exit animations */
  .swiper-slide-prev .banner-content,
  .swiper-slide-next .banner-content,
  .swiper-slide-prev .banner-content h2,
  .swiper-slide-next .banner-content h2,
  .swiper-slide-prev .banner-content p,
  .swiper-slide-next .banner-content p,
  .swiper-slide-prev .banner-click-hint,
  .swiper-slide-next .banner-click-hint {
    animation: none !important;
  }
}

/* Custom scrollbar for main */
main::-webkit-scrollbar {
  width: 8px;
}

main::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

main::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

main::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Clickable Banner Styles */
.clickable-banner {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.clickable-banner:hover {
  transform: scale(1.02);
}

.banner-click-hint {
  position: absolute;
  bottom: 35%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: var(--spacing-sm) var(--spacing-xl);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

/* Show hint on active slide after content animation - entrance */
.swiper-slide-active .banner-click-hint {
  animation: fadeIn 0.5s ease-out 1s forwards;
}

/* Hide hint on exit */
.swiper-slide-prev .banner-click-hint,
.swiper-slide-next .banner-click-hint {
  animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 0.8;
  }
}

@keyframes fadeOut {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 0;
  }
}

.clickable-banner:hover .banner-click-hint {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 767px) {
  .banner-click-hint {
    bottom: 25%;
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-lg);
  }
  
  .clickable-banner:hover {
    transform: none;
  }
  
  .clickable-banner:hover .banner-click-hint {
    transform: translateX(-50%) translateY(-4px);
  }
}

@media (max-height: 600px) {
  .banner-click-hint {
    bottom: 15%;
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
  }
}

@media (max-height: 500px) {
  .banner-click-hint {
    bottom: 10%;
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
  }
}
