/**
 * Pages CSS - Modern streaming platform design
 * Inspired by Twitch and Kick
 */

/* ===== BROWSE PAGE ===== */
#browse-page {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Category Pills */
.category-pills {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid transparent;
    border-radius: 9999px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-pill.active {
    background: #9147ff;
    border-color: #9147ff;
}

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

.stream-card {
    position: relative;
    background: #18181b;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.stream-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.stream-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #0e0e10;
    overflow: hidden;
}

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

.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: #eb0400;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.viewer-count::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #eb0400;
    border-radius: 50%;
    display: inline-block;
}

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

.streamer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #772ce8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

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

.stream-title {
    font-weight: 600;
    color: #efeff1;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.streamer-name {
    color: #adadb8;
    font-size: 14px;
    margin-bottom: 2px;
}

.stream-category {
    color: #adadb8;
    font-size: 13px;
}

/* Featured Section */
.featured-section {
    margin-bottom: 48px;
}

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

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #efeff1;
}

.section-link {
    color: #bf94ff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.section-link:hover {
    color: #a970ff;
}

/* Featured Carousel */
.featured-carousel {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #0e0e10;
}

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

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

.carousel-content {
    display: flex;
    height: 100%;
}

.carousel-stream {
    flex: 1;
    position: relative;
}

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

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

.carousel-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

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

/* ===== CREATOR STUDIO PAGE ===== */
#prism-studios-page {
    display: block;
    height: calc(100vh - 60px);
    background: #0e0e10;
    overflow-y: auto;
}

/* Studio Sidebar */
.studio-sidebar {
    width: 240px;
    background: #1f1f23;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
}

.studio-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.studio-nav-item {
    margin-bottom: 4px;
}

.studio-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #adadb8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.studio-nav-link:hover {
    color: #efeff1;
    background: rgba(255, 255, 255, 0.05);
}

.studio-nav-link.active {
    color: #bf94ff;
    background: rgba(145, 71, 255, 0.15);
    border-left: 3px solid #9147ff;
}

/* Studio Main Content - Moved to prism-studios-modern.css */

.studio-header {
    background: #18181b;
    padding: 20px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.studio-title {
    font-size: 24px;
    font-weight: 700;
    color: #efeff1;
    margin-bottom: 8px;
}

.studio-subtitle {
    color: #adadb8;
    font-size: 14px;
}

/* Stream Setup */
.stream-setup {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.setup-section {
    background: #18181b;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.setup-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #efeff1;
    margin-bottom: 20px;
}

/* Video Preview */
.video-preview-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.video-preview {
    width: 100%;
    padding-bottom: 56.25%;
    background: #0e0e10;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.video-preview video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.preview-control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Stream Settings Form */
.stream-settings-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    color: #efeff1;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: #0e0e10;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #efeff1;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #9147ff;
    background: rgba(145, 71, 255, 0.05);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Go Live Button */
.go-live-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: #1f1f23;
    border-radius: 8px;
}

.go-live-info {
    flex: 1;
}

.go-live-title {
    font-size: 18px;
    font-weight: 600;
    color: #efeff1;
    margin-bottom: 4px;
}

.go-live-status {
    color: #adadb8;
    font-size: 14px;
}

.go-live-btn {
    background: #9147ff;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.go-live-btn:hover {
    background: #772ce8;
    transform: translateY(-1px);
}

.go-live-btn:active {
    transform: translateY(0);
}

.go-live-btn.live {
    background: #eb0400;
}

.go-live-btn.live:hover {
    background: #cc0400;
}

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

@media (max-width: 768px) {
    #browse-page {
        padding: 16px;
    }
    
    .streams-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 12px;
    }
    
    .featured-carousel {
        height: 250px;
    }
}

/* Following Page */
.following-content {
    padding: 24px;
}

.following-section {
    margin-bottom: 48px;
}

.following-section:last-child {
    margin-bottom: 0;
}

.no-live-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-secondary);
}

/* Offline Channels Grid */
.offline-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.offline-channel-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.offline-channel-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.offline-avatar {
    width: 48px;
    height: 48px;
    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: 18px;
    flex-shrink: 0;
}

.offline-info {
    flex: 1;
    min-width: 0;
}

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

.offline-status {
    font-size: 13px;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    #prism-studios-page {
        flex-direction: column;
    }
    
    .studio-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .studio-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .studio-nav-item {
        margin: 0;
    }
}

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

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

.empty-state-title {
    font-size: 24px;
    font-weight: 600;
    color: #efeff1;
    margin-bottom: 12px;
}

.empty-state-text {
    color: #adadb8;
    font-size: 16px;
    margin-bottom: 24px;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #18181b 0%, #232328 50%, #18181b 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; }
}

.stream-card-skeleton {
    height: 280px;
    border-radius: 8px;
}

.stream-card-skeleton .thumbnail-skeleton {
    height: 160px;
    border-radius: 8px 8px 0 0;
}

.stream-card-skeleton .info-skeleton {
    padding: 12px;
}

.stream-card-skeleton .avatar-skeleton {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.stream-card-skeleton .text-skeleton {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.stream-card-skeleton .text-skeleton.title {
    width: 80%;
}

.stream-card-skeleton .text-skeleton.meta {
    width: 60%;
    height: 14px;
}