/* 
   Chat Estilo WhatsApp - Altycel Premium
   Estilos específicos para simular a interface do WhatsApp.
*/

:root {
    --wa-bg: #e5ddd5;
    --wa-bg-dark: #0b141a;
    --wa-bubble-in: #ffffff;
    --wa-bubble-out: #d9fdd3;
    --wa-bubble-in-dark: #202c33;
    --wa-bubble-out-dark: #005c4b;
    --wa-text: #111b21;
    --wa-text-dark: #e9edef;
    --wa-time: #667781;
    --wa-time-dark: #8696a0;
}

/* Fundo Doodle do WhatsApp */
.wa-chat-bg {
    background-color: var(--wa-bg);
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
    background-attachment: fixed;
}

body.light-theme .wa-chat-bg {
    background-color: #efeae2;
    filter: contrast(0.9);
}

body.dark-theme .wa-chat-bg {
    background-color: var(--wa-bg-dark);
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    filter: invert(1) opacity(0.05);
}

/* Balões de Mensagem */
.msg-container {
    display: flex;
    flex-direction: column;
    padding: 10px 5%;
    gap: 4px;
}

/* Estilos para Mídia */
.wa-bubble img {
    display: block;
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 5px;
}

.wa-doc-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.wa-doc-bubble:hover {
    background: rgba(0, 0, 0, 0.1);
}

.wa-audio-bubble audio {
    height: 32px;
    width: 220px;
    filter: sepia(20%) brightness(90%);
}

.wa-badge {
    background: #25D366;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.wa-bubble {
    position: relative;
    max-width: 65%;
    padding: 8px 12px 24px 12px;
    border-radius: 8px;
    font-size: 14.5px;
    line-height: 1.4;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
    word-wrap: break-word;
}

.wa-bubble.in {
    align-self: flex-start;
    background: var(--wa-bubble-in);
    color: var(--wa-text);
    border-top-left-radius: 0;
}

.wa-bubble.out {
    align-self: flex-end;
    background: var(--wa-bubble-out);
    color: var(--wa-text);
    border-top-right-radius: 0;
}

.wa-bubble .time {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 11px;
    color: var(--wa-time);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Status Visto (Checks) */
.wa-check {
    font-size: 16px;
    color: #8696a0; /* Cinza para enviado/entregue */
    margin-left: 4px;
}

.wa-check.read {
    color: #53bdeb; /* Azul do WhatsApp para lido */
}

/* Seletor de Emojis */
.emoji-picker-container {
    position: absolute;
    bottom: 80px;
    left: 20px;
    z-index: 2000;
}

/* Dark Mode Overrides */
body.dark-theme .wa-bubble.in {
    background: var(--wa-bubble-in-dark);
    color: var(--wa-text-dark);
}

body.dark-theme .wa-bubble.out {
    background: var(--wa-bubble-out-dark);
    color: var(--wa-text-dark);
}

body.dark-theme .wa-bubble .time {
    color: var(--wa-time-dark);
}
