/* Story Viewer Styles - Mobile Full-screen & Desktop Modal */

/* Story Viewer Container */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.story-viewer.active {
    display: flex;
}

/* Backdrop with blur */
.story-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Story Container */
.story-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Header */
.story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.story-progress-bars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

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

.story-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #fff;
    transition: width 0.1s linear;
}

.story-progress-bar.completed .story-progress-fill {
    width: 100%;
    animation: none;
}

.story-progress-bar.active .story-progress-fill {
    animation: story-progress 5s linear forwards;
}

@keyframes story-progress {
    from { width: 0; }
    to { width: 100%; }
}

.story-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.story-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.story-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

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

.story-username {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.story-timestamp {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.story-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.story-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Video Wrapper */
.story-video-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.story-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Story Info Overlay - Title and Description */
.story-info-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 3;
    pointer-events: none;
}

.story-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.story-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Navigation */
.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
}

.story-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.story-nav-prev {
    left: 1rem;
}

.story-nav-next {
    right: 1rem;
}

/* Tap Zones for Mobile */
.story-tap-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 2;
    cursor: pointer;
}

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

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

/* Footer */
.story-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 1rem;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.story-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.story-action-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
}

.story-action-btn:hover {
    transform: scale(0.3);
}

.story-action-btn.active {
    color: var(--accent-color);
}

.story-action-btn span {
    font-size: 0.9rem;
    font-weight: 500;
}

.story-comment-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.story-comment-input input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    outline: none;
    border-radius: 24px;
    transition: all 0.2s ease;
}

.story-comment-input input:focus {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.story-comment-input input::placeholder {
    color: var(--text-secondary);
}

.story-comment-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.story-comment-input button:hover {
    transform: scale(0.3);
    box-shadow: 0 4px 12px rgba(227, 252, 2, 0.4);
}

.story-comment-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Comments Sidebar */
.story-comments-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: var(--bg-secondary);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 20;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.story-comments-sidebar.active {
    transform: translateX(0);
}

.story-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.story-comments-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.story-comments-header button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.story-comments-header button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.story-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.story-comment {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.story-comment .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.story-comment .comment-content {
    flex: 1;
}

.story-comment .comment-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.story-comment .comment-text {
    margin: 0.25rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.story-comment .comment-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Reply Styles */
.story-comment-reply {
    border-left: 2px solid var(--border-color);
}

.story-comment-reply .comment-avatar {
    width: 28px;
    height: 28px;
}

.reply-indicator {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    font-weight: normal;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.25rem;
}

.comment-like-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.comment-like-btn:hover {
    color: var(--primary-color);
}

.comment-like-btn.liked {
    color: #e0245e;
}

.comment-like-btn .like-count {
    font-size: 0.7rem;
    font-weight: 600;
}

.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.comment-reply-btn:hover {
    color: var(--primary-color);
}

.reply-form-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 20px;
}

.reply-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.reply-input:focus {
    border-color: var(--primary-color);
}

.reply-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #0D0D0D;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.reply-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Desktop Styles */
@media (min-width: 769px) {
    .story-viewer-container {
        max-width: 500px;
        height: 90vh;
        max-height: 900px;
        border-radius: 16px;
        overflow: hidden;
    }

    .story-nav {
        display: flex;
    }

    .story-tap-zone {
        display: none;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .story-viewer-container {
        max-width: 100%;
        border-radius: 0;
    }

    .story-nav {
        display: none;
    }

    .story-comments-sidebar {
        width: 100%;
    }

    .story-actions {
        gap: 1rem;
    }

    .story-action-btn {
        font-size: 1.1rem;
    }

    .story-action-btn span {
        font-size: 0.85rem;
    }
}

/* Hide scrollbar but keep functionality */
.story-comments-list::-webkit-scrollbar {
    width: 6px;
}

.story-comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.story-comments-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.story-comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
