/* Stories Bar Component Styles */

.stories-bar-container {
    background: #1a1d21;
    border-radius: 12px;
    padding: 16px 12px 20px 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.stories-bar {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.stories-bar::-webkit-scrollbar {
    display: none;
}

.stories-bar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Story Item */
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 72px;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    padding: 4px;
}

.story-item:hover {
    transform: translateY(-2px);
    z-index: 20;
}

.story-item:active {
    transform: scale(0.95);
}

/* Story Avatar Container */
.story-item .story-ring-wrapper {
    width: 64px;
    height: 64px;
    position: relative;
}

/* Base Story Ring - No border by default */
.story-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 3px;
    background: transparent;
    border: none;
}

/* Story Ring with active stories - Blue gradient */
.story-ring.has-story {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
}

/* Viewed stories - Gray ring */
.story-ring.has-story.viewed {
    background: rgba(255, 255, 255, 0.3);
}

.story-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #1a1d21;
    overflow: visible;
    position: relative;
}

.story-item .story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Your Story Specific Styles - No ring, no border */
.story-item.your-story .story-ring {
    background: transparent;
    border: none;
    padding: 0;
    overflow: visible;
}

.story-item.your-story .story-ring-inner {
    position: relative;
    padding: 0;
    border: none;
    overflow: visible;
}

.story-plus-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: #fbbf24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #1a1d21;
    z-index: 5;
}

.story-plus-icon svg {
    width: 14px;
    height: 14px;
    stroke: #000;
}

/* Story Username */
.story-username {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    pointer-events: none;
}

.story-item.your-story .story-username {
    font-weight: 600;
    color: #fbbf24;
}

/* Loading Skeletons */
.stories-loading {
    display: flex;
    gap: 16px;
}

.story-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.story-skeleton::before {
    content: '';
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(90deg, #2a2d32 0%, #3a3d42 50%, #2a2d32 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.story-skeleton::after {
    content: '';
    width: 60px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #2a2d32 0%, #3a3d42 50%, #2a2d32 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Hide loading when stories are loaded */
.stories-bar.loaded .stories-loading {
    display: none;
}

/* Empty State */
.stories-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    gap: 8px;
}

.stories-empty svg {
    width: 32px;
    height: 32px;
    stroke: rgba(255, 255, 255, 0.3);
    margin-bottom: 8px;
}

.stories-empty p {
    font-size: 14px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .stories-bar-container {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .stories-bar {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .story-item {
        min-width: 72px;
    }
    
    .story-item .story-ring-wrapper {
        width: 64px;
        height: 64px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .story-item .story-ring-wrapper {
        width: 68px;
        height: 68px;
    }
}

/* Accessibility */
.story-item:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 4px;
    border-radius: 8px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .story-item:hover {
        transform: none;
    }
    
    .stories-bar {
        scroll-behavior: auto;
    }
    
    .story-skeleton::before,
    .story-skeleton::after {
        animation: none;
    }
}
