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

body {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #ffd700;
}

.studio-container {
    display: grid;
    grid-template-columns: 1fr 400px 300px;
    gap: 30px;
    max-width: 1400px;
    width: 100%;
    align-items: start;
}

/* Broadcast Section */
.broadcast-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.monitor-frame {
    position: relative;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 20px;
    padding: 40px 30px 50px;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.5),
        0 20px 40px rgba(0,0,0,0.7);
    border: 3px solid #333;
}

.brand-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0,255,0,0.5);
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

#programCanvas {
    border: 8px solid #2a2a2a;
    border-radius: 8px;
    background: #000;
    box-shadow: 
        inset 0 0 30px rgba(0,255,0,0.1),
        0 0 30px rgba(0,0,0,0.8);
    filter: contrast(1.1) brightness(1.1);
}

.screen-glow {
    position: absolute;
    top: 40px;
    left: 30px;
    right: 30px;
    bottom: 50px;
    border-radius: 8px;
    box-shadow: 0 0 80px rgba(0,255,0,0.2);
    pointer-events: none;
}

.stream-overlay {
    position: absolute;
    top: 40px;
    left: 30px;
    right: 30px;
    bottom: 50px;
    pointer-events: none;
    border-radius: 8px;
    overflow: hidden;
}

.overlay-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.overlay-bottom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
}

.lower-third {
    background: linear-gradient(90deg, rgba(255,215,0,0.9), rgba(255,215,0,0.7));
    color: #000;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    transform: translateX(-100%);
}

.lower-third:not(.hidden) {
    transform: translateX(0);
}

.lower-name {
    display: block;
    font-size: 16px;
}

.lower-title {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}

#streamStatus {
    background: #333;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.3s;
}

#streamStatus.live {
    background: #ff0000;
    color: #fff;
    animation: blink 1s ease-in-out infinite alternate;
}

@keyframes blink {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* Preview Monitor */
.preview-monitor {
    position: relative;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 15px;
    padding: 25px 20px 30px;
    border: 2px solid #333;
    box-shadow: 
        inset 0 0 15px rgba(0,0,0,0.5),
        0 15px 30px rgba(0,0,0,0.5);
}

.preview-label {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #888;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

#previewCanvas {
    border: 4px solid #2a2a2a;
    border-radius: 4px;
    background: #000;
    width: 100%;
    height: auto;
}

/* Control Panel */
.control-panel {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 15px;
    padding: 25px;
    border: 3px solid #333;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.5),
        0 20px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.power-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

.status-indicators {
    display: flex;
    gap: 8px;
}

.power-led, .stream-led, .recording-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 2px solid #444;
    transition: all 0.3s;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.power-led.on {
    background: #00ff00;
    border-color: #00cc00;
    box-shadow: 0 0 15px rgba(0,255,0,0.8);
}

.stream-led.live {
    background: #ff0000;
    border-color: #cc0000;
    box-shadow: 0 0 15px rgba(255,0,0,0.8);
    animation: pulse 1s ease-in-out infinite alternate;
}

.recording-led.recording {
    background: #ff8800;
    border-color: #cc6600;
    box-shadow: 0 0 15px rgba(255,136,0,0.8);
}

.power-button, .go-live-button {
    background: linear-gradient(145deg, #ff4444, #cc3333);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.go-live-button {
    background: linear-gradient(145deg, #00aa00, #008800);
}

.go-live-button.live {
    background: linear-gradient(145deg, #ff0000, #cc0000);
    animation: pulse 2s ease-in-out infinite alternate;
}

.power-button:hover, .go-live-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

/* Source Matrix */
.source-matrix {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-row {
    display: flex;
    gap: 8px;
}

.source-btn {
    flex: 1;
    background: linear-gradient(145deg, #666, #444);
    color: #ffd700;
    border: none;
    border-radius: 6px;
    padding: 10px 8px;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    min-height: 35px;
}

.source-btn.active {
    background: linear-gradient(145deg, #ffd700, #ccaa00);
    color: #000;
    box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

.source-btn:hover:not(.active) {
    background: linear-gradient(145deg, #777, #555);
    transform: translateY(-1px);
}

/* Scene Controls */
.scene-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scene-presets {
    display: flex;
    gap: 5px;
}

.preset-btn {
    flex: 1;
    background: linear-gradient(145deg, #555, #333);
    color: #ffd700;
    border: none;
    border-radius: 4px;
    padding: 8px;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: linear-gradient(145deg, #666, #444);
}

.transition-controls {
    display: flex;
    gap: 10px;
}

.transition-btn {
    flex: 1;
    background: linear-gradient(145deg, #ff8800, #cc6600);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.transition-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Professional Controls */
.pro-controls {
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    padding: 15px 0;
}

.knobs-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.knob-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.knob {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #888, #333);
    border: 3px solid #222;
    position: relative;
    cursor: pointer;
    box-shadow: 
        inset 0 0 10px rgba(0,0,0,0.5),
        0 4px 8px rgba(0,0,0,0.3);
}

.knob-indicator {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 12px;
    background: #ffd700;
    border-radius: 2px;
    transition: transform 0.1s;
}

.knob-led {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffff00;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 8px rgba(255,255,0,0.8);
}

.knob-group label {
    color: #ffd700;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.vu-meter {
    width: 40px;
    height: 4px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.vu-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
    width: 0%;
    transition: width 0.1s;
}

/* Toggles */
.toggles-section {
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
}

.toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ffd700;
}

.toggle-group label {
    color: #ffd700;
    font-size: 10px;
    font-weight: bold;
}

/* Stream Settings */
.stream-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group, .quality-settings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label, .quality-settings label {
    color: #ffd700;
    font-size: 10px;
    font-weight: bold;
}

.input-group input, .input-group select, .quality-settings select {
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 6px;
    color: #ffd700;
    font-size: 11px;
}

.input-group input:focus, .input-group select:focus, .quality-settings select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255,215,0,0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    background: linear-gradient(145deg, #666, #444);
    color: #ffd700;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.action-btn.emergency {
    background: linear-gradient(145deg, #ff4444, #cc3333);
    color: white;
}

.action-btn.emergency.active {
    animation: flash 0.2s ease-in-out 5;
}

@keyframes flash {
    0%, 100% { background: linear-gradient(145deg, #ff4444, #cc3333); }
    50% { background: linear-gradient(145deg, #ffffff, #cccccc); }
}

.action-btn:hover {
    background: linear-gradient(145deg, #777, #555);
    transform: translateY(-1px);
}

/* Chat Panel */
.chat-panel {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 15px;
    border: 3px solid #333;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.5),
        0 20px 40px rgba(0,0,0,0.5);
    height: fit-content;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.3s;
}

.chat-panel.overlay-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.chat-header {
    background: linear-gradient(145deg, #333, #222);
    padding: 10px 15px;
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 2px solid #444;
}

.chat-messages {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    font-size: 11px;
    line-height: 1.4;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #ffd700;
}

.chat-user {
    color: #00ff00;
    font-weight: bold;
    margin-right: 5px;
}

.chat-text {
    color: #ccc;
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

.footer a {
    color: #ffd700;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .studio-container {
        grid-template-columns: 1fr 350px;
        grid-template-rows: auto auto;
    }
    
    .chat-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .studio-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .broadcast-section {
        order: 1;
    }
    
    .control-panel {
        order: 2;
    }
    
    .chat-panel {
        order: 3;
    }
    
    .knobs-section {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .toggle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    #programCanvas {
        width: 100%;
        height: auto;
        max-width: 480px;
    }
    
    .monitor-frame {
        padding: 20px 15px 30px;
    }
    
    .control-panel {
        padding: 20px;
    }
    
    .knobs-section {
        grid-template-columns: 1fr 1fr;
    }
    
    .toggle-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .source-row {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #222;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ffed4e;
}