/**
 * Homepage Modern Styles
 * Additional styling for a Twitch/Kick-like appearance
 */

/* Browse Page Specific */
#browse-page {
    background: var(--bg-primary);
}

.page-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0;
}

/* Category Filter Pills */
.category-filter {
    display: flex;
    gap: 8px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-filter::-webkit-scrollbar {
    height: 6px;
}

.category-pill {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.category-pill.active {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

/* Featured Section */
.featured-section {
    background: var(--bg-secondary);
    padding: 24px;
    margin-bottom: 24px;
}

.featured-carousel {
    position: relative;
    height: 360px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-stream {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-stream img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
}

.carousel-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.carousel-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 16px;
}

.carousel-meta span::after {
    content: '•';
    margin-left: 16px;
    opacity: 0.5;
}

.carousel-meta span:last-child::after {
    display: none;
}

.watch-now-btn {
    background: var(--primary-purple);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watch-now-btn:hover {
    background: var(--primary-purple-hover);
    transform: translateY(-2px);
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.carousel-controls button {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
}

.carousel-controls button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Streams Section */
.streams-section {
    padding: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

/* Stream Grid */
.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Stream Card Enhancements */
.stream-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.stream-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.stream-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.stream-card:hover .stream-thumbnail img {
    transform: scale(1.05);
}

.stream-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stream-card:hover .stream-hover-overlay {
    opacity: 1;
}

.watch-stream-btn {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watch-stream-btn:hover {
    background: var(--primary-purple-hover);
    transform: scale(1.05);
}

.live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    animation: live-pulse 2s ease-in-out infinite;
}

.viewer-count {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.stream-info {
    padding: 12px;
    display: flex;
    gap: 12px;
}

.streamer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.stream-details {
    flex: 1;
    min-width: 0;
}

.stream-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.streamer-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stream-category {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Categories Preview */
.categories-preview-section {
    padding: 24px;
    background: var(--bg-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.category-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
}

.category-thumbnail {
    position: relative;
    padding-bottom: 133%;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.category-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-thumbnail img {
    transform: scale(1.05);
}

.category-info {
    padding: 0 4px;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-viewers {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Section Links */
.section-view-all {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-link);
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.section-view-all:hover {
    color: var(--text-link-hover);
}

.section-view-all svg {
    width: 16px;
    height: 16px;
}

/* Filter Select */
.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* Load More */
.load-more-container {
    text-align: center;
    padding: 32px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    opacity: 0.2;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1400px) {
    .streams-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1024px) {
    .featured-carousel {
        height: 280px;
    }
    
    .carousel-title {
        font-size: 24px;
    }
    
    .streams-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .featured-section {
        padding: 16px;
    }
    
    .featured-carousel {
        height: 200px;
    }
    
    .carousel-info {
        padding: 20px;
    }
    
    .carousel-title {
        font-size: 20px;
    }
    
    .streams-section {
        padding: 16px;
    }
    
    .streams-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}