/* YouTube-Style Stream Cards */
.streams-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 20px;
}

/* Individual Stream Card */
.stream-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
}

.stream-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Thumbnail Container - 16:9 Aspect Ratio */
.stream-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #0a0a0a;
    overflow: hidden;
}

.stream-thumbnail img,
.stream-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Live Badge */
.live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ff0000;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Duration Badge */
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

/* Viewer Count */
.viewer-count-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.viewer-count-badge::before {
    content: '👁';
    font-size: 14px;
}

/* Stream Info Section */
.stream-info {
    padding: 12px;
    display: flex;
    gap: 12px;
}

/* Streamer Avatar */
.streamer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

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

/* Stream Details */
.stream-details {
    flex: 1;
    min-width: 0;
}

.stream-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.stream-username {
    font-size: 13px;
    color: #aaaaaa;
    margin: 0 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stream-category {
    font-size: 12px;
    color: #888888;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stream Stats */
.stream-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #aaaaaa;
    margin-top: 4px;
}

/* Hover Video Preview */
.stream-card .video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stream-card:hover .video-preview {
    opacity: 1;
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading State */
.stream-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
}

.stream-loading::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #ffffff;
    border-color: #ffffff transparent #ffffff transparent;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.no-streams {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-streams-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-streams-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.no-streams-text {
    font-size: 14px;
    color: #aaaaaa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .streams-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
        padding: 12px;
    }

    .stream-info {
        padding: 10px;
    }

    .streamer-avatar {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .streams-container {
        grid-template-columns: 1fr;
    }
}

/* Featured Stream Card (Larger) */
.stream-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.stream-card.featured .stream-title {
    font-size: 16px;
}

.stream-card.featured .streamer-avatar {
    width: 44px;
    height: 44px;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    background: rgba(106, 126, 234, 0.2);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}

/* Overlay for Hover Actions */
.stream-overlay-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
}

.stream-card:hover .stream-overlay-actions {
    opacity: 1;
    pointer-events: auto;
}

.stream-action-buttons {
    display: flex;
    gap: 8px;
}

.stream-action-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.stream-action-btn:hover {
    background: #5a67d8;
}

.stream-action-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
}

.stream-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}