/* Global styles */
@font-face {
  font-family: 'KOMIKAX';
  src: url('fonts/KOMIKAX_.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'STICKEY';
  src: url('fonts/STICKEY.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
  touch-action: manipulation; /* Optimize touch actions */
}

body {
  font-size: 1rem; /* Default font size */
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
  overscroll-behavior: none; /* Prevent bounce effect on mobile */
}

/* Scroll container */
.scroll-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  height: 100vh;
  scroll-behavior: smooth;
  /* Hide scrollbar for different browsers */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scroll-container::-webkit-scrollbar {
  display: none;
}

/* Panel styles */
.panel {
  min-width: 100vw;
  height: 100vh;
  display: flex; /* Maintain flexbox for horizontal layout */
  justify-content: center; /* Center the content horizontally */
  align-items: center; /* Center the content vertically */
  padding: 20px; /* Reduced padding */
  scroll-snap-align: start;
  flex-direction: column; /* Stack content vertically on mobile */
  gap: 20px;
}

.panel1 {
  background: #2C3E50; /* Dark blue slate */
  position: relative;
  overflow: hidden;
}

.panel2 {
  background: #16A085; /* Green blue */
  position: relative;
}

.panel3 {
  background: #E67E22; /* Carrot orange */
  position: relative;
}

.panel4 {
  background: #34495E; /* Wet asphalt */
  position: relative;
}

.panel5 {
  background: #2980B9; /* Belize hole blue */
  position: relative;
}

.panel6 {
  background: #8E44AD; /* Wisteria purple */
  position: relative;
}

.panel7 {
  background: #2471A3; /* Steel blue */
  position: relative;
}

.panel8 {
  background: #6C3483; /* Deep purple */
  position: relative;
}

.panel9 {
  background: #27AE60; /* Nephritis green */
  position: relative;
}

.panel10 {
  background: #145A32; /* Dark green */
  position: relative;
}

.panel11 {
  background: #1A5276; /* Midnight blue */
  position: relative;
}

.panel12 {
  background: #633974; /* Royal purple */
  position: relative;
}

.panel13 {
  background: #1B4F72; /* Dark blue */
  position: relative;
}

/* Add subtle pattern overlay to all panels */
.panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
  pointer-events: none;
}

/* Add floating animation to pattern */
@keyframes subtleFloat {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 20px;
  }
}

/* Add subtle vignette effect */
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

/* Optional: Add animated gradient background for specific panels */
.panel1::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  animation: shimmerEffect 10s infinite linear;
  pointer-events: none;
}

@keyframes shimmerEffect {
  0% {
    transform: rotate(45deg) translateY(0%);
  }
  100% {
    transform: rotate(45deg) translateY(100%);
  }
}

/* Ensure content stays above background effects */
.text-container, .image-container {
  position: relative;
  z-index: 1;
}

/* Optimize for mobile performance */
@media (max-width: 768px) {
  .panel::after {
    background-size: 15px 15px; /* Smaller pattern for mobile */
  }
  
  /* Disable some animations on mobile for better performance */
  .panel1::before {
    animation: none;
  }
}

/* Text styling with improved contrast and readability */
h1, p {
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  user-select: none; /* Prevent text selection */
  pointer-events: none; /* Disable clicking or interactions */
}

/* Text container base styles */
.text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
    margin: 0;
}

/* Mobile-first text styles */
h1 {
    font-family: KOMIKAX, sans-serif;
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    letter-spacing: 1px;
    text-align: center;
    margin: 0;
    margin-bottom: 15px;
}

p {
    font-family: STICKEY, sans-serif; 
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    letter-spacing: 1.5px;
    text-align: justify;
    line-height: 1.4;
    margin: 0;
    padding: 0 5px;
}

/* Desktop overrides */
@media (min-width: 768px) {
    /* General panel layout for desktop */
    .panel {
        flex-direction: column !important;
        padding: 40px;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }

    .text-container {
        max-width: 80%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .image-container {
        max-width: 500px;
        margin: 20px 0;
    }

    h1 {
        text-align: center;
        margin-bottom: 20px;
    }

    p {
        text-align: center;
        max-width: 800px;
    }
}

/* Large desktop screens */
@media (min-width: 1200px) {
    .panel {
        padding: 60px;
        gap: 60px;
    }

    h1 {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }

    p {
        font-size: 1.2rem;
    }
}

/* Image container */
.image-container {
  position: relative;
  width: 100%;
  max-width: 500px; /* Default image size for desktop */
  height: auto;
  width: 90%;
  max-width: 350px; /* Limit image size on mobile */
  margin: 0 auto;
}

.image-container img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

/* Media queries */

/* Adjustments for mobile devices */
@media (max-width: 768px) {
  .panel {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .text-container {
    max-width: 90%;
    text-align: justify;
    margin-bottom: 20px;
  }

  .image-container {
    width: 90%;
    max-width: 600px; /* Increase image size for mobile slightly */
  }

  .image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
  }
  h1 {
    text-align: center;
  }
  .h1slide {
    text-align: center; 
    white-space: nowrap;
    font-size: clamp(1.5rem, 5vw + 0.5rem, 2.5rem); 
  }
  p {
    margin: 5px;
  }
}

/* Enlarge text and images on desktop screens (1920px and above) */
@media (min-width: 1920px) {
  body {
    font-size: 1.5rem; /* Increase base font size for desktop */
  }

  h1 {
    font-size: clamp(3rem, 6vw + 1rem, 5rem); /* Larger heading sizes */
  }

  p {
    font-size: 1.25rem; /* Larger paragraph size */
  }

  .image-container {
    max-width: 800px; /* Larger image size for desktop */
  }
}

.button {
  appearance: button;
  background-color: #1CB0F6;
  border: solid transparent;
  border-radius: 16px;
  border-width: 0 0 4px;
  box-sizing: border-box;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-block;
  font-family: STICKEY,sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .8px;
  line-height: 20px;
  margin: 4px;
  outline: none;
  overflow: visible;
  padding: 13px 16px;
  text-align: center;
  text-transform: uppercase;
  touch-action: manipulation;
  transform: translateZ(0);
  transition: filter .2s;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
  white-space: nowrap;
  width: 100%;
}

.button:after {
  background-clip: padding-box;
  background-color: #1CB0F6;
  border: solid transparent;
  border-radius: 16px;
  border-width: 0 0 4px;
  bottom: -4px;
  content: "";
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: -1;
}

.button,
.button:focus {
  user-select: auto;
}

.button:hover:not(:disabled) {
  filter: brightness(1.1);
  -webkit-filter: brightness(1.1);
}

.button:disabled {
  cursor: auto;
}

.button:active {
  border-width: 4px 0 0;
  background: none;
}

.progress-container {
    position: fixed;
    top: 10px; /* Moved closer to top edge */
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 12px;
}

.progress-bars {
    display: flex;
    gap: 3px;
    width: 100%;
    max-width: 400px; /* Smaller max-width for mobile */
    margin: 0 auto;
}

.progress-bar {
    height: 3px; /* Slightly thicker for better visibility */
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Button styling for mobile */
.button-container {
    width: 100%;
    padding: 0 20px;
    margin-top: 20px;
}

.button {
    width: 100%;
    min-height: 44px; /* Minimum touch target size */
    padding: 12px 20px;
    margin: 8px 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    background-color: #1CB0F6;
    color: white;
    border: none;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Swipe instruction styling */
.first-slide-only {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    animation: fadeInOut 2s infinite;
    text-align: center;
    width: 100%;
    z-index: 1000;
}

/* Remove the swipe class from other slides if it exists */
.swipe:not(.first-slide-only) {
    display: none;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Loading state for images */
.image-container.loading {
    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; }
}

/* Prevent text selection */
* {
    user-select: none;
}

.highlight {
  padding: 2px 4px;
  border-radius: 4px;
  color: #FFD700;
}
/* Desktop overrides - only apply these for larger screens */
@media (min-width: 768px) {
    .panel {
        flex-direction: row;
        padding: 40px;
    }

    .text-container {
        max-width: 50%;
    }

    .image-container {
        max-width: 500px;
    }

    .button-container {
        padding: 0 40px;
    }
}

/* Button container styling */
.button-container {
    width: 100%;
    padding: 0 20px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .panel12 {
        /* Adjust the panel to use flex column for desktop */
        flex-direction: column !important;
        justify-content: center;
        align-items: center;
    }

    .panel12 .text-container {
        max-width: 80%;
        text-align: center;
    }

    .panel12 .image-container {
        max-width: 500px;
        margin: 20px 0;
    }

    .panel12 .button-container {
        max-width: 500px;
        margin-top: 20px;
    }
}