/* Основной контейнер */
.custom-section-stories {
    display: flex;
    justify-content: flex-start; /* Выровняли влево */
    overflow: hidden;
    gap: 10px;
    padding: 10px;
    position: relative;
}

.custom-stories-wrapper {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: nowrap;  
    overflow-x: auto;
    padding: 0;
    scroll-snap-type: x mandatory;
    overflow: visible; 
    scroll-behavior: smooth;  
    -webkit-overflow-scrolling: touch; 
}
.custom-story-group-wrapper {
    display: none; /* Скрытые элементы по умолчанию */
}

.custom-story-group-wrapper[style*="block"] {
    display: block; /* Видимые элементы */
}
/* Скрытие полосы прокрутки */
.custom-stories-wrapper::-webkit-scrollbar {
    height: 8px;
    background-color: #f3f3f3;
}

.custom-stories-wrapper::-webkit-scrollbar-thumb {
    background-color: #2b5cfd;
    border-radius: 10px;
}

/* Группы сториз */
.custom-story-group {
    position: relative;
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    border: 2px solid #6d8df5;
    border-radius: 14px;
    overflow: visible;
    scroll-snap-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);  
}

.custom-story-group:hover {
    transform: scale(1.05);
    z-index: 2;
}

/* Картинка */
.custom-story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Название */
.custom-story-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 5px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 14px;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
}

/* Модальное окно */
.custom-story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Активное состояние модального окна */
.custom-story-modal.active {
    display: flex;
}

/* Заблюренный фон */
.custom-story-modal-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: blur(10px);
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* Контент модального окна */
.custom-story-modal-content {
    z-index: 9999;
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #fff;
}

/* Кнопка выхода */
.custom-story-modal-exit {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    border: 2px solid #2b5cfd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.3s ease, transform 0.3s ease;
}

.custom-story-modal-exit:hover {
    background: #2b5cfd;
    color: white;
    transform: scale(1.1);
}

/* Кнопки навигации */
.custom-story-prev,
.custom-story-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.custom-story-prev:hover,
.custom-story-next:hover {
    background: #2b5cfd;
    color: white; 
}

.custom-story-prev {
    left: 10px;
}

.custom-story-next {
    right: 10px;
}
/* Картинка в модальном окне */
.custom-story-modal-image {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Индикатор сториз */
.custom-story-indicator-wrapper {
    display: flex;
    width: 100%;
    margin: 10px 0;
}


.custom-story-indicators {
    display: flex;
    width: 100%;
    height: 5px;
    gap: 5px;
}

.custom-story-indicator {
    flex: 1;
    height: 100%;
    background: #ddd;
    position: relative;
}

.custom-story-indicator.active {
    background: #2b5cfd;
}

/* Футер */
.custom-story-details {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    padding: 10px 0;
}

.story-link {
    color: #2b5cfd;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.story-link:hover {
    text-decoration: underline;
}
