* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #0e0e10;
    color: #efeff1;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.container {
    background-color: #18181b;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 20px;
    width: 95%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    min-height: 80vh;
}

h1 {
    text-align: left;
    margin-bottom: 20px;
    color: #efeff1;
    font-size: 1.8rem;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
}

h1 svg {
    margin-right: 10px;
    fill: #9147ff;
}

h1 .logo {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 50%;
    object-fit: cover;
}

.recorder-panel {
    margin-bottom: 20px;
}

.main-content {
    display: flex;
    flex-direction: column;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    order: -1; 
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    min-width: 120px;
    transition: all 0.2s ease;
    background-color: #2a2a2d;
    color: #efeff1;
}

.btn:hover:not(:disabled) {
    background-color: #3a3a3d;
}

#startBtn {
    order: 1;
    background-color: #9147ff;
    color: white;
}

#startBtn:hover:not(:disabled) {
    background-color: #772ce8;
}

#stopBtn {
    order: 2;
    background-color: #eb0400;
    color: white;
}

#stopBtn:hover:not(:disabled) {
    background-color: #c00;
}

#streamVideoBtn {
    order: 3;
    background-color: #2a2a2d;
    color: #efeff1;
}

#streamVideoBtn:hover:not(:disabled) {
    background-color: #3a3a3d;
}

#downloadBtn {
    order: 4;
    background-color: #2a2a2d;
    color: #efeff1;
}

#downloadBtn:hover:not(:disabled) {
    background-color: #3a3a3d;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: #1f1f23;
    border-radius: 4px;
    font-size: 0.9rem;
}

.viewer-count {
    display: none;
}

.preview-container {
    width: 100%;
    background-color: #0e0e10;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 16/9;
    margin-bottom: 15px;
    position: relative;
}

.preview-viewer-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 4px 8px;
    color: #ff0000;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10;
}

.preview-viewer-count svg {
    fill: #ff0000;
    width: 14px;
    height: 14px;
}

#timer {
    font-weight: bold;
    color: #eb0400;
}

#recordingStatus {
    color: #adadb8;
}

#preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #0e0e10;
}

.mute-chat-container {
    background-color: #2a2a2d;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.mute-chat-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.mute-chat-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.mute-text {
    color: #ff0000;
    font-size: 1.1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3d;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #9147ff;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.ai-interval-container, .toggle-container {
    background-color: #1f1f23;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-interval-container label, .toggle-container .toggle-label {
    margin-right: 10px;
    color: #adadb8;
}

/* Chat Settings */
.chat-settings {
    background-color: #1f1f23;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.chat-settings h3 {
    margin-bottom: 12px;
    color: #efeff1;
    font-size: 1rem;
}

.checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-wrapper label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    background-color: #2a2a2d;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #adadb8;
}

.checkbox-wrapper input[type="checkbox"]:checked + label {
    background-color: #9147ff;
    color: white;
}

.checkbox-wrapper label:hover {
    background-color: #3a3a3d;
}

.checkbox-wrapper input[type="checkbox"]:checked + label:hover {
    background-color: #772ce8;
}

.instructions {
    background-color: #1f1f23;
    padding: 15px;
    border-radius: 4px;
}

h2 {
    margin-bottom: 12px;
    color: #efeff1;
    font-size: 1.2rem;
}

ol {
    padding-left: 20px;
    color: #adadb8;
}

li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.settings-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #adadb8;
}

/* Chat Panel Styles */
.chat-panel {
    background-color: #1f1f23;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 35px);
    position: relative;
}

.chat-header {
    padding: 10px 15px;
    border-bottom: 1px solid #2a2a2d;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-viewers {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #adadb8;
}

.chat-header-viewers svg {
    fill: #9147ff;
    width: 14px;
    height: 14px;
}

.popout-btn {
    background: none;
    border: none;
    color: #9147ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.popout-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 5px;
    fill: currentColor;
}

.popout-btn:hover {
    color: #772ce8;
}

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

.popup-chat {
    background-color: #1f1f23;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.popup-chat .chat-messages {
    max-height: none;
}

.message {
    display: flex;
    margin-bottom: 8px;
}

.username {
    font-weight: bold;
    margin-right: 6px;
}

.chat-input-container {
    padding: 10px;
    border-top: 1px solid #2a2a2d;
    display: flex;
}

#chatInput {
    flex: 1;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    background-color: #2a2a2d;
    color: #efeff1;
    margin-right: 8px;
}

#sendBtn {
    padding: 8px 12px;
    background-color: #9147ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#sendBtn:hover {
    background-color: #772ce8;
}

.message-content {
    color: #dedee3;
    word-break: break-word;
}



.chat-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #2a2a2d;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #adadb8;
    line-height: 1.4;
}

.chat-info h3 {
    color: #9147ff;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Poll Feature Styles */
.poll-container {
    background-color: #1f1f23;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.poll-container h3 {
    margin-bottom: 12px;
    color: #efeff1;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-container h3 button {
    background-color: #9147ff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.poll-container h3 button:hover {
    background-color: #772ce8;
}

.poll-form {
    margin-bottom: 15px;
}

.poll-form input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 4px;
    background-color: #2a2a2d;
    color: #efeff1;
}

.poll-form .option-container {
    display: flex;
    margin-bottom: 10px;
}

.poll-form .option-container input {
    flex: 1;
    margin-bottom: 0;
    margin-right: 10px;
}

.poll-form .option-container button {
    background-color: #eb0400;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    cursor: pointer;
}

.add-option-btn {
    padding: 8px 12px;
    background-color: #2a2a2d;
    color: #efeff1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.add-option-btn:hover {
    background-color: #3a3a3d;
}

.create-poll-btn {
    padding: 8px 12px;
    background-color: #9147ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.create-poll-btn:hover {
    background-color: #772ce8;
}

.active-poll {
    padding: 10px;
    background-color: #2a2a2d;
    border-radius: 4px;
}

.active-poll-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1rem;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-option {
    position: relative;
    background-color: #3a3a3d;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    overflow: hidden;
}

.poll-option:hover {
    background-color: #4a4a4d;
}

.poll-option-text {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(145, 71, 255, 0.3);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.poll-timer {
    height: 4px;
    background-color: #4a4a4d;
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.poll-timer-bar {
    height: 100%;
    background-color: #9147ff;
    width: 100%;
    transition: width linear 1s;
}

.poll-votes {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #adadb8;
}

.poll-close-btn {
    margin-top: 10px;
    padding: 6px 12px;
    background-color: #eb0400;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
}

.poll-close-btn:hover {
    background-color: #c00;
}

.poll-status {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    color: #9147ff;
}

#activePollContainer {
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #1f1f23;
}

#aiIntervalSelect {
    padding: 6px 10px;
    background-color: #2a2a2d;
    color: #efeff1;
    border: none;
    border-radius: 4px;
    flex: 0.7; 
    cursor: pointer;
}

#aiIntervalSelect:hover {
    background-color: #3a3a3d;
}

/* Poll Form Input Styles */
#pollFormContainer input[type="text"],
#pollFormContainer input[type="number"] {
    background-color: #2a2a2d;
    border: 1px solid #3a3a3d;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    width: 100%;
    color: #efeff1;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}
#pollFormContainer input[type="text"]:focus,
#pollFormContainer input[type="number"]:focus {
    border-color: #9147ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.2);
}

#pollFormContainer .option-container {
    margin-bottom: 8px;
}

#pollFormContainer .option-container button {
    background-color: #3a3a3d;
    transition: background-color 0.2s ease;
}

#pollFormContainer .option-container button:hover {
    background-color: #eb0400;
}

#pollFormContainer .create-poll-btn {
    margin-top: 5px;
    font-weight: 500;
}

/* Donation Styles */
.donation-message {
    background-color: rgba(145, 71, 255, 0.1);
    border-left: 3px solid #9147ff;
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
}

.bits-donation {
    border-left: 3px solid #9147ff;
    background-color: rgba(145, 71, 255, 0.1);
}

.dollars-donation {
    border-left: 3px solid #00b5ad;
    background-color: rgba(0, 181, 173, 0.1);
}

.bits-donation .donation-amount {
    color: #9147ff;
}

.dollars-donation .donation-amount {
    color: #00b5ad;
}

.donation-amount {
    color: #9147ff;
    font-weight: bold;
    margin-right: 5px;
}

.donation-username {
    font-weight: bold;
}

.donation-text {
    color: #efeff1;
    margin-top: 4px;
}

/* Stream Settings Container */
.stream-settings-container {
    background-color: #1f1f23;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.stream-settings-container h3 {
    margin-bottom: 12px;
    color: #efeff1;
    font-size: 1rem;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2d;
}

.setting-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.setting-label {
    color: #adadb8;
}

/* Custom color variations for usernames */
.color-1 { color: #ff4500; }
.color-2 { color: #0e9dd9; }
.color-3 { color: #00a94f; }
.color-4 { color: #9147ff; }
.color-5 { color: #f36895; }
.color-6 { color: #eb0400; }

@media (max-width: 800px) {
    .container {
        grid-template-columns: 1fr;
        padding: 15px;
        width: 100%;
        min-height: auto;
    }
    
    .controls {
        flex-direction: row;
    }
    
    .btn {
        width: auto;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .chat-panel {
        max-height: 400px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .chat-settings .checkbox-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .checkbox-wrapper {
        flex: 0 0 48%;
        margin-bottom: 6px;
    }
    
    .checkbox-wrapper label {
        padding: 8px 10px;
        font-size: 0.8rem;
        width: 100%;
        justify-content: center;
    }
    
    .preview-container {
        aspect-ratio: 4/3;  
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .chat-settings .checkbox-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .checkbox-wrapper {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
    
    .preview-container {
        aspect-ratio: 1/1;  
    }
}