/* ========================================
   STORY VIEWER COMPONENT STYLES
   Instagram-style fullscreen story viewer
   ======================================== */

.story-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.story-viewer-modal.show {
    opacity: 1;
    visibility: visible;
}

.story-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: #000;
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.story-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

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

.story-progress-fill {
    height: 100%;
    width: 0%;
    background: white;
    border-radius: 2px;
}

/* ========================================
   HEADER
   ======================================== */

.story-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 12px 12px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.story-viewer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.story-viewer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.story-viewer-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.story-viewer-user-info {
    display: flex;
    flex-direction: column;
}

.story-viewer-username {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.story-viewer-time {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.story-viewer-actions {
    display: flex;
    gap: 8px;
}

.story-viewer-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.story-viewer-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.story-viewer-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.story-viewer-btn.close {
    background: rgba(255,255,255,0.15);
}

/* ========================================
   MEDIA CONTAINER
   ======================================== */

.story-viewer-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.story-viewer-media img,
.story-viewer-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========================================
   NAVIGATION ZONES
   ======================================== */

.story-nav-prev,
.story-nav-next {
    position: absolute;
    top: 80px;
    bottom: 80px;
    width: 30%;
    z-index: 5;
    cursor: pointer;
}

.story-nav-prev {
    left: 0;
}

.story-nav-next {
    right: 0;
}

/* ========================================
   PAUSE INDICATOR
   ======================================== */

.story-paused-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
}

.story-paused-indicator.show {
    opacity: 0.8;
    visibility: visible;
}

/* ========================================
   VIEWERS MODAL
   ======================================== */

.story-viewers-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60%;
    background: #1f2937;
    border-radius: 20px 20px 0 0;
    z-index: 20;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.story-viewers-modal.show {
    transform: translateY(0);
}

.story-viewers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.story-viewers-header h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.story-viewers-header button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-viewers-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.viewer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
}

.viewer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.viewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewer-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.viewer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.viewer-name {
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.viewer-time {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

.story-viewers-list .loading,
.story-viewers-list .no-viewers,
.story-viewers-list .error {
    text-align: center;
    padding: 24px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.story-viewers-list .error {
    color: #ef4444;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .story-viewer-container {
        max-width: 100%;
    }

    .story-progress-container {
        gap: 3px;
        padding: 6px 8px;
    }

    .story-progress-bar {
        height: 2px;
    }

    .story-viewer-header {
        padding: 16px 10px 10px;
    }

    .story-viewer-avatar {
        width: 32px;
        height: 32px;
    }

    .story-viewer-username {
        font-size: 13px;
    }

    .story-viewer-time {
        font-size: 11px;
    }

    .story-viewer-btn {
        width: 32px;
        height: 32px;
    }

    .story-viewer-btn svg {
        width: 20px;
        height: 20px;
    }

    .story-nav-prev,
    .story-nav-next {
        width: 25%;
    }
}

/* Prevent text selection while navigating */
.story-viewer-modal {
    user-select: none;
    -webkit-user-select: none;
}
