/* Stories Banner Frontend Styles */

/* Import button settings */
@import url('button-settings.css');

/* Wrapper for the entire stories section */
.stories-groups-wrapper {
    position: relative;
    width: 100%;
}

/* Stories Groups */
.stories-groups-wrapper {
    margin: 0px 0;
    padding: 0px;
}

.stories-groups-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.stories-groups-container::-webkit-scrollbar {
    height: 6px;
}

.stories-groups-container::-webkit-scrollbar-track {
    background: transparent;
}

.stories-groups-container::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 3px;
}

/* Facebook Stories-like Groups Display */
.stories-groups-container {
    display: flex;
    gap: 15px;
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    justify-content: flex-start;
    background: #f5f5f5;
}

.stories-groups-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Pagination dots - hidden by default (desktop) */
.stories-pagination {
    display: none;
}

.stories-group-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    background: #e0e0e0;
    border-radius: 12px;
    padding: 0;
    position: relative;
    height: 350px;
    box-shadow: 0px 0px 7px rgba(201, 127, 15, 0.44);
    overflow: hidden;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: local;
}

.stories-group-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stories-group-avatar {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 3;
    flex-shrink: 0;
}

.stories-group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.stories-group-initials {
    font-size: 10px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
}

.stories-group-name {
    position: absolute;
    top: 8px;
    left: 48px;
    right: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 3;
    padding: 2px 6px;
    border-radius: 4px;
    text-shadow: none;
}

.stories-group-preview {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    font-size: 9px;
    color: #666;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 6px;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: white;
    background: #000000b8;
}

.stories-group-counter {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.9);
    color: #333;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Responsive design for different screen sizes */
@media (min-width: 1200px) {
    /* Desktop: Show exactly 8 groups */
    .stories-groups-container {
        justify-content: center;
        overflow-x: visible;
        padding: 20px;
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .stories-group-item {
        width: 196px; /* 9:16 aspect ratio for 350px height */
        height: 350px;
        margin-right: 0;
        flex-shrink: 0;
    }
    
    .stories-group-avatar {
        width: 32px;
        height: 32px;
        top: 15px;
        left: 15px;
    }
    
    .stories-group-name {
        top: 15px;
        left: 55px;
        right: 15px;
        font-size: 11px;
        height: 32px;
        text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff, 1px 1px 0 #ffffff;
    }
    
    .stories-group-preview {
        font-size: 9px;
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 4px 6px;
        color: white;
        background: #000000b8;
    }
    
    .stories-group-item:nth-child(n+9) {
        display: none; /* Hide groups beyond 8 on desktop */
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    /* Tablet: Show 6 groups */
    .stories-groups-container {
        justify-content: center;
        padding: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .stories-group-item {
        width: 168px; /* 9:16 aspect ratio for 300px height */
        height: 300px;
        margin-right: 0;
        flex-shrink: 0;
    }
    
    .stories-group-avatar {
        width: 28px;
        height: 28px;
        top: 12px;
        left: 12px;
    }
    
    .stories-group-name {
        top: 12px;
        left: 48px;
        right: 12px;
        font-size: 10px;
        height: 28px;
        text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff, 1px 1px 0 #ffffff;
    }
    
    .stories-group-preview {
        font-size: 8px;
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: 3px 5px;
        color: white;
        background: #000000b8;
    }
    
    .stories-group-item:nth-child(n+7) {
        display: none; /* Hide groups beyond 6 on tablet */
    }
}

@media (max-width: 768px) {
    /* Mobile: Show exactly 4 groups */
    .stories-groups-container {
        padding: 7px;
        gap: 8px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .stories-group-item {
        width: 140px; /* 9:16 aspect ratio for 250px height */
        height: 250px;
        margin-right: 0;
        flex-shrink: 0;
        padding: 10px;
    }
    
    .stories-group-avatar {
        width: 24px;
        height: 24px;
        top: 10px;
        left: 10px;
        border-width: 1px;
    }
    
    .stories-group-name {
        top: 10px;
        left: 40px;
        right: 10px;
        font-size: 9px;
        height: 24px;
        letter-spacing: 0.2px;
        text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff, 1px 1px 0 #ffffff;
    }
    
    .stories-group-initials {
        font-size: 9px;
    }
    
    .stories-group-preview {
        font-size: 8px;
        bottom: 6px;
        left: 6px;
        right: 6px;
        padding: 3px 4px;
        color: white;
        background: #000000b8;
    }
    
    /* Show pagination dots on mobile */
    .stories-pagination {
        display: flex;
        justify-content: center;
        margin-top: 15px;
        gap: 8px;
    }
    
    .stories-pagination-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ccc;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    
    .stories-pagination-dot.active {
        background: #333;
    }
}

/* Individual Banners Display */
.stories-banner-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.stories-banner-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    max-width: 300px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stories-banner-item h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.stories-banner-item img,
.stories-banner-item video {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.stories-banner-item video {
    background: #000;
    cursor: pointer;
    /* Smooth transition */
    transition: all 0.3s ease;
    /* Ensure video is properly sized */
    border-radius: 4px;
}

/* Video Cover Functionality */
.video-cover-container {
    position: relative;
    cursor: pointer;
    display: inline-block;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.video-cover-container.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.video-cover-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
    border-radius: 4px;
}

.video-cover-container:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.video-play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-cover-container:hover .video-play-button {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

/* Modal video cover styles */
.modal-video-cover {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-video-cover.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.modal-video-cover .video-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-video-cover .video-play-button {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.stories-banner-button {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.stories-banner-button:hover {
    background: #005a87;
    color: #fff;
}

/* Full-Screen Modal Styles (Instagram/Facebook Stories style) */
.stories-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.stories-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    /* Строгие пропорции stories 9:16 */
    aspect-ratio: 9/16;
    /* Фиксированные размеры для stories */
    width: 400px;
    height: 711px; /* 400 * 16/9 = 711px */
}

/* Banner display container with background image */
.stories-banner-display {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Темный фон снизу с прозрачностью */
.stories-banner-display::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Hide the actual img/video when using as background */
.stories-banner-display .stories-banner-media {
    display: none;
}

/* Кнопки лайк и шаре в нижней части */
.stories-banner-actions {
    position: absolute;
    bottom: 5px;
    right: 3%; /* Избегаем правой навигационной зоны (30%) */
    display: flex;
    flex-direction: column;
    gap: 0px;
    z-index: 1001; /* Выше навигационных зон */
}

.stories-action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stories-action-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stories-action-button.like {
    background: rgba(255, 107, 53, 0.9);
    color: white;
}

.stories-action-button.like:hover {
    background: rgba(255, 107, 53, 1);
}

.stories-action-button.share {
    background: rgba(0, 123, 186, 0.9);
    color: white;
}

.stories-action-button.share:hover {
    background: rgba(0, 123, 186, 1);
}

.stories-action-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.stories-action-icon.like {
    background-image: url('../img/like red.svg');
}

.stories-action-icon.share {
    background-image: url('../img/share.svg');
}

.stories-action-count {
    font-size: 13px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Image elements in modal */
.stories-modal-body img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #000;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-shadow: none;
    /* Строго отталкиваемся от верха и заполняем по пропорциям */
    max-width: 100%;
    max-height: 100%;
}

/* Video element styling when not used as background */
.stories-banner-display video.stories-banner-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    /* Ensure autoplay works on mobile */
    -webkit-playsinline: true;
    /* Ensure video is visible and properly sized */
    background: #000;
    /* Smooth transition from cover image */
    opacity: 0;
    animation: videoFadeIn 0.5s ease forwards;
    /* Ensure video is properly positioned */
    transform: scale(1);
    /* Ensure video is clickable */
    cursor: pointer;
    /* Ensure video is properly sized */
    border-radius: 0;
    /* Ensure video is properly positioned */
    position: absolute;
}

@keyframes videoFadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Progress bar for multiple banners with individual durations */
.stories-progress-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: rgba(201, 29, 29, 0);
    border-radius: 2px;
    z-index: 10001;
    display: flex;
    gap: 5px;
    /* Add shadow for better visibility on white backgrounds */
    /*box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);*/
}

.stories-progress-segment {
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    /* Equal width for all segments */
    flex: 1;
    min-width: 8px;
    position: relative;
    /* Add shadow for better visibility */
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}



.stories-progress-fill {
    height: 100%;
    background: #fa4b05;
    width: 0;
    transition: width 0.1s linear;
    border-radius: 2px;
    /* Add shadow for better visibility */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Disable transition when setting initial state */
.stories-progress-fill.no-transition {
    transition: none !important;
}

.stories-progress-fill.completed {
    width: 100%;
    transition: none;
    background: #fa4b05;
}

/* Header with group info */
.stories-modal-header {
    position: absolute;
    top: 25px;
    left: 15px;
    right: 15px;
    z-index: 10001;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
}

.stories-modal-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
}

.stories-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Text container for banner title and group name */
.stories-modal-text-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Banner title above group name */
.stories-banner-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px 0;
    /* Улучшенная тень для лучшей видимости на однотонных фонах */
    text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,0.8);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stories-modal-group-name {
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    margin: 0;
    opacity: 0.8;
    /* Улучшенная тень для лучшей видимости на однотонных фонах */
    text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка закрытия - использует SVG изображение */
.stories-modal-close {
    background: none !important;
    border: none !important;
    font-size: 0 !important; /* Скрываем текст */
    cursor: pointer !important;
    color: transparent !important;
    padding: 5px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    background-image: url('../img/close.svg') !important;
    background-size: 24px 24px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Hover эффект удален для кнопки закрытия */

/* =================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ И АНИМАЦИИ
   ================================= */

/* Like button с анимацией при нажатии 
.stories-like-button.liked .stories-action-count {
    color: #ff6b35 !important;
}
*/
/* Pressed состояние для like кнопки */
.stories-like-button.pressed .stories-action-icon {
    transform: scale(0.9) !important;
    transition: transform 0.1s ease !important;
}

.stories-like-button.pressed .stories-action-count {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
}

/* Специальная анимация для liked состояния */
.stories-action-icon.liked-animation {
    animation: likedPulse 0.6s ease !important;
}

/* Улучшенная анимация для like кнопки */
@keyframes likeAnimation {
    0% { 
        transform: scale(1); 
        filter: brightness(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }
    50% { 
        transform: scale(1.3); 
        filter: brightness(1.4) drop-shadow(0 4px 8px rgba(255, 0, 0, 0.6));
    }
    100% { 
        transform: scale(1); 
        filter: brightness(1.2) drop-shadow(0 3px 6px rgba(255, 0, 0, 0.4));
    }
}

/* Анимация пульсации для liked состояния */
@keyframes likedPulse {
    0% { 
        transform: scale(1);
        filter: brightness(1.2) drop-shadow(0 3px 6px rgba(255, 0, 0, 0.4));
    }
    25% { 
        transform: scale(1.2);
        filter: brightness(1.4) drop-shadow(0 4px 8px rgba(255, 0, 0, 0.6));
    }
    50% { 
        transform: scale(0.9);
        filter: brightness(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }
    75% { 
        transform: scale(1.1);
        filter: brightness(1.3) drop-shadow(0 3px 6px rgba(255, 0, 0, 0.5));
    }
    100% { 
        transform: scale(1);
        filter: brightness(1.2) drop-shadow(0 3px 6px rgba(255, 0, 0, 0.4));
    }
}

/* =================================
   НАСТРОЙКИ ЯРКОСТИ ДЛЯ БАННЕРА
   ================================= */

/* Переменные CSS для настройки яркости */
:root {
    --button-brightness: 1;
    --button-shadow-opacity: 0.3;
    --button-hover-brightness: 1.2;
    --button-hover-shadow-opacity: 0.5;
}

/* =================================
   СТИЛИ ДЛЯ БАННЕРА
   ================================= */

/* Banner content area */
.stories-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    background: #000;
}

/* Video elements in modal */
.stories-modal-body video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #000;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
    /* Строго отталкиваемся от верха и заполняем по пропорциям */
    max-width: 100%;
    max-height: 100%;
}

/* YouTube iframe elements in modal */
.stories-modal-body .youtube-video {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: #000;
    /* Строгие пропорции stories */
    aspect-ratio: 9/16;
    /* Smooth transition from cover image */
    opacity: 0;
    animation: videoFadeIn 0.5s ease forwards;
}

.stories-banner-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stories-banner-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.stories-banner-media.image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Action buttons at bottom */
.stories-modal-actions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10001;
}

/* Action кнопки - используют PNG изображения */
.stories-action-button {
    background: none !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 15px !important;
    transition: transform 0.2s ease !important;
    text-shadow: none !important;
}

.stories-action-button:hover {
    transform: scale(1.05) !important;
}

.stories-action-icon {
    width: 44px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important; /* Скрываем текст */
    filter: none !important;
    background: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    color: transparent !important;
    text-shadow: none !important;
    background-size: 24px 24px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Like кнопка - использует SVG изображения */
.stories-like-button .stories-action-icon {
    background-image: url('../img/like white.svg') !important;
}

.stories-like-button.liked .stories-action-icon {
    background-image: url('../img/like red.svg') !important;
    animation: likeAnimation 0.3s ease !important;
    filter: drop-shadow(0 3px 12px rgba(255, 107, 53, 0.4)) !important;
}

/* Share кнопка - использует SVG изображение */
.stories-share-button .stories-action-icon {
    background-image: url('../img/share.svg') !important;
}

.stories-action-count {
    font-size: 12px !important;
    font-weight: 500 !important;
    background: none !important;
    color: #fff !important;
    /* Улучшенная тень для лучшей видимости на однотонных фонах */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

/* Like button с анимацией при нажатии 
.stories-like-button.liked .stories-action-icon {
    color: #ff6b35 !important;
    animation: likeAnimation 0.3s ease !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, var(--button-hover-shadow-opacity))) !important;
}

.stories-like-button.liked .stories-action-count {
    color: #ff6b35 !important;
}
*/
/* Pressed состояние для like кнопки */
.stories-like-button.pressed .stories-action-icon {
    transform: scale(0.9) !important;
    transition: transform 0.1s ease !important;
}

.stories-like-button.pressed .stories-action-count {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
}

/* Специальная анимация для liked состояния */
.stories-action-icon.liked-animation {
    animation: likedPulse 0.6s ease !important;
}

/* Улучшенная анимация для like кнопки 
@keyframes likeAnimation {
    0% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% { 
        transform: scale(1.3); 
        box-shadow: 0 4px 16px rgba(255, 107, 53, 0.6);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}
*/
/* Анимация пульсации для liked состояния */
@keyframes likedPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    25% { 
        transform: scale(1.2);
        box-shadow: 0 4px 16px rgba(255, 107, 53, 0.5);
    }
    50% { 
        transform: scale(0.9);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    75% { 
        transform: scale(1.1);
        box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Hover эффекты для action кнопок */
.stories-action-button:hover .stories-action-icon {
    filter: brightness(var(--button-hover-brightness)) drop-shadow(0 4px 8px rgba(0, 0, 0, var(--button-hover-shadow-opacity))) !important;
    transform: translateY(-2px) !important;
}

.stories-action-button:hover .stories-action-count {
    transform: translateY(-1px) !important;
}

/* Call-to-action button */
.stories-cta-button {
    position: absolute;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-shadow: none;
}

/* Navigation click zones - 30% width on each side for invisible navigation */
.stories-nav-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 1000;
    cursor: pointer;
    /* Debug: uncomment to see zones */
    /* background: rgba(255, 0, 0, 0.1); */
}

.stories-nav-zone.left {
    left: 0;
}

.stories-nav-zone.right {
    right: 0;
}



.stories-cta-button:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Navigation arrows for multiple banners */
.stories-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stories-nav-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.stories-nav-prev {
    left: 10px;
}

.stories-nav-next {
    right: 10px;
}

/* Hide navigation on mobile for touch interaction */
@media (max-width: 768px) {
    .stories-nav-button {
        display: none;
    }
    
    .stories-modal-content {
        max-width: 100%;
        max-height: 100vh;
        /* На мобильных устройствах занимаем всю ширину но сохраняем пропорции stories */
        width: 100vw;
        height: 177.78vw; /* 16/9 * 100vw для соотношения 9:16 */
        max-height: 100vh;
    }
    
    /* Если высота экрана меньше чем нужно для полных пропорций, подгоняем по высоте */
    @media (max-height: 600px) {
        .stories-modal-content {
            height: 100vh;
            width: 56.25vh; /* 9/16 * 100vh для соотношения 9:16 */
        }
    }
    
    /* Адаптируем кнопки для мобильных */
    .stories-banner-actions {
        bottom: 5px;
        right: 1%; /* Избегаем правой навигационной зоны */
        gap: 0px;
    }
    
    .stories-action-button {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .stories-action-icon {
        width: 18px;
        height: 18px;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #fff;
    font-style: italic;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
    opacity: 0;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Smooth group transition */
.stories-modal-overlay.group-transition {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Performance Optimizations */
.stories-banner-media {
    /* Enable hardware acceleration */
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Lazy loading states */
.stories-banner-media.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Optimized modal */
.stories-modal-content {
    /* GPU acceleration for smooth animations */
    will-change: transform;
    transform: translateZ(0);
}

/* Enhanced loading spinner */
.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =================================
   ПОДКЛЮЧЕНИЕ SVG СТИЛЕЙ
   ================================= */

/* Подключение стилей для SVG кнопок */
@import url('svg-buttons.css');