.ps-stories-container {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px;
}

.ps-stories-container::-webkit-scrollbar {
  display: none;
}

/* Conteneur parent pour l'effet de flou sur mobile */
@media (max-width: 768px) {
  .ps-stories-wrapper {
    position: relative;
    overflow: hidden;
  }

  .ps-stories-container {
    position: relative;
    padding: 12px 0 0 0;
  }

  /* Flou uniquement si le conteneur est scrollable (.is-scrollable ajouté par JS) */
  .ps-stories-wrapper.is-scrollable::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0.8), transparent);
    z-index: 1;
    pointer-events: none;
  }

  .ps-stories-wrapper.is-scrollable::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0.8), transparent);
    z-index: 1;
    pointer-events: none;
  }
}

.story-item {
  position: relative;
  min-width: 100px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ps-stories-container .story-item:first-child .story-thumbnail {
  animation: pulse 2s ease-in-out 3; /* Animation répétée 3 fois */
}

.story-thumbnail {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  padding: 3px;
  background: #ff6444;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1); /* Taille initiale */
  }
  50% {
    transform: scale(1.1); /* Agrandissement */
  }
}

.story-thumbnail img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.stories-modal .story-title {
  color: #fff !important;
}
.story-title {
  text-align: center;
  font-weight: 700;
  margin-top: 5px;
  max-width: 100px;
}

/* Modal styles */
.stories-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 42424245;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stories-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-view {
  position: relative;
  /*width: 95%;*/
  max-width: 400px;
  height: 100vh;
  max-height: 700px;
  margin: 20px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  z-index: 465416665;
}

.story-media-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-sound-wrapper {
  position: absolute;
  top: 20px;
  right: 65px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.story-sound-control {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
}

.story-sound-control svg {
  width: 16px;
  height: 16px;
}

/* Popup slider de volume vertical */
.story-volume-popup {
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 20px;
  padding: 10px 8px;
  gap: 4px;
}

.story-volume-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 80px;
  cursor: pointer;
  accent-color: #fff;
  background: transparent;
}
.story-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  z-index: 2;
}

.story-progress-bar {
  height: 100%;
  background: white;
  width: 0;
  transition: width 0.1s linear;
}

.story-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}

.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(63 60 60 / 30%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 24px;
  z-index: 10;
  transition: all 0.3s ease;
}

.story-nav:hover {
  background: rgba(255, 255, 255, 0.5);
}

.story-prev {
  left: 10px;
}

.story-next {
  right: 10px;
}

.story-info {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 20px;
}

.story-info img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

/* Keyboard navigation overlay */
.story-nav-overlay {
  position: absolute;
  top: 0;
  width: 10%;
  height: 100%;
  z-index: 5;
  cursor: pointer;
}

.story-nav-overlay.left {
  left: 0;
}

.story-nav-overlay.right {
  right: 0;
}

/* Mobile specific styles */
@media (max-width: 768px) {
  .story-view {
    margin: 0;
    height: 90vh;
    max-height: none;
    border-radius: 0;
    max-width: none;
  }

  .stories-modal-content {
    padding: 0;
  }

  /* Masquer les boutons précédent/suivant sur mobile (navigation par swipe) */
  .story-nav,
  .story-nav-overlay {
    display: none !important;
  }
}
/* Animation du CTA */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.story-cta {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 15;
  text-align: center;
  animation: slideUp 0.5s ease-out forwards;
}

.story-cta-button {
  background: #6c2e1b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: slideUp 2s ease-out 0.2s forwards;
}

.story-cta-button:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  color: #000000;
}
.story-pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: white;
  cursor: pointer;
}

.story-pause-indicator svg {
  width: 36px;
  height: 36px;
}

/* Barre de progression/seek vidéo */
.story-seek-bar-container {
  position: absolute;
  bottom: 12px;        /* légèrement relevée */
  left: 0;
  right: 0;
  padding: 18px 16px 10px;  /* zone tactile plus haute */
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  z-index: 15;
}

/* Bulle de temps au-dessus du thumb */
.story-seek-tooltip {
  position: absolute;
  bottom: calc(100% - 14px); /* au-dessus de la piste */
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
/* Flèche vers le bas de la bulle */
.story-seek-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.78);
}

.story-seek-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.35);
  outline: none;
  cursor: pointer;
  display: block;
  transition: height 0.18s ease, border-radius 0.18s ease;
}

/* Expansion de la piste quand on scrub */
.story-seek-bar-container.is-seeking .story-seek-bar {
  height: 8px;
  border-radius: 4px;
}

.story-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 3px rgba(0,0,0,0.4);
  transition: width 0.18s ease, height 0.18s ease;
}

/* Thumb agrandi pendant le scrub */
.story-seek-bar-container.is-seeking .story-seek-bar::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.25), 0 0 6px rgba(0,0,0,0.5);
}

.story-seek-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 3px rgba(0,0,0,0.4);
  transition: width 0.18s ease, height 0.18s ease;
}

.story-seek-bar-container.is-seeking .story-seek-bar::-moz-range-thumb {
  width: 22px;
  height: 22px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.25), 0 0 6px rgba(0,0,0,0.5);
}

/* Thumb plus grand sur mobile pour faciliter le toucher */
@media (max-width: 768px) {
  .story-seek-bar-container {
    padding: 22px 16px 12px; /* zone tactile plus généreuse */
  }

  .story-seek-bar {
    height: 5px;
  }

  .story-seek-bar::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2), 0 0 4px rgba(0,0,0,0.5);
  }

  .story-seek-bar-container.is-seeking .story-seek-bar::-webkit-slider-thumb {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.25), 0 0 8px rgba(0,0,0,0.5);
  }

  .story-seek-bar::-moz-range-thumb {
    width: 26px;
    height: 26px;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2), 0 0 4px rgba(0,0,0,0.5);
  }

  .story-seek-bar-container.is-seeking .story-seek-bar::-moz-range-thumb {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.25), 0 0 8px rgba(0,0,0,0.5);
  }
}

.story-seek-bar::-webkit-slider-runnable-track {
  border-radius: 2px;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.9) 0%,
    rgba(255,255,255,0.9) var(--seek-progress, 0%),
    rgba(255,255,255,0.35) var(--seek-progress, 0%),
    rgba(255,255,255,0.35) 100%
  );
}
