/* STORIES RAIL - Instagram-style horizontal */
.stories-container {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding: 0.5rem 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.stories-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* CAROUSEL WRAPPER */
.stories-carousel {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    width: 100%;
}

.stories-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    z-index: 2;
}

.stories-arrow:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

.story-item {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
    flex-shrink: 0;
    text-align: center;
    width: 62px;
}

.story-item:hover {
    transform: scale(1.08);
}

.story-label {
    font-size: 0.55rem;
    color: #94a3b8;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 62px;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
}

/* GRADIENT RING */
.story-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    position: relative;
    margin: 0 auto;
}

/* PULSE ANIMATION FOR LIVE STORIES */
.story-ring.live {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 39, 67, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 39, 67, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 39, 67, 0);
    }
}

.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #0f172a;
    /* Inner border */
    overflow: hidden;
    position: relative;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #dc2626;
    color: white;
    font-size: 0.5rem;
    padding: 1px 4px;
    border-radius: 6px;
    font-weight: 700;
    border: 2px solid #0f172a;
    z-index: 3;
    line-height: 1.3;
    white-space: nowrap;
}

/* VIEWER OVERLAY */
.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    backdrop-filter: blur(10px);
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.story-content {
    width: 100%;
    max-width: 380px;
    max-height: 85vh;
    background: #0f172a;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.story-progress-bar {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    z-index: 10;
}

.story-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    width: 0%;
}

.story-header {
    position: absolute;
    top: 16px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    color: white;
    padding: 0 0.5rem;
}

.story-close {
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.story-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.story-media {
    width: 100%;
    height: 55%;
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.story-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark gradient at bottom of image */
.story-media::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #0f172a, transparent);
    pointer-events: none;
}

/* COUNTDOWN BADGE */
.story-countdown-wrapper {
    position: absolute;
    top: 60px;
    right: 12px;
    z-index: 10;
}

.story-countdown-badge {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 10px;
    padding: 6px 12px;
    text-align: center;
    color: white;
    animation: pulse 2s infinite;
}

/* NAV ARROWS */
.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}

.story-nav:hover {
    background: rgba(245, 158, 11, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.story-nav-left {
    left: 8px;
}

.story-nav-right {
    right: 8px;
}

/* STORY COUNTER */
.story-counter {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    z-index: 10;
}

/* INFO PANEL */
.story-info-panel {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    background: linear-gradient(to bottom, #0f172a, #0b101e);
}

/* TICKET STYLE PRICE BOX */
.story-price-ticket {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.ticket-header {
    background: rgba(245, 158, 11, 0.15);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.ticket-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 0.5px;
}

.ticket-savings {
    background: #f59e0b;
    color: black;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.ticket-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-muted {
    color: #64748b;
    font-size: 0.8rem;
}

.text-accent {
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-crossed {
    text-decoration: line-through;
    color: #64748b;
    font-size: 0.9rem;
}

.price-large {
    font-size: 1.8rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.ticket-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.ticket-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
    justify-content: center;
}

/* MINI DESCRIPTION */
.story-features-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.story-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #e2e8f0;
    line-height: 1.3;
}

.story-mini-desc {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.3;
    align-items: flex-start;
}

.story-mini-desc p {
    margin: 0;
}

/* CTA BUTTON - ENHANCED */
.story-cta {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #dc2626);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    position: relative;
    overflow: hidden;
}

.cta-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: ctaShine 3s infinite;
}

@keyframes ctaShine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.story-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
}

.story-cta:active {
    transform: translateY(1px);
}

/* CTA BUTTON - Urgency */


/* Old classes kept for compat but hidden */
.story-footer,
.story-title,
.story-offer-tag {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
    .stories-container {
        flex-direction: row;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 1rem;
        margin-bottom: 0;
    }

    .story-ring {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }
}

/* --- PORTED ADMIN MODAL STYLES (For Story Config) --- */

/* OVERLAY & MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #0f172a;
    /* Deep Slate */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 500px;
    max-width: 90%;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* FORMS */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    /* Text Muted */
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    color: white;
    border-radius: 8px;
    font-family: inherit;
}

.form-input:focus {
    border-color: #22d3ee;
    /* Cyan */
    outline: none;
}

/* BUTTONS */
.btn-primary {
    background: #22d3ee;
    color: #0f172a;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #06b6d4;
}

.btn-ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: white;
}

/* FILTER BUTTONS (Checkboxes) */
.btn-filter {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    border-color: #22d3ee;
    color: white;
}

.btn-filter.active {
    background: #22d3ee;
    border-color: #22d3ee;
    color: #000;
    font-weight: 700;
}

/* FUGITIVE OFFERS TEXT ANIMATION */
.fugaz-text {
    background: linear-gradient(90deg, #f59e0b, #ef4444, #f59e0b);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Fallback */
    animation: shine 3s linear infinite;
    font-weight: 900;
    letter-spacing: 0.5px;
    display: inline-block;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* MOBILE STORIES BAR */
.mobile-stories-bar {
    display: none;
    padding: 1.5rem 1.5rem 0 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
    overflow: hidden;
}

.ms-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .mobile-stories-bar {
        display: block !important;
    }

    /* Ensure container scrolls properly on mobile */
    #mobile-stories-scroll.stories-container {
        padding-left: 0;
        padding-right: 2rem;
        /* Drag space */
    }
}