/* Основные стили для контейнера сторис */
.story-container {
   display: flex;
   align-items: flex-start;
   overflow-x: auto;
   padding: 10px;
   gap: 10px;
   position: relative;
   -webkit-overflow-scrolling: touch;
   overflow-scrolling: touch;
}

.story-img {
   display: block transition: all 0.2s ease;
   position: relative;
   flex: 0 0 auto;
   width: 80px;
   height: 80px;
   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: -webkit-linear-gradient(90deg, #5ab3e2, #005e98, #0058bd, #02d2cd);
   background: linear-gradient(90deg, #5ab3e2, #005e98, #0058bd, #02d2cd);
}

/* Стилизация полосы прокрутки для WebKit (Chrome, Safari) */
.story-container::-webkit-scrollbar {
   width: 0;
   background: transparent
}

.story {
   position: relative;
   flex: 0 0 auto;
   width: 80px;
   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: 50%;
   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: 2px 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;
}

.story-hits {
   color: #88888866;
   font-size: 10px;
}

/* Кнопка "Добавить сторис" */
.add-story {
   flex: 0 0 auto;
   width: 80px;
   height: 80px;
   border-radius: 50%;
   background: #f0f0f0;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   border: 2px dashed #ccc;
   transition: background 0.2s ease, transform 0.2s ease;
}

.add-story:hover {
   background: #e0e0e0;
   transform: scale(1.05);
   /* Анимация при наведении */
}

.add-story span {
   font-size: 24px;
   color: #999;
   transition: color 0.2s ease;
}

.add-story:hover span {
   color: #666;
   /* Изменение цвета плюса при наведении */
}

/* Кнопки листания */
.scroll-btn {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   background: rgb(56 103 214);
   color: #fff;
   border: none;
   padding: 10px;
   cursor: pointer;
   z-index: 10;
}

.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;
}

.fullscreen-content p {
   font-size: 16px;
   margin: 0;
}

.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: #007bff;
   color: #fff;
   padding: 10px 20px;
   border-radius: 5px;
   text-decoration: none;
   font-size: 16px;
   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: 60px;
      height: 60px;
   }

   .story,
   .add-story {
      width: 60px;
      height: 60px;
   }

   .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;
   }

   .story-hits {
      font-size: 8px;
   }

   .add-story span {
      font-size: 20px;
   }

   .fullscreen-content h2 {
      font-size: 20px;
   }

   .fullscreen-content p {
      font-size: 14px;
   }

   .read-more-btn {
      font-size: 14px;
      padding: 8px 16px;
   }
}