/* ============================================
   Virtual Broadcast Studio - Styles
   Professional, minimal, broadcast-quality UI
   ============================================ */

/* CSS Variables */
:root {
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(15, 15, 25, 0.92);
    --bg-panel-hover: rgba(25, 25, 40, 0.95);
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(59, 130, 246, 0.5);
    --success: #10b981;
    --warning: #f59e0b;
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Main Canvas */
#studioCanvas {
    width: 100vw;
    height: 100vh;
    display: block;
    outline: none;
}

/* ============================================
   Chat Panel
   ============================================ */
.chat-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    height: calc(100vh - 140px);
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
    z-index: 100;
}

.chat-panel.minimized {
    height: 48px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.chat-toggle {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-fast);
}

.chat-toggle:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.chat-message {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chat-message:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
}

.chat-message.highlighted {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.chat-message .author {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.chat-message .text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

.chat-input-area input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input-area button {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chat-input-area button:hover {
    background: var(--accent-hover);
}

/* ============================================
   Screen Overlay (for highlighted messages)
   ============================================ */
.screen-overlay {
    position: fixed;
    top: 20px;
    left: 20px;
    max-width: 400px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 0 30px var(--accent-glow);
    z-index: 90;
    transition: var(--transition-smooth);
}

.screen-overlay.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.highlighted-message {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
}

.highlighted-message .author {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

/* ============================================
   Hotkey Indicator (minimal, fades quickly)
   ============================================ */
.hotkey-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 50;
}

.hotkey-indicator.visible {
    opacity: 1;
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content p {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .chat-panel {
        width: 280px;
        right: 10px;
        top: 10px;
        height: calc(100vh - 40px);
    }
}