/* Stories Styles */

/* Play overlay and button */
.stories-play-overlay {
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease-in-out;
}

.stories-play-btn {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stories-play-btn:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.stories-play-btn:active {
    transform: scale(0.95);
}

/* Progress bar animations */
.stories-progress-fill {
    transform-origin: left center;
    will-change: width;
}

/* Smooth transitions for slides */
.stories-slide {
    will-change: opacity, transform;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced navigation areas */
.stories-prev:active,
.stories-next:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Pause indicator */
.stories-container[data-story-state="paused"] .stories-progress-fill {
    animation-play-state: paused;
}

/* Loading state for videos */
.stories-video {
    transition: opacity 0.3s ease;
}

.stories-video[data-loading="true"] {
    opacity: 0.7;
}

/* Counter styling */
.stories-counter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stories-play-btn {
        padding: 1rem;
    }
    
    .stories-play-btn svg {
        width: 2rem;
        height: 2rem;
    }
}

/* Animation for progress bars */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Pulse effect for paused state */
@keyframes pausePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.stories-container[data-story-state="paused"] .stories-play-overlay {
    animation: pausePulse 2s ease-in-out infinite;
}

/* Touch feedback */
.stories-container {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Ensure proper stacking */
.stories-container {
    z-index: 1;
}

.stories-progress {
    z-index: 30;
}

.stories-play-overlay {
    z-index: 40;
}

/* Larger tap target for play/pause icon */
.stories-state-pill {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
}

.stories-state-icon {
    font-size: 18px;
}

/* Hover effects for desktop */
@media (hover: hover) {
    .stories-container:hover .stories-counter {
        opacity: 0.9;
    }
    
    .stories-prev:hover,
    .stories-next:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* Disable fullscreen for stories videos */
.stories-container .video-js .vjs-fullscreen-control {
    display: none !important;
}

.stories-container .video-js {
    /* Prevent fullscreen behavior on mobile */
    -webkit-playsinline: true;
    playsinline: true;
}

.stories-container .video-js video {
    /* Force inline playback on iOS */
    -webkit-playsinline: true;
    playsinline: true;
    /* Prevent fullscreen on click/tap */
    pointer-events: none;
}

/* Override any fullscreen styles */
.stories-container .video-js.vjs-fullscreen {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    z-index: auto !important;
}

/* Ensure video stays within container bounds */
.stories-container .video-js .vjs-tech {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Additional mobile-specific styles */
@media (max-width: 768px) {
    .stories-container .video-js {
        /* Prevent zoom on double tap */
        touch-action: manipulation;
        /* Disable user selection */
        -webkit-user-select: none;
        user-select: none;
    }
    
    .stories-container .video-js video {
        /* Force containment on mobile */
        max-width: 100% !important;
        max-height: 100% !important;
    }
}
