/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #121212;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Chat container */
.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90%;
    max-height: 600px;
    background-color: #1e1e1e;
    border: 2px solid #444;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Header */
.chat-header {
    background-color: #2a2a2a;
    padding: 10px 15px;
    border-bottom: 2px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 1.2em;
    color: #ff6b6b;
}

.connected-users {
    font-size: 0.85em;
    color: #999;
}

/* Chat messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #121212;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1e1e1e;
}

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

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

/* Message styling */
.message {
    margin-bottom: 8px;
    padding: 2px 5px;
    word-wrap: break-word;
}

.timestamp {
    color: #666;
    margin-right: 10px;
}

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

/* Different colors for usernames */
.username.color-1 { color: #ff6b6b; }
.username.color-2 { color: #4ecdc4; }
.username.color-3 { color: #45b7d1; }
.username.color-4 { color: #f9ca24; }
.username.color-5 { color: #6c5ce7; }
.username.color-6 { color: #a29bfe; }
.username.color-7 { color: #fd79a8; }
.username.color-8 { color: #e84393; }

.system-message {
    color: #888;
    font-style: italic;
}

.system-message .timestamp {
    color: #666;
}

/* Input area */
.chat-input {
    display: flex;
    padding: 10px;
    background-color: #2a2a2a;
    border-top: 2px solid #444;
    min-height: 60px;
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    margin-right: 10px;
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.chat-input input:focus {
    outline: none;
    border-color: #ff6b6b;
}

.chat-input input::placeholder {
    color: #666;
}

#username-input {
    width: 150px;
    flex: 0 0 150px;
}

#message-input {
    flex: 1;
}

.chat-input button {
    padding: 8px 15px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: background-color 0.2s;
}

.chat-input button:hover {
    background-color: #ff5252;
}

/* Audio controls */
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(30, 30, 30, 0.9);
    padding: 10px 15px;
    border-radius: 25px;
    border: 1px solid #444;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#toggle-music {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

#toggle-music:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#toggle-music.muted .music-icon {
    opacity: 0.5;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-icon {
    font-size: 1em;
}

#volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #444;
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Responsive */
@media (max-width: 600px) {
    .chat-container {
        width: 95%;
        height: 95%;
    }

    .chat-input {
        flex-direction: column;
        padding: 8px;
    }

    .chat-input input {
        margin-right: 0;
        margin-bottom: 8px;
    }

    #username-input {
        width: 100%;
        flex: 1;
    }

    .audio-controls {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }

    #volume-slider {
        width: 60px;
    }
}