/**
 * DQA Chat System
 * Sistema completo de mensajería y chat
 */

/* ========================================= */
/* Chat Header */
/* ========================================= */
.dqa-chat-header {
    border-bottom: 1px solid #0A0A0A;
}

.dqa-chat-header .dqa-recipient-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 0 0 2rem 0;
}

.dqa-chat-header .dqa-recipient-info img {
    width: 5.4rem;
    height: 5.4rem;
    border-radius: 50%;
    object-fit: cover;
}

.dqa-chat-header .dqa-recipient-info span {
    font-family: var(--fuentePrincipalDash);
    font-size: 2rem;
    font-weight: 600;
}

/* ========================================= */
/* Message Rows */
/* ========================================= */
.dqa-message-row {
    display: flex;
    margin: 2rem 0;
}

.dqa-message-left {
    justify-content: flex-start;
}

.dqa-message-right {
    justify-content: flex-end;
}

/* ========================================= */
/* Message Bubbles */
/* ========================================= */
.dqa-message-bubble {
    position: relative;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 70%;
}

/* Burbuja del Mensaje Propio (Derecha) */
.dqa-own-message {
    background-color: var(--colorVerde4);
    color: #000;
    margin-right: 1rem;
    border-top-right-radius: 0;
}

/* Burbuja del Mensaje del Otro (Izquierda) */
.dqa-other-message {
    background-color: var(--colorLavandaClaro);
    color: #000;
    margin-left: 1rem;
    border-top-left-radius: 0;
}

/* ========================================= */
/* Message Bubble Tails (Cabecitas) */
/* ========================================= */

/* Cabecita para mensajes de OTROS (Izquierda) */
.dqa-other-message::before {
    content: "";
    position: absolute;
    top: 0;
    left: -1rem;
    width: 0;
    height: 0;
    border: 1rem solid transparent;
    border-right-color: var(--colorLavandaClaro);
    border-left: 0;
    border-top: 0;
}

/* Cabecita para mensajes PROPIOS (Derecha) */
.dqa-own-message::before {
    content: "";
    position: absolute;
    top: 0;
    right: -1rem;
    width: 0;
    height: 0;
    border: 1rem solid transparent;
    border-left-color: var(--colorVerde4);
    border-right: 0;
    border-top: 0;
}

/* ========================================= */
/* Message Footer (Hora y Botones) */
/* ========================================= */
.dqa-message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 5px;
}

.dqa-message-time {
    font-size: 0.75em;
    color: #666;
}

/* Botón de eliminar */
.dqa-message-footer .dqa-delete-btn {
    background-color: transparent;
    border: transparent;
}

.dqa-message-footer .dqa-delete-btn:hover,
.dqa-message-footer .dqa-delete-btn:focus {
    background-color: transparent;
}

/* ========================================= */
/* Estado de Lectura (Visto) */
/* ========================================= */
.dqa-read-status {
    font-size: 0.7em;
    margin-left: 5px;
}

/* Mensajes enviados o recibidos (no leídos) */
.dqa-read-status.dqa-sent {
    color: #A0A0A0;
}

/* Mensajes leídos por el receptor */
.dqa-read-status.dqa-read {
    color: #4CAF50;
}

/* ========================================= */
/* Área de Mensajes (Container con scroll) */
/* ========================================= */
#dqa-messages-area {
    max-height: 80rem;
    overflow-y: auto;
}

/* ========================================= */
/* Área de Entrada del Chat */
/* ========================================= */
.dqa-chat-input-area {
    position: relative;
    display: flex;
    padding: 10px 15px;
    background-color: #f7f7f7;
    border-top: 1px solid #eee;
}

/* Textarea (Campo de entrada) */
#dqa-chat-message-input {
    flex-grow: 1;
    width: 100%;
    border: none;
    border-radius: 25px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 10px 60px 10px 20px;
    min-height: 40px;
    max-height: 100px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
}

#dqa-chat-message-input:focus {
    outline: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Botón de Envío (Dentro de la burbuja) */
.dqa-send-message-btn {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border: none;
    border-radius: 50%;
    background-color: #6a6ad4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.dqa-send-message-btn:hover {
    background-color: #5858c4;
}

.dqa-send-message-btn:disabled {
    background-color: #b0b0b0;
    cursor: not-allowed;
}

.dqa-send-message-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* ========================================= */
/* Skeleton Loading */
/* ========================================= */
.dqa-skeleton-message {
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 15px;
    margin-bottom: 8px;
    animation: pulse-bg 1.5s infinite;
    -webkit-animation: pulse-bg 1.5s infinite;
}

.dqa-skeleton-row {
    display: flex;
    margin-bottom: 20px;
}

.dqa-skeleton-row.left {
    justify-content: flex-start;
}

.dqa-skeleton-row.right {
    justify-content: flex-end;
}

.dqa-skeleton-row .dqa-skeleton-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #cfcfcf;
    margin-right: 10px;
    margin-left: 10px;
    animation: pulse-bg 1.5s infinite;
    -webkit-animation: pulse-bg 1.5s infinite;
}

.dqa-skeleton-bubble {
    display: flex;
    flex-direction: column;
    padding: 10px;
    min-width: 150px;
    max-width: 60%;
    background-color: #f0f0f0;
    border-radius: 10px;
    position: relative;
    animation: pulse-bubble-bg 1.5s infinite;
    -webkit-animation: pulse-bubble-bg 1.5s infinite;
}

.dqa-skeleton-bubble.left {
    margin-right: auto;
}

.dqa-skeleton-bubble.right {
    margin-left: auto;
}

/* Animaciones de pulso */
@keyframes pulse-bg {
    0% { background-color: #e0e0e0; }
    50% { background-color: #f0f0f0; }
    100% { background-color: #e0e0e0; }
}

@-webkit-keyframes pulse-bg {
    0% { background-color: #e0e0e0; }
    50% { background-color: #f0f0f0; }
    100% { background-color: #e0e0e0; }
}

@keyframes pulse-bubble-bg {
    0% { background-color: #f0f0f0; }
    50% { background-color: #e8e8e8; }
    100% { background-color: #f0f0f0; }
}

@-webkit-keyframes pulse-bubble-bg {
    0% { background-color: #f0f0f0; }
    50% { background-color: #e8e8e8; }
    100% { background-color: #f0f0f0; }
}
