/* Instagram Stories Styles */
.lebasino-stories-container {
    position: relative;
    overflow: hidden;
}

/* Lebasino Stories Widget Slider Styles */
.lebasino-stories-container.stories-slider {
    position: relative;
    overflow: hidden;
}

.stories-slider-wrapper {
    position: relative;
}

.stories-slider-wrapper .slick-list {
    overflow: hidden;
}

.stories-slider-wrapper .slick-track {
    display: flex;
    align-items: center;
}

.story-slide {
    padding: 0 7.5px;
    outline: none;
}

.story-slide .story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.story-slide .story-item:hover {
    transform: scale(1.05);
}

/* Stories Swiper Slider */
.stories-swiper {
    padding: 10px 0;
    overflow: visible;
}

.stories-swiper .swiper-wrapper {
    align-items: center;
}

.stories-swiper .swiper-slide {
    margin-right: 15px;
}

/* Swiper Navigation */
.stories-swiper .swiper-button-next,
.stories-swiper .swiper-button-prev {
    background: rgba(255, 255, 255, 0.9);
    color: #e74c3c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stories-swiper .swiper-button-next:hover,
.stories-swiper .swiper-button-prev:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stories-swiper .swiper-button-next::after,
.stories-swiper .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

.stories-swiper .swiper-button-next {
    right: -20px;
}

.stories-swiper .swiper-button-prev {
    left: -20px;
}

/* Swiper Pagination */
.stories-swiper .swiper-pagination {
    position: relative;
    margin-top: 15px;
}

.stories-swiper .swiper-pagination-bullet {
    background: #e74c3c;
    opacity: 0.3;
    width: 8px;
    height: 8px;
    margin: 0 4px;
}

.stories-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Stories Slider (Legacy) */
.lebasino-stories-container.stories-slider {
    position: relative;
}

.lebasino-stories-container.stories-slider .stories-slider-wrapper {
    position: relative;
}

.lebasino-stories-container.stories-slider .story-slide {
    padding: 0 7.5px;
    outline: none;
}

/* Legacy Horizontal Layout (if needed) */
.stories-horizontal {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-horizontal::-webkit-scrollbar {
    display: none;
}

/* Story Item */
.story-item {
    display: flex;
    flex-direction: column;
    width: 80px !important;
    gap: 12px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.story-item:hover {
    transform: scale(1.05);
}

/* Story Circle */
.story-circle {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    height: 80px;
    width: 80px;
    transition: all 0.3s ease;
}

.story-circle::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: #C83B3B;
    z-index: 0;
}

.story-circle.has-story {
    border: none;
    background: transparent;
}

.story-circle.viewed::after {
    background: linear-gradient(144.69deg, rgba(102, 102, 102, 0.3) 14.07%, rgba(153, 153, 153, 0.3) 95.22%);
}

.story-image {
    padding: 5px;
    border-radius: 50% !important;
    aspect-ratio: 1;
    object-fit: cover;
    position: relative;
    z-index: 1;
    background: #fff;
    width: 100%;
    height: 100%;
    will-change: filter;
    transition: filter 0.2s ease-in-out;
}

/* Grayscale effect for viewed stories */
.story-circle.viewed .story-image {
    filter: grayscale(1);
}

.story-circle.viewed:hover .story-image {
    filter: grayscale(0);
}

.story-placeholder {
    padding: 3px;
    border-radius: 50%;
    aspect-ratio: 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 24px;
    position: relative;
    z-index: 1;
}

/* Story Title */
.story-title {
    text-align: center;
    font-size: 12px;
    color: #333;
    max-width: 80px;
    word-wrap: break-word;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height:32px;
}

/* Story Modal */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Stories Container in Modal - Updated for 5 stories (2+1+2) */
.story-modal-stories-container {
    position: relative;
    width: 100%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Main Story (Center) */
.story-modal-main {
    position: relative;
    width: 400px;
    max-width: 400px;
    height: 100%;
    background: black;
    border-radius: 15px;
    z-index: 10;
    transition: all 0.4s ease;
    cursor: pointer;
}

/* Paused state visual indicator */
.story-modal-main.paused::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 25;
    pointer-events: none;
}

.story-modal-main.paused::after {
    content: '\f04b';
    font-family: "Font Awesome 6 Pro";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    z-index: 26;
    pointer-events: none;
    opacity: 0;
    animation: pauseIconFadeIn 0.3s ease forwards;
}

@keyframes pauseIconFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Hover indicator for pause */
.story-modal-main:hover {
    transform: scale(1.02);
}

.story-modal-main:hover .story-progress-container {
    opacity: 0.8;
}

/* Pause indicator tooltip */
.story-modal-main.paused .pause-tooltip {
    position: absolute;
    top: 20px;
    left: 20px; 
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 27;
    animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Media Loading States */
.story-media-container.loading {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-loading {
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.media-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.media-error {
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Click zones for navigation */
.story-modal-main .navigation-zone-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 33.33%;
    height: 100%;
    z-index: 30;
    cursor: w-resize;
}

.story-modal-main .navigation-zone-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 33.33%;
    height: 100%;
    z-index: 30;
    cursor: e-resize;
}

/* Side Stories - Base styles for all 4 side stories */
.story-modal-side {
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
}

/* Previous Story 1 (Closest to center on left) */
.story-modal-prev-1 {
    width: 280px;
    max-width: 280px;
    height: 70%;
    opacity: 0.6;
    z-index: 6;
}

/* Previous Story 2 (Furthest on left) */
.story-modal-prev-2 {
    width: 220px;
    max-width: 220px;
    height: 60%;
    opacity: 0.4;
    z-index: 5;
}

/* Next Story 1 (Closest to center on right) */
.story-modal-next-1 {
    width: 280px;
    max-width: 280px;
    height: 70%;
    opacity: 0.6;
    z-index: 6;
}

/* Next Story 2 (Furthest on right) */
.story-modal-next-2 {
    width: 220px;
    max-width: 220px;
    height: 60%;
    opacity: 0.4;
    z-index: 5;
}

/* Hover effects for all side stories */
.story-modal-side:hover {
    opacity: 0.8 !important;
    transform: scale(1.02);
}

/* Story Media Container */
.story-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    position: relative;
}

.story-media-container img,
.story-media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Side Story Thumbnails */
.story-modal-side .story-thumbnail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    z-index: 10;
    background: white;
}

.story-modal-side .story-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation Arrows */
.story-navigation-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: white;
    color:var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.story-navigation-arrow:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.story-navigation-arrow.story-prev-arrow {
    left: -60px;
}

.story-navigation-arrow.story-next-arrow {
    right: -60px;
}

.story-navigation-arrow svg {
    width: 20px;
    height: 20px;
    fill: #e4405f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stories-swiper .swiper-slide {
        width: calc(20% - 6px) !important;
    }
    
    .story-item {
        width: 100% !important;
        max-width: 70px !important;
        margin: 0 auto;
    }
    
    .story-circle {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1;
        max-width: 70px;
        max-height: 70px;
    }
    
    .story-circle .story-image,
    .story-circle .story-placeholder {
        width: 100%;
        height: 100%;
    }
    
    .story-title {
        font-size: 10px;
        max-width: 70px;
        min-height: 24px;
    }
    
    .stories-slider-wrapper .slick-arrow {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .stories-slider-wrapper .slick-prev {
        left: -17px !important;
    }
    
    .stories-slider-wrapper .slick-next {
        right: -17px !important;
    }
    
    /* Mobile Story Modal - Full Screen */
    .story-modal {
        padding: 0;
    }
    
    .story-modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0;
    }
    
    .story-modal-stories-container {
        gap: 0;
        height: 100%;
        padding: 0;
    }
    
    /* Hide all side stories on mobile */
    .story-modal-side {
        display: none !important;
    }
    
    .story-modal-main {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        border-radius: 0 !important;
        position: relative;
    }
    
    /* Hide navigation arrows on mobile - swipe only */
    .story-navigation-arrow {
        display: none !important;
    }
    
    /* Mobile specific progress bars */
    .story-progress-container {
        top: 20px;
        left: 20px;
        right: 20px;
        z-index: 100;
    }
    
    .story-progress-bar {
        height: 4px;
    }
    
    /* Mobile close button */
    .story-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        z-index: 101;
    }
    
    /* Mobile story header */
    .story-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
        padding: 20px;
        z-index: 99;
    }
    
    /* Mobile products container */
    .story-products {
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
        padding: 20px;
        max-height: 40vh;
        border-radius: 20px 20px 0 0;
    }
    
    /* Mobile swipe indicators */
    .mobile-swipe-indicator {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(255, 255, 255, 0.6);
        font-size: 18px;
        pointer-events: none;
        z-index: 50;
        animation: swipeHint 2s ease-in-out infinite;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
    }
    
    .mobile-swipe-indicator.left {
        left: 20px;
    }
    
    .mobile-swipe-indicator.right {
        right: 20px;
    }
    
    @keyframes swipeHint {
        0%, 100% { 
            opacity: 0.6; 
            transform: translateY(-50%) translateX(0) scale(1); 
        }
        50% { 
            opacity: 0.3; 
            transform: translateY(-50%) translateX(0) scale(0.95); 
        }
        70% { 
            transform: translateY(-50%) translateX(3px) scale(1.05); 
        }
    }
    
    /* Swipe progress indicator */
    .swipe-progress {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        z-index: 60;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    
    .swipe-progress.active {
        opacity: 1;
    }
    
    /* RTL Responsive */
    body.rtl .stories-slider-wrapper .slick-prev {
        right: -17px !important;
        left: auto !important;
    }
    
    body.rtl .stories-slider-wrapper .slick-next {
        left: -17px !important;
        right: auto !important;
    }
    
    body.rtl .story-close {
        right: auto;
        left: 20px;
    }
    
    body.rtl .mobile-swipe-indicator.left {
        left: auto;
        right: 20px;
    }
    
    body.rtl .mobile-swipe-indicator.right {
        right: auto;
        left: 20px;
    }
}

/* Slider Navigation Arrows (Override default slick styles) */
.stories-slider-wrapper .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5) !important;
    border: none !important;
    color: white !important;
    font-size: 18px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.stories-slider-wrapper .slick-arrow:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

.stories-slider-wrapper .slick-arrow:before {
    display: none !important;
}

.stories-slider-wrapper .slick-prev {
    left: -20px !important;
}

.stories-slider-wrapper .slick-next {
    right: -20px !important;
}

.stories-slider-wrapper .slick-prev:after {
    content: "‹" !important;
    font-size: 20px !important;
    font-weight: bold !important;
    color: white !important;
}

.stories-slider-wrapper .slick-next:after {
    content: "›" !important;
    font-size: 20px !important;
    font-weight: bold !important;
    color: white !important;
}

/* Hide arrows when not enough slides */
.stories-slider-wrapper .slick-arrow.slick-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.story-modal-content {
    position: relative;
    width: 90%;
    max-height: 90%;
    background: transparent;
    display: flex;
    flex-direction: column;
}

/* Story Header */
.story-header {
    position: relative;
    padding: 15px;
    color: white;
}

/* Progress Container inside Story */
.story-progress-container {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    z-index: 20;
}

.story-progress-bars {
    display: flex;
    gap: 3px;
}

.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1.5px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width linear;
    border-radius: 1.5px;
}

/* Old progress styles (kept for backward compatibility) */
.story-progress {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    overflow: hidden;
    margin-bottom: 15px;
}

.story-info {
    display: flex;
    align-items: center;
}

.story-modal-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.story-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
}

/* Story Content */
.story-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.story-media-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    border-radius: 16px;
    overflow: hidden;
}

.story-product-button-container{
    position: absolute;
    bottom: 20px;
    width: 100%;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.25);
    text-align: center;
}

.story-product-button{
    border-radius: 8px;
    background: var(--primary-color);
    color:#fff;
    padding: 6px;
    width: 80%;
    display: block;
    margin: 0 auto;
}

/* Story Navigation */
.story-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.story-prev,
.story-next {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 24px;
    padding: 20px 15px;
    cursor: pointer;
    transition: background 0.3s ease;
    pointer-events: all;
}

.story-prev:hover,
.story-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.story-prev {
    border-radius: 0 5px 5px 0;
}

.story-next {
    border-radius: 5px 0 0 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stories-slider-wrapper .slick-arrow {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .stories-slider-wrapper .slick-prev {
        left: -17px !important;
    }
    
    .stories-slider-wrapper .slick-next {
        right: -17px !important;
    }
    
    .story-modal-content {
        max-width: 350px;
    }
    
    .story-prev,
    .story-next {
        padding: 15px 10px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .stories-swiper .swiper-slide {
        width: calc(20% - 5px) !important;
    }
    
    .story-item {
        width: 100% !important;
        max-width: 60px !important;
    }
    
    .story-circle {
        width: 100% !important;
        height: auto !important;
        max-width: 60px;
        max-height: 60px;
    }
    
    .story-title {
        font-size: 9px;
        max-width: 60px;
        min-height: 20px;
        line-height: 1.1;
    }
    
    .stories-slider-wrapper .slick-arrow {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    
    .stories-slider-wrapper .slick-prev {
        left: -15px !important;
    }
    
    .stories-slider-wrapper .slick-next {
        right: -15px !important;
    }
    
    .story-slide {
        padding: 0 5px !important;
    }
    
    .story-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .story-header {
        padding: 10px;
    }
    
    .story-products {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    /* RTL Support for 480px */
    body.rtl .stories-slider-wrapper .slick-prev {
        right: -15px !important;
        left: auto !important;
    }
    
    body.rtl .stories-slider-wrapper .slick-next {
        left: -15px !important;
        right: auto !important;
    }
}

/* RTL Support for Slider */
body.rtl .stories-slider-wrapper .slick-prev {
    right: -20px !important;
    left: auto !important;
}

body.rtl .stories-slider-wrapper .slick-next {
    left: -20px !important;
    right: auto !important;
}

body.rtl .stories-slider-wrapper .slick-prev:after {
    content: "›" !important;
}

body.rtl .stories-slider-wrapper .slick-next:after {
    content: "‹" !important;
}

/* RTL Support for 5 stories layout */
body.rtl .story-modal-stories-container {
    direction: rtl;
}

@media (max-width: 768px) {
    body.rtl .stories-slider-wrapper .slick-prev {
        right: -17px !important;
        left: auto !important;
    }
    
    body.rtl .stories-slider-wrapper .slick-next {
        left: -17px !important;
        right: auto !important;
    }
}

@media (max-width: 480px) {
    body.rtl .stories-slider-wrapper .slick-prev {
        right: -15px !important;
        left: auto !important;
    }
    
    body.rtl .stories-slider-wrapper .slick-next {
        left: -15px !important;
        right: auto !important;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes storyFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes storyFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.05);
    }
}

@keyframes storyZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mobileSlideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes swipeLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes swipeRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* Animation for story transitions */
@keyframes slideStoryLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100px);
        opacity: 0;
    }
}

@keyframes slideStoryRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

.story-modal.show {
    animation: fadeIn 0.3s ease;
}

.story-product-item {
    animation: slideInUp 0.4s ease;
}

.story-modal-main.transitioning,
.story-modal-side.transitioning {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-modal-main {
    animation: storySlideIn 0.5s ease;
}

.story-modal-side {
    animation: fadeIn 0.6s ease;
}

/* Story transition animations */
.story-modal-main.fade-in {
    animation: storyFadeIn 0.4s ease;
}

.story-modal-main.fade-out {
    animation: storyFadeOut 0.4s ease;
}

.story-modal-main.zoom-in {
    animation: storyZoomIn 0.4s ease;
}

.story-modal-main.slide-out-left,
.story-modal-side.slide-out-left {
    animation: slideStoryLeft 0.4s ease forwards;
}

.story-modal-main.slide-out-right,
.story-modal-side.slide-out-right {
    animation: slideStoryRight 0.4s ease forwards;
}

/* Performance optimization */
.story-modal-stories-container * {
    will-change: transform, opacity;
}

/* Mobile specific animations */
@media (max-width: 768px) {
    .story-modal.show.mobile-modal {
        animation: fadeIn 0.2s ease;
    }
    
    .story-modal-main {
        animation: mobileSlideInBottom 0.3s ease;
    }
    
    .story-products {
        animation: slideInUp 0.4s ease 0.2s both;
    }
    
    /* Swipe animation feedback */
    .story-modal-main.swiping-left {
        animation: swipeLeft 0.3s ease-out forwards;
    }
    
    .story-modal-main.swiping-right {
        animation: swipeRight 0.3s ease-out forwards;
    }
    
    /* Enhanced mobile transitions */
    .story-modal-main.fade-in {
        animation: storyFadeIn 0.3s ease;
    }
    
    .story-modal-main.fade-out {
        animation: storyFadeOut 0.3s ease;
    }
    
    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {
        .story-modal.show,
        .story-modal-main,
        .story-products,
        .story-product-item {
            animation: none;
        }
        
        .story-modal-main.transitioning,
        .story-modal-side.transitioning {
            transition: none;
        }
    }
}

/* RTL Support */
body.rtl .stories-horizontal {
    direction: rtl;
}

body.rtl .story-item {
    margin-right: 0;
    margin-left: 15px;
}

body.rtl .story-close {
    right: auto;
    left: 15px;
}

body.rtl .story-products {
    left: auto;
    right: 20px;
}

body.rtl .story-product-image {
    margin-right: 0;
    margin-left: 10px;
}

body.rtl .story-navigation-arrow.story-prev-arrow {
    left: auto;
    right: -60px;
}

body.rtl .story-navigation-arrow.story-next-arrow {
    right: auto;
    left: -60px;
}

/* RTL Support for Swiper */
body.rtl .stories-swiper {
    direction: rtl;
}

body.rtl .stories-swiper .swiper-slide {
    margin-right: 0;
    margin-left: 15px;
}

body.rtl .stories-swiper .swiper-button-next {
    left: -20px;
    right: auto;
}

body.rtl .stories-swiper .swiper-button-prev {
    right: -20px;
    left: auto;
}

/* Mobile Modal Specific Styles */
.story-modal.mobile-modal {
    background-color: #000;
}

.story-modal-content.mobile-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
}

/* Touch feedback for mobile */
@media (max-width: 768px) {
    .story-modal-main {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Better touch targets */
    .story-close {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Prevent zoom on double tap */
    .story-modal-main * {
        touch-action: pan-y;
    }
    
    /* iOS specific fixes */
    .story-modal {
        -webkit-overflow-scrolling: touch;
    }
    
}