@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.7);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2828;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.pulse {
    width: 10px;
    height: 10px;
    background-color: var(--danger-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

main {
    flex: 1;
    padding: 40px;
    display: flex;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.studio-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-area {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-area canvas, .preview-area video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background-color: #000;
}

.controls {
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

button {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

button.primary { background-color: var(--primary-color); color: white; }
button.primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
button.danger { background-color: var(--danger-color); color: white; }
button.danger:hover { background-color: var(--danger-hover); transform: translateY(-2px); }
button.secondary { background-color: rgba(255, 255, 255, 0.1); color: white; border: 1px solid var(--glass-border); }
button.secondary:hover { background-color: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.hidden { display: none !important; }

.sources-panel {
    width: 350px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sources-panel h3 { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 10px; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.source-item { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; border: 1px solid var(--glass-border); }
.source-item label { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }

.viewer-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.video-container { width: 100%; max-width: 1200px; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.video-container video { width: 100%; height: 100%; background: #000; }
.offline-message { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(0,0,0,0.8); color: white; z-index: 10; text-align: center; }
.offline-message h2 { font-size: 2rem; margin-bottom: 10px; }
.offline-message p { color: var(--text-muted); }

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.login-box {
    padding: 40px;
    text-align: center;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.login-box h2 { margin-bottom: 15px; }
.login-box p { margin-bottom: 25px; color: var(--text-muted); }
.error-msg { color: var(--danger-color); margin-top: 15px; font-weight: bold; }
.mixer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px; }
.mixer-btn { padding: 10px; font-size: 0.85rem; background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 6px; color: white; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 5px; }
.mixer-btn:hover { background: rgba(255,255,255,0.1); }
.mixer-btn.active { background: var(--primary-color); border-color: var(--primary-hover); }
