.trigger-btn.loading {
  display: block;
  pointer-events: none;
  opacity: 0.7;
}

.story-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.story-container {
  position: relative;
  width: 375px;
  height: 667px;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  animation: slideUp 0.4s ease-out;
}

.story-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.progress-bars {
  display: flex;
  gap: 4px;
  flex: 1;
  margin-right: 16px;
}

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

.progress-fill {
  height: 100%;
  background-color: white;
  border-radius: 1px;
  width: 0%;
  transition: width 0.1s ease;
}

.progress-fill.completed {
  width: 100%;
}

.progress-fill.active {
  animation: progressAnimation var(--duration) linear forwards;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.story-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  transition: all 0.3s ease;
}

.story-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.video-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Clean text container without any backgrounds */
.story-text-container {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Clean text styling with strong shadows for readability */
.story-text {
  position: relative;
  z-index: 2;
  color: white;
  font-family: Mont, Verdana, sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  max-width: calc(100% - 40px);
  text-shadow:
      0 2px 4px rgba(0, 0, 0, 0.9),
      0 4px 8px rgba(0, 0, 0, 0.7),
      0 1px 0px rgba(0, 0, 0, 1),
      1px 0 0px rgba(0, 0, 0, 1),
      -1px 0 0px rgba(0, 0, 0, 1),
      0 -1px 0px rgba(0, 0, 0, 1);
  transition: all 0.3s ease;
}

.navigation-area {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 5;
  cursor: pointer;
}

.nav-previous {
  left: 0;
}

.nav-next {
  right: 0;
}

.video-controls {
  position: absolute;
  bottom: 120px;
  right: 20px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.video-control-btn:hover {
  background: rgba(240, 103, 36, 0.8);
  border-color: rgba(240, 103, 36, 0.5);
  transform: scale(1.1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes progressAnimation {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .story-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .story-text {
    font-size: 18px;
    padding: 14px 18px 0;
  }

  .story-text-container {
    padding: 16px;
  }

  .video-controls {
    bottom: 100px;
  }
}

.story-overlay.active {
  display: flex;
}

/* Text length adjustments */
.story-text.long-text {
  font-size: 18px;
  line-height: 1.4;
  padding: 18px 22px 0;
}

.story-text.short-text {
  padding: 14px 18px 0;
}

/* Enhanced text shadows for better readability on various backgrounds */
.story-text.enhanced-shadow {
  text-shadow:
      0 2px 4px rgba(0, 0, 0, 0.95),
      0 4px 8px rgba(0, 0, 0, 0.8),
      0 6px 12px rgba(0, 0, 0, 0.6),
      0 1px 0px rgba(0, 0, 0, 1),
      1px 0 0px rgba(0, 0, 0, 1),
      2px 0 0px rgba(0, 0, 0, 1),
      -1px 0 0px rgba(0, 0, 0, 1),
      -2px 0 0px rgba(0, 0, 0, 1),
      0 -1px 0px rgba(0, 0, 0, 1),
      0 -2px 0px rgba(0, 0, 0, 1);
}

/* Responsive text sizing */
@media (max-width: 320px) {
  .story-text {
    font-size: 14px;
    padding: 12px 16px 0;
  }

  .story-text.long-text {
    font-size: 14px;
  }

  .story-text.short-text {
    font-size: 24px;
  }
}
