/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2a2a2a;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* Classes do mockup de celular removidas */

/* Container principal do chat */
.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-image: url('../img/background-whatsapp.png?v=2.0');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    position: relative;
}

/* Header do chat */
.chat-header {
    background-color: #f7f8fa;
    color: #111b21;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #d1d7db;
    min-height: 74px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

.back-arrow {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #54656f;
    margin-right: 8px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ff69b4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 400;
    color: #111b21;
    margin: 0;
    line-height: 1.2;
}

.user-status {
    font-size: 13px;
    color: #667781;
    margin: 0;
    line-height: 1.2;
}

.header-actions {
    display: flex;
    gap: 20px;
}

.header-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #54656f;
}

.header-icon:hover {
    color: #111b21;
}

/* Área de Mensagens */
.messages-area {
    flex: 1;
    padding: 92px 10px 85px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    background-image: url('../img/background-whatsapp.png?v=2.0');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 70vh;
}



/* Mensagens */
.message {
    max-width: 75%; /* Largura máxima aumentada */
    word-wrap: break-word;
    position: relative;
    margin-bottom: 0px; /* Margin reduzida para 4px */
}

.message.sent {
    align-self: flex-end;
    margin-left: 60px; /* Margin reduzida para dar mais espaço */
}

.message.received {
    align-self: flex-start;
    margin-right: 60px; /* Margin reduzida para dar mais espaço */
}

.message-bubble {
    padding: 10px 10px 10px 10px;
    border-radius: 8px; /* Menos arredondado */
    position: relative;
    box-shadow: 0 2px 1px rgba(0, 0, 0, 0.13);
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Padding reduzido para mensagens com imagens */
.message-bubble:has(.image-container) {
    padding: 4px;
}

.message.sent .message-bubble {
    background-color: #dcf8c6;
    border-radius: 12px 12px 1px 12px;
}

.message.received .message-bubble {
    background-color: #ffffff;
    border-radius: 12px 12px 12px 1px;
}



.message-text {
    font-size: 14.2px;
    line-height: 19px;
    color: #111b21;
    margin-bottom: 0;
    word-wrap: break-word;
    flex: 1;
}

.message-time {
    font-size: 11px;
    color: #667781;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.message.sent .message-time {
    color: #667781;
}

.message-status {
    width: 16px;
    height: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.message-status.read {
    color: #53bdeb;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAACd0lEQVR4nO2ZP4gTQRSH1/8Ieh77ZrVQsFBBrCxEi2sEBZGzUFFEsLC6Rq4QFDT73m11rZYWh4WNWGqnhYWC1dkIinIq3r6XBA5EFERFT1cmgprZNZfw4iTFfDDdl2R+k5k3s7NRFAgEAoFAYLgwWD9iUBqGmA3J4X65XolrvBdQPhuS4ldj7ofrlbjGm4Gk+adjrc7Na12vbDnPaw3JrNOxH2YqP6VxPVMsA5Sb7R2TApCnda5nDPGU2zGDcjvKiuUa1ysx8TGD/N3p2LM4mxvRuF5JsvpuIP7ozPW3SZpv07he2Xj59SaDnDvT5Cuksl/j+iV7uhpIHpTmOsmEyvUNkMyUqg7xFa3rFUC+WDG696KsWKlxvZIQHzLEi86CfbEhezOqcb0CWWOnIXnvjO47g7JD43plJOMYUF6213/+BlQ/oHH9MvF4lSG+X1qwKZ9Tub4xyNfKVUeua12vJClPlg938tDuDRq3I/bpyiCLbYB8NFISp/WDdm47o/tq/aU6aNwlaYX4a3Fpzva2urSqTPvh7kOcze/SuL0HUYSxdd4gP3fqv90PxjVu19jp5P69PYc5WawAlLsVR4oLKrdXEpQTpTDEi4ByppvPA/LV8pGCb2hdr2ESzM9WjO6j7ZNzazSu1zAJNcaA5IszLXP7HKFxvYYZTZtbAXnBKZ2foJbvcb+zF9drmCRbWAfIT7q5lunF/S/YH6quZnzakNwpLVhkcjfYGOV4J9cbpipMRQOUW/beqXJf6uAOW5hZewP42+8cpM0dmjBA0rR3sUtusP9wB0LiFAB7Gx6T7NO6AwHsaLfeR7TeSYz3yw0EAoFAIBowPwEyZ3XZgujkhwAAAABJRU5ErkJggg==');
    background-repeat: no-repeat;
    background-size: 16px 16px;
    background-position: center;
    text-indent: -9999px;
    width: 16px;
    height: 16px;
    display: inline-block;
}

/* Mensagens de áudio */
.audio-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-width: 200px;
}

.audio-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #128c7e;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.audio-play-btn::before {
    content: '▶';
    color: white;
    font-size: 12px;
    margin-left: 2px;
}

.audio-waveform {
    flex: 1;
    height: 32px;
    background: linear-gradient(90deg, #128c7e 0%, #128c7e 30%, #d1d7db 30%, #d1d7db 100%);
    border-radius: 16px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.audio-duration {
    font-size: 11px;
    color: #667781;
    margin-left: 8px;
    flex-shrink: 0;
}

.message.received .audio-play-btn {
    background-color: #667781;
}

.message.received .audio-waveform {
    background: linear-gradient(90deg, #667781 0%, #667781 30%, #d1d7db 30%, #d1d7db 100%);
}

/* Input de Mensagem */
.message-input-container {
    padding: 12px 12px;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 0 4px;
    gap: 4px;
    position: relative;
    width: 100%;
    min-height: 60px;
}

.message-input {
    width: 85%;
    padding: 10px 8px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    color: #3b4a54;
    resize: none;
    max-height: 100px;
    min-height: 20px;
    line-height: 20px;
    box-sizing: border-box;
}

.message-input::placeholder {
    color: #8696a0;
}



.input-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: #8696a0;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.input-icon:hover {
    /* Sombra removida conforme solicitado */
}

.microphone-icon,
.send-icon {
    background: #00a884;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    min-height: 50px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    padding: 10px;
    flex-shrink: 0;
    margin: 0;
    position: relative;
    box-sizing: border-box;
}

.microphone-icon img,
.send-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    display: block;
    margin: auto;
}

.microphone-icon:hover,
.send-icon:hover {
    background: #008f6f;
}



/* Scrollbar personalizada */
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* File message styles */
.image-container {
    margin-bottom: 8px;
}

.image-preview {
    max-width: 200px;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.image-preview:hover {
    opacity: 0.9;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

.document-preview .document-icon {
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-size {
    display: block;
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 8px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: inherit;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Media queries removidas conforme solicitado - usando padrão único para todas as resoluções */

/* Estilos para mensagem de áudio */
.message.received .message-bubble.audio-message {
    background-color: #ffffff;
    padding: 10px 14px;
    border-radius: 12px 12px 12px 1px;
    min-width: 200px;
    max-width: 250px;
    overflow: hidden;
    box-sizing: border-box;
}

.message.sent .message-bubble.audio-message {
    background-color: #dcf8c6;
    padding: 10px 14px;
    border-radius: 12px 12px 1px 12px;
    min-width: 200px;
    max-width: 250px;
    overflow: hidden;
    box-sizing: border-box;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.play-button {
    background: #54656f;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
    position: relative;
}

.play-button:hover {
    background: #3c4a54;
}

.play-button svg {
    width: 16px;
    height: 16px;
    color: white;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.audio-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
}

.waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
    margin-bottom: 2px;
    position: relative;
}

.wave-bar {
    width: 3px;
    background-color: #d1d7db;
    border-radius: 1.5px;
    transition: all 0.3s ease;
}

.wave-bar:nth-child(1) { height: 8px; }
.wave-bar:nth-child(2) { height: 12px; }
.wave-bar:nth-child(3) { height: 6px; }
.wave-bar:nth-child(4) { height: 14px; }
.wave-bar:nth-child(5) { height: 10px; }
.wave-bar:nth-child(6) { height: 16px; }
.wave-bar:nth-child(7) { height: 8px; }
.wave-bar:nth-child(8) { height: 18px; }
.wave-bar:nth-child(9) { height: 12px; }
.wave-bar:nth-child(10) { height: 6px; }
.wave-bar:nth-child(11) { height: 14px; }
.wave-bar:nth-child(12) { height: 10px; }
.wave-bar:nth-child(13) { height: 16px; }
.wave-bar:nth-child(14) { height: 8px; }
.wave-bar:nth-child(15) { height: 12px; }
.wave-bar:nth-child(16) { height: 6px; }
.wave-bar:nth-child(17) { height: 14px; }
.wave-bar:nth-child(18) { height: 10px; }
.wave-bar:nth-child(19) { height: 8px; }
.wave-bar:nth-child(20) { height: 12px; }

.wave-bar.active {
    background-color: #4fc3f7;
}

.progress-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #4fc3f7;
    border-radius: 50%;
    transition: left 0.1s ease;
    z-index: 10;
    box-shadow: 0 0 4px rgba(79, 195, 247, 0.5);
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #667781;
}

.current-time {
    font-weight: 400;
}

.total-duration {
    font-weight: 400;
}

.audio-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.audio-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Animação das barras de onda durante reprodução */
.audio-player.playing .wave-bar {
    animation: waveAnimation 1.5s ease-in-out infinite;
}

.audio-player.playing .wave-bar:nth-child(odd) {
    animation-delay: 0.1s;
}

.audio-player.playing .wave-bar:nth-child(even) {
    animation-delay: 0.3s;
}

@keyframes waveAnimation {
    0%, 100% {
        transform: scaleY(1);
        background-color: #d1d7db;
    }
    50% {
        transform: scaleY(1.5);
        background-color: #4fc3f7;
    }
}

/* Indicador de digitação */
.typing-indicator {
    padding: 2px 0;
    font-size: 12px;
    color: #667781;
    display: block;
    width: 100%;
    margin-top: 2px;
    clear: both;
    line-height: 1.2;
}

.typing-text {
    font-weight: 400;
    display: inline;
}

.typing-dots {
    font-weight: 600;
    color: #00a884;
    display: inline;
}

/* Balãozinho com bolinhas animadas - como mensagem recebida */
.typing-bubble {
    background: #ffffff;
    border-radius: 8px 8px 8px 4px; /* Menos arredondado */
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    align-self: flex-start;
    position: relative;
    opacity: 0.7; /* Opacity para ficar mais cinza */
}

.bouncing-balls {
    width: 50px;
    height: 16px;
    display: block;
}

.ball {
    fill: #666666; /* Cor mais cinza para as bolinhas */
    transform-origin: center;
}

/* Animação de pulo das bolinhas */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Aplicação da animação com delays sequenciais */
.ball-1 {
    animation: bounce 0.6s infinite ease-in-out 0s;
}

.ball-2 {
    animation: bounce 0.6s infinite ease-in-out 0.2s;
}

.ball-3 {
    animation: bounce 0.6s infinite ease-in-out 0.4s;
}