/**
 * Stories Widget & Fullscreen Viewer Styles
 * Instagram-like stories carousel and modal player
 */

.stories-tray-scroll {
  overflow-x: auto;
  padding: 6px 2px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.stories-tray-scroll::-webkit-scrollbar {
  display: none;
}

.stories-tray {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.story-bubble-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 82px;
  flex-shrink: 0;
  outline: none;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.story-bubble-btn:hover {
  transform: translateY(-2px) scale(1.04);
}

.story-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.25);
}

.story-avatar-wrap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  overflow: hidden;
  background: #e2e8f0;
  position: relative;
}

.story-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-video-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
}

.story-title-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Stories Modal Viewer Styles */
.stories-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  background: rgba(10, 15, 26, 0.88);
  padding: 16px;
}

.stories-modal-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.stories-player-frame {
  position: relative;
  z-index: 10;
  width: 420px;
  max-width: 100%;
  height: 740px;
  max-height: 94vh;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  user-select: none;
}

@media (max-width: 640px) {
  .stories-modal-overlay {
    padding: 0;
  }
  .stories-player-frame {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

.stories-progress-bars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  padding: 12px 14px 6px;
}

.story-prog-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
}

.story-prog-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 2px;
  transition: width 0.05s linear;
}

.stories-top-header {
  position: absolute;
  top: 22px;
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stories-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stories-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
}

.stories-header-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  display: block;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.stories-header-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  display: block;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.stories-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-ctrl-btn {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}

.story-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.stories-media-canvas {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-tap-prev {
  position: absolute;
  top: 70px;
  left: 0;
  bottom: 120px;
  width: 30%;
  z-index: 25;
  cursor: pointer;
}

.story-tap-next {
  position: absolute;
  top: 70px;
  right: 0;
  bottom: 120px;
  width: 70%;
  z-index: 25;
  cursor: pointer;
}

.stories-bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  padding: 30px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-caption-text {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.story-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue, #2563eb);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transition: all 0.15s;
}

.story-cta-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

