/* ═══════════════════════════════════════════════
   MyEscorts Story Viewer - Sexy Pink Theme
   ═══════════════════════════════════════════════ */

/* Overlay */
#story-viewer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
}
#story-viewer-overlay.story-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* Container */
.story-viewer-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 90vh;
    max-height: 820px;
    background: linear-gradient(165deg, #1a0a12 0%, #0d0d0d 40%, #1a0a12 100%);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 0 60px rgba(236, 72, 153, 0.3),
        0 0 120px rgba(236, 72, 153, 0.1),
        0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(236, 72, 153, 0.2);
    animation: storyPulseGlow 4s ease-in-out infinite;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.story-visible .story-viewer-container {
    transform: scale(1);
}

@keyframes storyPulseGlow {
    0%, 100% { box-shadow: 0 0 60px rgba(236, 72, 153, 0.25), 0 0 120px rgba(236, 72, 153, 0.08), 0 25px 50px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 0 80px rgba(236, 72, 153, 0.4), 0 0 160px rgba(236, 72, 153, 0.15), 0 25px 50px rgba(0, 0, 0, 0.5); }
}

/* ─── Progress Bar ─── */
.story-progress-bar {
    display: flex;
    gap: 3px;
    padding: 12px 10px 6px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}
.story-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    min-width: 4px;
}
.story-progress-done .story-progress-fill {
    width: 100% !important;
    background: linear-gradient(90deg, #ec4899, #f472b6);
    transition: none !important;
}
.story-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ec4899, #f472b6, #fb7185);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.6);
}
.story-progress-active .story-progress-fill {
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.8);
}

/* ─── Header ─── */
.story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 14px 10px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}
.story-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.story-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid #ec4899;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
    flex-shrink: 0;
}
.story-username {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    letter-spacing: 0.3px;
}

/* ─── Close Button ─── */
.story-close {
    background: rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f9a8d4;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    backdrop-filter: blur(10px);
}
.story-close:hover {
    background: rgba(236, 72, 153, 0.3);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
}

/* ─── Image ─── */
.story-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.story-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
    -webkit-user-drag: none;
}
.story-image.story-image-visible {
    opacity: 1;
    transform: scale(1);
}

/* ─── Navigation Zones ─── */
.story-nav {
    position: absolute;
    top: 70px;
    bottom: 80px;
    cursor: pointer;
    z-index: 5;
}
.story-nav-prev {
    left: 0;
    width: 30%;
}
.story-nav-next {
    right: 0;
    width: 70%;
}

/* ─── Footer / Profile Button ─── */
.story-footer {
    padding: 12px 20px 20px;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
}
.story-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 50%, #be185d 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(236, 72, 153, 0.4),
        0 0 30px rgba(236, 72, 153, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}
.story-profile-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: storyBtnShine 3s ease-in-out infinite;
}
@keyframes storyBtnShine {
    0%, 100% { transform: rotate(45deg) translateX(-100%); }
    50% { transform: rotate(45deg) translateX(100%); }
}
.story-profile-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(236, 72, 153, 0.5),
        0 0 50px rgba(236, 72, 153, 0.3);
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 50%, #db2777 100%);
}
.story-profile-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ─── Mobile Responsive ─── */
@media (max-width: 480px) {
    .story-viewer-container {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .story-profile-btn {
        padding: 14px 36px;
        font-size: 14px;
    }
}

/* ─── Instagram carousel ring effect ─── */
.instagram-carousel .story-trigger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}
.instagram-carousel .story-trigger:hover {
    transform: scale(1.05);
}
.instagram-carousel .story-trigger .el-image {
    transition: box-shadow 0.3s ease;
}
.instagram-carousel .story-trigger:hover .el-image {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}
.instagram-carousel .story-trigger {
    cursor: pointer;
}

/* Remove the default YOOtheme primary overlay on hover that hides the image */
.instagram-carousel .uk-overlay-primary.uk-transition-fade {
    display: none !important;
}

/* Ensure the title stays visible without the overlay background covering too much */
.instagram-carousel .uk-overlay {
    background: transparent !important;
    pointer-events: none; /* Let clicks pass through to the image */
}
.instagram-carousel .uk-overlay .el-title {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* ─── Light Mode Overrides ─── */
body:not(.dark-mode) #story-viewer-overlay.story-visible {
    background: rgba(255, 255, 255, 0.92);
}
body:not(.dark-mode) .story-viewer-container {
    background: linear-gradient(165deg, #ffffff 0%, #f4f4f5 40%, #ffffff 100%);
    box-shadow: 
        0 0 60px rgba(236, 72, 153, 0.15),
        0 0 120px rgba(236, 72, 153, 0.05),
        0 25px 50px rgba(0, 0, 0, 0.15);
}
body:not(.dark-mode) .story-header {
    background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, transparent 100%);
}
body:not(.dark-mode) .story-footer {
    background: linear-gradient(to top, rgba(255,255,255,0.9) 0%, transparent 100%);
}
body:not(.dark-mode) .story-username {
    color: #1a1a1a;
    text-shadow: 0 1px 4px rgba(255,255,255,0.8);
}
body:not(.dark-mode) .story-close {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
}
body:not(.dark-mode) .story-close:hover {
    color: #be185d;
    background: rgba(236, 72, 153, 0.2);
}
body:not(.dark-mode) .story-progress-segment {
    background: rgba(0, 0, 0, 0.15);
}
