* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  overflow: hidden;
  background: #000;
  color: white;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.app-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
}

/* Reels Container - 9:16 Aspect Ratio */
.reels-container {
  width: calc(100vh * 9 / 16);
  height: 100vh;
  position: relative;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Use dvh for better mobile support */
@supports (height: 100dvh) {
  .reels-container {
    width: calc(100dvh * 9 / 16);
    height: 100dvh;
  }
}

/* For very narrow screens (narrower than 9:16) */
@media (max-aspect-ratio: 9/16) {
  .reels-container {
    width: 100vw;
    height: calc(100vw * 16 / 9);
    max-height: 100vh;
  }

  @supports (height: 100dvh) {
    .reels-container {
      width: 100vw;
      height: calc(100vw * 16 / 9);
      max-height: 100dvh;
    }
  }
}

.reels-container::-webkit-scrollbar {
  display: none;
}

/* Individual Reel */
.reel {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 30px 100px;
  scroll-snap-stop: always;
}

.reel-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.3s ease-in;
  padding: 0 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.verse-reference {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 30px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.verse-text {
  font-size: 28px;
  line-height: 1.6;
  font-weight: 400;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Progress Bars */
.progress-bars {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vh * 9 / 16);
  display: flex;
  gap: 4px;
  padding: 0 20px;
  z-index: 101;
  pointer-events: none;
}

@supports (height: 100dvh) {
  .progress-bars {
    width: calc(100dvh * 9 / 16);
  }
}

@media (max-aspect-ratio: 9/16) {
  .progress-bars {
    width: 100vw;
    left: 0;
    transform: none;
  }
}

.progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: white;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar.active .progress-fill {
  width: 100%;
}

.progress-bar.viewed .progress-fill {
  width: 100%;
}

/* Navigation Hints */
.nav-hint {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vh * 9 / 16);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  z-index: 99;
  pointer-events: none;
  opacity: 0.7;
  animation: pulse 2s infinite;
}

@supports (height: 100dvh) {
  .nav-hint {
    width: calc(100dvh * 9 / 16);
  }
}

@media (max-aspect-ratio: 9/16) {
  .nav-hint {
    width: 100vw;
    left: 0;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

.swipe-hint,
.tap-hint {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
}

/* Reel Counter */
.reel-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  z-index: 100;
  pointer-events: none;
}

/* Reel counter stays centered regardless of screen size */

/* Touch Zones for Navigation */
.touch-zone {
  position: absolute;
  top: 60px;
  width: 50%;
  height: calc(100% - 60px);
  z-index: 10;
  cursor: pointer;
}

.touch-zone.left {
  left: 0;
}

.touch-zone.right {
  right: 0;
}

/* Responsive Design */

/* Adjust font sizes based on container width */
@media (max-width: 500px) {
  .verse-text {
    font-size: 20px;
  }

  .verse-reference {
    font-size: 15px;
  }

  .header h1 {
    font-size: 18px;
  }

  .header-icon {
    font-size: 22px;
  }
}

@media (max-width: 400px) {
  .verse-text {
    font-size: 18px;
  }

  .verse-reference {
    font-size: 14px;
  }

  .header h1 {
    font-size: 16px;
  }

  .header-icon {
    font-size: 20px;
  }

  .header {
    height: 50px;
  }

  .progress-bars {
    top: 60px;
  }

  .reel {
    padding: 70px 20px 85px;
  }
}

/* Very tall screens - increase font sizes */
@media (min-height: 900px) {
  .verse-text {
    font-size: 32px;
  }

  .verse-reference {
    font-size: 20px;
  }
}

/* Hide hints after first interaction */
.nav-hint.hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
}
