/* ============================================================
   TaskMaster Pro - Chat Grupal v3
   ============================================================ */

#chat-panel {
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 380px !important;
    background: #1a1a2e !important;
    border-left: 1px solid #2a2a3e !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 9999 !important;
}

#chat-panel.hidden {
    display: none !important;
}

#chat-panel .chat-panel-header {
    padding: 16px;
    border-bottom: 1px solid #2a2a3e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #16162a;
    flex-shrink: 0;
}

#chat-panel .chat-panel-header h4 {
    margin: 0;
    font-size: 14px;
    color: #e8e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mensajes */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.chat-empty {
    text-align: center;
    color: #888;
    font-size: 13px;
    padding: 40px 20px;
}

/* Fecha */
.chat-date {
    text-align: center;
    margin: 12px 0;
}
.chat-date span {
    background: #16162a;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: #888;
}

/* Mensaje */
.chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.chat-msg.mine {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
}
.chat-avatar-spacer {
    width: 30px;
    flex-shrink: 0;
}

.chat-bubble {
    background: #16162a;
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 75%;
}
.chat-msg.mine .chat-bubble {
    background: #6366f1;
}

.chat-author {
    font-size: 11px;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 2px;
}
.chat-msg.mine .chat-author {
    color: rgba(255,255,255,0.8);
}

.chat-text {
    font-size: 13px;
    color: #e8e8f0;
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-msg.mine .chat-text {
    color: white;
}

.chat-time {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    text-align: right;
}
.chat-msg.mine .chat-time {
    color: rgba(255,255,255,0.6);
}

/* Input */
.chat-input-area {
    padding: 12px;
    border-top: 1px solid #2a2a3e;
    background: #16162a;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-wrapper textarea {
    flex: 1;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    padding: 10px 14px;
    color: #e8e8f0;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    outline: none;
}

.chat-input-wrapper textarea:focus {
    border-color: #6366f1;
}

.chat-input-wrapper button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #6366f1;
    border: none;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
}

.chat-input-wrapper button:hover {
    background: #5558e6;
}

.chat-input-wrapper button i {
    margin: 0;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    #chat-panel {
        width: 100% !important;
    }
}