/* Instagram-like Stories CSS */

.stories_section {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    padding: 10px 0;
    margin-bottom: 10px;
}

.stories-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.stories-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 0 10px;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.stories-scroll::-webkit-scrollbar {
    height: 4px;
}

.stories-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.stories-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.stories-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.story-item {
    flex: 0 0 auto;
    width: 70px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-ring {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    margin: 0 auto 5px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    position: relative;
}

.story-seen .story-ring {
    background: #dbdbdb;
}

.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    background: #fff;
}

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

.story-username {
    font-size: 11px;
    color: #262626;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70px;
}

.story-unseen .story-username {
    font-weight: 600;
}

.story-seen .story-username {
    color: #8e8e8e;
}

/* Dark theme support */
.dark-theme .stories_section {
    background: #000;
    border-bottom-color: #262626;
}

.dark-theme .story-username {
    color: #fafafa;
}

.dark-theme .story-seen .story-username {
    color: #737373;
}

.dark-theme .story-avatar {
    border-color: #000;
    background: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .story-item {
        width: 60px;
    }
    
    .story-ring {
        width: 56px;
        height: 56px;
    }
    
    .story-username {
        font-size: 10px;
        max-width: 60px;
    }
}

/* Story Viewer Modal */
.story-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

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

.story-content {
    position: relative;
    max-width: 500px;
    width: 100%;
    height: 90vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-progress-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

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

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

.story-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.story-user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
}

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

.story-user-name {
    font-size: 14px;
    font-weight: 600;
}

.story-time {
    font-size: 12px;
    opacity: 0.8;
}

.story-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    z-index: 11;
}

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

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

.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    cursor: pointer;
}

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

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