/* Infinite Live Stream - Liquid Glass Design */

:root {
    /* Primary colors */
    --primary-violet: #8B5CF6;
    --secondary-violet: #A78BFA;
    --accent-violet: #C4B5FD;
    
    /* Glass effect */
    --glass: rgba(139, 92, 246, 0.08);
    --glass-border: rgba(139, 92, 246, 0.12);
    --glass-strong: rgba(139, 92, 246, 0.15);
    
    /* Background */
    --bg-dark: #0F0F23;
    --bg-darker: #0A0A1A;
    
    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #B8B8D1;
    --text-muted: #8B8BA7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(196, 181, 253, 0.05) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--glass) 0%, var(--glass-strong) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-violet), var(--secondary-violet));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stream container */
.stream-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Video player container */
.video-container {
    position: relative;
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/9;
    max-height: 70vh;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--primary-violet);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Status indicators */
.status-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.status-card {
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.live {
    background: #22C55E;
}

.status-indicator.offline {
    background: #EF4444;
}

.status-indicator.connecting {
    background: #F59E0B;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, var(--primary-violet), var(--secondary-violet));
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

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

.btn.secondary {
    background: var(--glass);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn.secondary:hover {
    background: var(--glass-strong);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

/* Navigation controls */
.navigation-controls {
    margin: 20px 0;
    text-align: center;
}

.btn-nav {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--primary-violet);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(40px) saturate(180%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-nav:hover {
    background: var(--glass-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

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

.nav-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 0;
}

/* Error message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 15px;
    color: #FCA5A5;
    text-align: center;
    margin-top: 15px;
    display: none;
}

/* Stream info */
.stream-info {
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.stream-info h3 {
    margin-bottom: 15px;
    color: var(--primary-violet);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
}

.info-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header .subtitle {
        font-size: 16px;
    }
    
    .status-container {
        flex-direction: column;
        align-items: center;
    }
    
    .status-card {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quality Controls */
.quality-controls {
    margin: 20px 0;
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    animation: fadeIn 0.5s ease-in-out;
}

.quality-header h4 {
    color: var(--primary-violet);
    margin-bottom: 15px;
    font-weight: 600;
}

.quality-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.quality-selector-container label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 60px;
}

.quality-selector {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.quality-selector:focus {
    border-color: var(--primary-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.quality-selector option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.current-quality-info {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.current-quality-info span:last-child {
    color: var(--accent-violet);
    font-weight: 500;
}

/* Statistics Container */
.stats-container {
    margin: 20px 0;
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    animation: fadeIn 0.5s ease-in-out;
}

.stats-header h4 {
    color: var(--primary-violet);
    margin-bottom: 15px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-violet);
    text-shadow: 0 0 10px rgba(196, 181, 253, 0.3);
}

/* Mobile Responsive for new elements */
@media (max-width: 768px) {
    .quality-selector-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .quality-selector-container label {
        min-width: unset;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .quality-controls,
    .stats-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

/* Stream Selector Styles */
.stream-selector-container {
    margin: 20px 0;
    padding: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.stream-selector-container h4 {
    color: var(--primary-violet);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.stream-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.stream-btn {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.stream-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-violet);
    transform: translateY(-2px);
}

.stream-btn.active {
    background: var(--primary-violet);
    border-color: var(--primary-violet);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.current-stream-info {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.obs-stream-config {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.obs-stream-config h4 {
    color: var(--primary-violet);
    margin-bottom: 10px;
    font-size: 16px;
}

@media (max-width: 480px) {
    .stream-buttons {
        flex-direction: column;
    }
    
    .stream-selector-container {
        padding: 15px;
        margin: 15px 0;
    }
}