/* ==========================================================================
   Story Cards Block
   ========================================================================== */

.story-cards-block {
    position: relative;
    width: 100%;
    background-color: transparent;
    padding: 0 0 80px;
    overflow: visible;
    margin-top: -400px;
    z-index: 10;
    pointer-events: none;
}

.story-cards-block .story-card,
.story-cards-block .story-cards-stack {
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Scene — tall scroll container that pins the stack
   -------------------------------------------------------------------------- */
.story-cards-scene {
    position: relative;
    width: 100%;
    /* Height is intentionally minimal here — GSAP ScrollTrigger pins internally */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Stack — the 3 cards sit on top of each other here
   -------------------------------------------------------------------------- */
.story-cards-stack {
    position: relative;
    width: 440px;
    height: 760px;
    /* Cards are absolute inside this container */
}

/* --------------------------------------------------------------------------
   Individual card
   -------------------------------------------------------------------------- */
.story-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 440px;
    height: 760px;
    border-radius: 20px;
    overflow: hidden;
    background: #1e1e1e;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
    will-change: transform;
    transform-origin: center bottom;
    /* z-order: center on top, then right, then left */
}

.story-card--center { z-index: 3; }
.story-card--right  { z-index: 2; }
.story-card--left   { z-index: 1; }

/* --------------------------------------------------------------------------
   Story slides
   -------------------------------------------------------------------------- */
.story-card__slides {
    position: absolute;
    inset: 0;
}

.story-card__slide {
    position: absolute;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
}

.story-card__slide--active {
    visibility: visible;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Card background image
   -------------------------------------------------------------------------- */
.story-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.story-card__bg--video video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

/* Subtle gradient overlay for readability */
.story-card__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0) 60%,
        rgba(0, 0, 0, 0.55) 100%
    );
}

/* --------------------------------------------------------------------------
   Progress bars (top)
   -------------------------------------------------------------------------- */
.story-card__progress {
    position: absolute;
    top: 12px;
    left: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 4px;
}

.story-card__progress-bar {
    flex: 1;
    height: 2.5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
    position: relative;
}

.story-card__progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    transition: none;
}


/* --------------------------------------------------------------------------
   Card header (avatar + username + actions)
   -------------------------------------------------------------------------- */
.story-card__header {
    position: absolute;
    top: 24px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.story-card__user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-card__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.story-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-card__avatar-initial {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-transform: uppercase;
}

.story-card__username {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.story-card__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
}

.story-card__dots,
.story-card__close {
    font-size: 1rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    cursor: default;
}

/* --------------------------------------------------------------------------
   Card footer (send message + icons)
   -------------------------------------------------------------------------- */
.story-card__footer {
    position: absolute;
    bottom: 16px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-card__send {
    flex: 1;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    padding: 9px 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.story-card__footer-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.story-card__footer-icons svg {
    opacity: 0.9;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .story-cards-stack {
        width: 380px;
        height: 660px;
    }

    .story-card {
        width: 380px;
        height: 660px;
    }
}

@media (max-width: 768px) {
    .story-cards-scene {
        min-height: 70vh;
    }

    .story-cards-stack {
        width: 320px;
        height: 560px;
    }

    .story-card {
        width: 320px;
        height: 560px;
        border-radius: 16px;
    }

}

@media (max-width: 480px) {
    .story-cards-stack {
        width: 280px;
        height: 490px;
    }

    .story-card {
        width: 280px;
        height: 490px;
        border-radius: 14px;
    }

    .story-card__username { font-size: 0.75rem; }
    .story-card__avatar   { width: 28px; height: 28px; }
    .story-card__send     { font-size: 0.7rem; padding: 7px 12px; }
    .story-card__footer-icons svg { width: 18px; height: 18px; }

}
