/* Chat Container Styles */
#chat-container {
    position: fixed;
    bottom: 60px; /* Raised to avoid XP bar */
    left: 10px;
    width: 400px;
    height: 250px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #444;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    font-family: Arial, sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
}

/* Visual indicator when chat is focused */
#chat-container.chat-focused {
    border-color: #66ccff;
    box-shadow: 0 0 10px rgba(102, 204, 255, 0.3);
}

/* Chat Tabs */
#chat-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #444;
    border-radius: 5px 5px 0 0;
}

.chat-tab {
    flex: 1;
    padding: 8px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    border-right: 1px solid #333;
}

.chat-tab:last-child {
    border-right: none;
}

.chat-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.chat-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Highlight the sending channel */
.chat-tab[data-channel="say"].active {
    border-bottom: 2px solid #ffffff;
}

.chat-tab[data-channel="zone"].active {
    border-bottom: 2px solid #ffcc00;
}

.chat-tab[data-channel="global"].active {
    border-bottom: 2px solid #ff8c00;
}

.chat-tab[data-channel="party"].active {
    border-bottom: 2px solid #66ccff;
}

.chat-tab[data-channel="guild"].active {
    border-bottom: 2px solid #66ff66;
}

/* Chat Log */
#chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
}

#chat-log::-webkit-scrollbar {
    width: 8px;
}

#chat-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}

#chat-log::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

#chat-log::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Chat Messages */
.chat-message {
    margin-bottom: 5px;
    padding: 3px 0;
    word-wrap: break-word;
    line-height: 1.4;
    color: #ffffff; /* Default white text */
}

.chat-message .timestamp {
    color: #666;
    font-size: 11px;
    margin-right: 5px;
}

.chat-message .sender {
    font-weight: bold;
    margin-right: 5px;
}

/* Channel Colors */
.chat-message.say .sender {
    color: #ffffff;
}

.chat-message.zone {
    color: #ffcc00;
}

.chat-message.zone .sender {
    color: #ffcc00;
}

.chat-message.global {
    color: #ff8c00;
}

.chat-message.global .sender {
    color: #ff8c00;
}

.chat-message.party {
    color: #66ccff;
}

.chat-message.party .sender {
    color: #66ccff;
}

.chat-message.guild {
    color: #66ff66;
}

.chat-message.guild .sender {
    color: #66ff66;
}

.chat-message.whisper {
    color: #ff66ff;
}

.chat-message.whisper .sender {
    color: #ff66ff;
}

.chat-message.combat {
    color: #ff9999;
    font-style: italic;
}

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

.chat-message.error {
    color: #ff6666;
    font-style: italic;
}

/* Chat Input */
#chat-input-container {
    display: flex;
    padding: 8px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #444;
    border-radius: 0 0 5px 5px;
}

#chat-input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

#chat-input:focus {
    border-color: #666;
    background: rgba(255, 255, 255, 0.15);
}

#chat-input::placeholder {
    color: #888;
}

#chat-send {
    margin-left: 5px;
    padding: 6px 15px;
    background: #4CAF50;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

#chat-send:hover {
    background: #45a049;
}

#chat-send:active {
    background: #3d8b40;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #chat-container {
        width: 320px;
        height: 200px;
        font-size: 12px;
    }
    
    .chat-tab {
        font-size: 12px;
        padding: 6px;
    }
    
    #chat-input {
        font-size: 12px;
    }
    
    #chat-send {
        font-size: 12px;
        padding: 5px 12px;
    }
}