/* ============================================
   STORY VIEWER - Full-screen Overlay
   Story container, progress bars, navigation
   ============================================ */

/* ====== STORY OVERLAY ====== */
.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-xs);
}

/* Full-screen blurred background layer */
.story-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: var(--story-blur-bg);
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.7);
    opacity: 0.8;
    z-index: -10;
    transition: opacity 0.3s ease-out;
}

.story-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

/* ====== PROGRESS BARS ====== */
.progress-container {
    position: fixed;
    top: var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 1002;
    max-width: 90%;
    width: var(--story-width);
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: var(--progress-inactive);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--white);
    width: 0;
    transition: width 0.3s ease;
}

.progress-bar.completed .progress-bar-fill {
    width: 100%;
}

.progress-bar.active .progress-bar-fill {
    animation: progressFill 0.3s ease-out forwards;
}

@keyframes progressFill {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* ====== SKIP BUTTON ====== */
.skip-button {
    position: fixed;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    width: 44px;
    height: 44px;
    background: var(--overlay-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: all var(--transition-fast);
}

.skip-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.skip-button:active {
    transform: scale(0.95);
}

.skip-button svg {
    width: 20px;
    height: 20px;
}

/* ====== STORY CONTAINER ====== */
.story-container {
    position: relative;
    width: 100%;
    max-width: var(--story-width);
    max-height: var(--story-height);
    aspect-ratio: var(--story-aspect-ratio);
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10;
    /* Animation is now applied per device in responsive.css */
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ====== STORY CONTENT ====== */
.story-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: var(--story-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Slide Background */
.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.slide-background.blurred {
    filter: blur(8px) brightness(0.8); /* Less blur, more visible */
}

/* Slide Overlay (darkening) */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Lighter overlay - backgrounds more visible */
    z-index: -1;
}

/* ====== SLIDE CONTENT ====== */
.slide-header {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: var(--font-weight-bold);
    color: var(--white);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 4px 20px rgba(0, 0, 0, 0.8); /* Stronger shadow for visibility */
    line-height: 1.2;
    max-width: 90%;
    word-wrap: break-word;
}

.slide-paragraph {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    font-weight: var(--font-weight-normal);
    color: var(--white);
    line-height: 1.6;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 2px 16px rgba(0, 0, 0, 0.8); /* Stronger shadow for visibility */
    max-width: 85%;
    margin: 0 auto;
}

.slide-bullets {
    list-style: none;
    text-align: left;
    max-width: 85%;
    margin: var(--spacing-md) auto 0;
}

.slide-bullets li {
    font-size: clamp(1rem, 3vw, 1.15rem);
    font-weight: var(--font-weight-normal);
    color: var(--white);
    line-height: 1.8;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 2px 16px rgba(0, 0, 0, 0.8); /* Stronger shadow for visibility */
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md);
    position: relative;
}

.slide-bullets li::before {
    content: "•";
    position: absolute;
    left: 0;
    font-size: 1.5em;
    line-height: 1;
}

/* Full Image Slide (no blur) */
.slide-image-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

/* Counter Animation (for price) */
.slide-counter {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: var(--font-weight-bold);
    color: var(--white);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9), 0 6px 24px rgba(0, 0, 0, 0.8); /* Stronger shadow for visibility */
}

.slide-subtitle {
    font-size: clamp(0.875rem, 2.5vw, 1.1rem);
    font-weight: var(--font-weight-normal);
    color: var(--white);
    opacity: 0.9;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 2px 16px rgba(0, 0, 0, 0.8); /* Stronger shadow for visibility */
}

/* ====== NAVIGATION ZONES ====== */
.nav-zone {
    position: absolute;
    top: 0;
    height: 100%;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    transition: background var(--transition-fast);
}

.nav-left {
    left: 0;
    width: 40%;
}

.nav-right {
    right: 0;
    width: 60%;
}

/* Visual feedback on click (optional) */
.nav-zone:active {
    background: rgba(255, 255, 255, 0.05);
}

/* ====== SLIDE TRANSITIONS ====== */
.slide-transition-out {
    animation: slideOut 0.3s ease-out forwards;
}

.slide-transition-in {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ====== SCROLLBAR STYLING ====== */
.story-content::-webkit-scrollbar {
    width: 6px;
}

.story-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.story-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.story-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
