/* Основные стили для контейнера сторис */
.story-container {
   display: -webkit-box;
    overflow-x: hidden;
    padding: 21px 7px 0px 7px;
    gap: 13px;
    position: relative;
}

.story-img {
   position: relative;
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    background: linear-gradient(90deg, #000000, #ff00ff, #000000, #000000);
}

/* Стилизация полосы прокрутки для WebKit (Chrome, Safari) */
.story-container::-webkit-scrollbar {
   width: 0;
   background: transparent
}

.story {
   position: relative;
   flex: 0 0 auto;
   width: 100px;
   height: auto;
}

.story:hover {
   transform: scale(1.05);
   /* Анимация при наведении */
   transition: transform 0.2s ease;
}

.story.active::before {
   opacity: 1;
   /* Показываем градиент для активной истории */
}

.story img {
   position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    border-radius: 0%;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 0px solid #fff;
}

.story-info {
   text-align: center;
   white-space: nowrap;
   max-width: 102px !important;
   width: 100%;
   text-overflow: ellipsis;
   overflow: hidden;
}

.story-img:hover {
   background: none;
   transition: all 0.2s ease;
}

.story-username {
   color: #888888;
   font-size: 11px;
   font-weight: bold;
  display: none;
}

.story-hits {
   color: #000;
   font-size: 10px;
  display: none;
}

/* Кнопка "Добавить сторис" */
.add-story {
flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px dashed #000;
  display: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.add-story:hover {
   background: #e0e0e0;
   transform: scale(1.05);
   /* Анимация при наведении */
}

.add-story span {
   font-size: 13px;
   color: #999;
   transition: color 0.2s ease;
}

.add-story:hover span {
   color: #666;
   /* Изменение цвета плюса при наведении */
}

/* Кнопки листания */
.scroll-btn {
    position: absolute;
    top: 63%;
    background: rgb(0 0 0 / 0%);
    color: #fff;
    border: none;
    padding: 6px;
    cursor: pointer;
    z-index: 10;
  display: none;
}

.scroll-btn.left {
   left: 0;
}

.scroll-btn.right {
   right: 0;
}

/* Стили для полноэкранного режима */
.fullscreen-story {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.9);
   justify-content: center;
   align-items: center;
   z-index: 1000;
}

.fullscreen-content {
   text-align: center;
   color: #fff;
   max-width: 90%;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 20px;
}

.fullscreen-content img {
   max-width: 100%;
   max-height: 60vh;
   border-radius: 10px;
   opacity: 0;
   transition: opacity 0.5s ease, transform 0.5s ease;
   transform: scale(0.9);
}

.fullscreen-content img.active {
   opacity: 1;
   transform: scale(1);
}

.fullscreen-content h2 {
   font-size: 24px;
   margin: 0;
  color: #ffffff;
}

.fullscreen-content p {
   font-size: 16px;
   margin: 0;
  display: none;
}

.close-btn {
   position: absolute;
   top: 20px;
   right: 20px;
   color: #fff;
   font-size: 24px;
   cursor: pointer;
   transition: opacity 0.3s ease;
}

.close-btn:hover {
   opacity: 0.8;
}

.read-more-btn {
   background-image: linear-gradient(#851085, #af17af);
   color: #fff;
   padding: 3px 7px 3px 7px;
   border-radius: 3px;
   text-decoration: none;
   font-size: 13px;
   opacity: 0;
   transition: opacity 0.5s ease;
}

.read-more-btn:hover {
   text-decoration: none;
   color: #fff;
   font-weight: 600;
}

.read-more-btn.active {
   opacity: 1;
}

.nav-btn {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   background: rgba(0, 0, 0, 0.5);
   color: #fff;
   border: none;
   padding: 10px;
   cursor: pointer;
   z-index: 10;
   transition: opacity 0.3s ease;
   opacity: 0;
   /* Начальная прозрачность */
}

.fullscreen-story:hover .nav-btn {
   opacity: 1;
   /* Показываем кнопки при наведении */
}

.nav-btn.left {
   left: 20px;
}

.nav-btn.right {
   right: 20px;
}

/* Прогресс-бар для историй */
.progress-container {
   position: absolute;
   top: 20px;
   left: 20px;
   right: 20px;
   display: flex;
   gap: 5px;
}

.progress-bar {
   flex: 1;
   height: 3px;
   background: rgba(255, 255, 255, 0.3);
   overflow: hidden;
}

.progress-bar .progress {
   height: 100%;
   width: 0;
   background: #fff;
   transition: width 5s linear;
   /* Плавное заполнение за 5 секунд */
}

/* Блок статистики просмотров */
.stats-container {
   position: absolute;
   top: 35px;
   left: 20px;
   color: #fff;
   font-size: 14px;
   background: #000;
   padding: 8px 12px;
   border-radius: 8px;
   opacity: 0;
   transition: opacity 0.5s ease;
}

.stats-container.active {
   opacity: 1;
}

/* Адаптивность */
@media (max-width: 776px) {
   .story-img {
      width: 100px;
      height: 100px;
   }

   .story,
   .add-story {
      width: 100px;
      height: 100px;
   }

   .story-container {
      align-items: flex-start;
   }

   #storyContainer {}

   .add-story {
      max-height: 60px;
   }

   .story {
      height: auto !important;
   }

   .story-img img {
      width: 100%;
      height: 100%;
   }

   .story-username {
      font-size: 10px;
    display: none;
   }

   .story-hits {
      font-size: 10px;
    display: none;
   }

   .add-story span {
      font-size: 13px;
   }

   .fullscreen-content h2 {
      font-size: 20px;
   }

   .fullscreen-content p {
      font-size: 14px;
    display: none;
   }

   .read-more-btn {
      font-size: 14px;
      padding: 8px 16px;
   }
}