/* ============================================
   MODERN STORY VIEWER - INSTAGRAM/TIKTOK STYLE
   ============================================ */

.story-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: storyModalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes storyModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.story-viewer-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.story-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.story-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-content img,
.story-content video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: storyContentZoom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes storyContentZoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close Button - Modern Floating Style */
.story-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.story-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.story-close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* Navigation Buttons - Minimal Modern Style */
.story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: navBtnFadeIn 0.3s ease forwards;
}

@keyframes navBtnFadeIn {
    to {
        opacity: 1;
    }
}

.story-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.story-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.story-prev-btn {
    left: 16px;
}

.story-next-btn {
    right: 16px;
}

/* Progress Bars - Instagram Style */
.story-progress-bars {
    position: absolute;
    top: 12px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 100;
    padding: 0 8px;
}

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

.story-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: white;
    width: 0%;
    border-radius: 2px;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

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

/* Story Info Header - Modern Glassmorphism */
.story-info-header {
    position: absolute;
    top: 24px;
    left: 12px;
    right: 60px;
    z-index: 100;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: headerSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes headerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.story-author-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

.story-time {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Text Story Display - Modern Gradient Backgrounds */
.text-story-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.text-story-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(40px);
    opacity: 0.3;
    z-index: 0;
}

.text-story-display p {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    animation: textStoryFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes textStoryFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading State */
.story-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: storySpinner 0.8s linear infinite;
    z-index: 10;
}

@keyframes storySpinner {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile Responsive - Full Screen Experience */
@media (max-width: 768px) {
    .story-viewer-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .story-nav-btn {
        opacity: 0.5;
        width: 40px;
        height: 40px;
    }
    
    .story-nav-btn:hover {
        opacity: 1;
    }
    
    .story-close-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .story-info-header {
        top: 20px;
        left: 8px;
        right: 50px;
        padding: 6px 10px;
    }
    
    .story-author-avatar {
        width: 32px;
        height: 32px;
    }
    
    .story-author-name {
        font-size: 0.9rem;
    }
    
    .story-time {
        font-size: 0.75rem;
    }
    
    .text-story-display p {
        font-size: 1.5rem;
        padding: 40px 30px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .story-viewer-container {
        max-width: 420px;
    }
}

/* Desktop Large Screen */
@media (min-width: 1440px) {
    .story-viewer-container {
        max-width: 520px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .story-viewer-modal,
    .story-content img,
    .story-content video,
    .story-nav-btn,
    .story-info-header,
    .text-story-display p {
        animation: none;
    }
    
    .story-close-btn:hover {
        transform: scale(1.05);
    }
}
