/* Instagram-Style Story Viewer Modal */

.story-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 4, 6, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.story-modal.active {
  opacity: 1;
  visibility: visible;
}

.story-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 90vh;
  max-height: 840px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(229, 195, 120, 0.2);
  border: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
}

/* Progress Bars */
.story-progress-bar-group {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 5px;
  z-index: 50;
}

.story-progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: white;
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
}

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

/* Story Header */
.story-header {
  position: absolute;
  top: 26px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
}

.story-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.story-author-img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--gold-primary);
}

.story-timestamp {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.story-close-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.story-close-btn:hover {
  transform: scale(1.15);
  background: rgba(229, 195, 120, 0.3);
}

/* Story Media Stage */
.story-media-stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #0A0A0E;
}

.story-slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tap Zones */
.story-tap-zone-left {
  position: absolute;
  top: 60px;
  left: 0;
  width: 35%;
  height: calc(100% - 140px);
  z-index: 30;
  cursor: pointer;
}

.story-tap-zone-right {
  position: absolute;
  top: 60px;
  right: 0;
  width: 65%;
  height: calc(100% - 140px);
  z-index: 30;
  cursor: pointer;
}

/* Story Caption & Footer */
.story-caption-box {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.8rem 1.4rem 1.4rem 1.4rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  color: white;
  z-index: 40;
  pointer-events: none;
}

.story-caption-text {
  font-size: 0.95rem;
  line-height: 1.45;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 8, 0.92);
  backdrop-filter: blur(20px);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-height: 75vh;
  width: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
}

.lightbox-caption {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
}
