/* Solo2 Component: Message Bubbles (Premium Geometry) */

.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 2px;
    animation: messageFadeIn 0.2s ease-out forwards;
}

.message-row.sent { justify-content: flex-end; }
.message-row.received { justify-content: flex-start; }

/* Espaciado contextual */
.message-row.different-sender { margin-top: 12px; }
.message-row.same-sender { margin-top: 4px; }

.message-bubble {
    max-width: 75%;
    padding: 8px 14px;
    position: relative;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Burbuja Enviada */
.message-bubble.sent {
    background-color: var(--color-primary);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

/* Burbuja Recibida */
.message-bubble.received {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-radius: 18px 18px 18px 4px;
}

/* Rabitos (Tails) */
.message-row.different-sender.sent .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 12px;
    height: 18px;
    background: var(--color-primary);
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

.message-row.different-sender.received .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 12px;
    height: 18px;
    background: var(--color-surface);
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

/* Metadatos */
.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 4px;
}

.msg-time { font-family: monospace; }

/* Viñeta: Umbral del Túnel */
#chat-area {
    position: relative;
}

#chat-area::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 60px 10px rgba(0,0,0,0.15);
    z-index: 5;
}

@keyframes messageFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}