* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #efeae2;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Evita scroll horizontal */
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header Android Style */
.chat-header {
    background-color: #ffffff;
    color: #333;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-icon { 
    font-size: 22px; 
    color: #54656f;
    margin-right: 5px;
}

.profile-pic {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    display: flex;
    flex-direction: column;
    margin-left: 5px;
}

.contact-name {
    font-weight: 500;
    font-size: 17px;
    color: #111b21;
}

.contact-status {
    font-size: 13px;
    color: #667781;
}

.header-right {
    display: flex;
    gap: 22px;
    color: #54656f;
}

/* Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-divider {
    text-align: center;
    background: #D1E9F1;
    color: #555;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 8px;
    width: fit-content;
    margin: 10px auto;
}

.message-bubble {
    max-width: 85%;
    padding: 8px 12px 14px 12px; /* Aumentado padding para evitar overlap */
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.message-bubble.system {
    background: #d1f4f1;
    color: #111b21;
    align-self: center;
    text-align: center;
    font-size: 13px;
    margin: 10px 0;
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: none;
    max-width: 90%;
}

.message-bubble.left {
    background: #d9fdd3;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.message-bubble.right {
    background: #ffffff;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.msg-time {
    font-size: 10px;
    color: #999;
    float: right;
    margin-top: 5px;
    margin-left: 8px;
}

/* Audio Bubble Android Style */
.audio-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 260px; /* Largura fixa ideal para parecer real */
    max-width: 100%;
    padding: 5px 0;
}

.audio-meta {
    position: relative;
    width: 55px;
    height: 55px;
}

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

.audio-mic-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667781;
}

.audio-mic-icon svg {
    width: 12px;
    height: 12px;
}

.audio-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 5px;
}

.audio-play-btn {
    color: #54656f;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-top-row {
    display: flex;
    align-items: center;
}

.audio-progress-container {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
}

.audio-progress {
    height: 3px;
    background: #cbd5e1;
    border-radius: 2px;
    position: relative;
    width: 100%;
}

.audio-bar {
    height: 100%;
    background: #54656f;
    width: 0%;
}

.audio-bar::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #54656f;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

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

.speed-badge {
    background: #e9edef;
    color: #54656f;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.speed-badge:active {
    background: #d1d7db;
}

.msg-time {
    font-size: 11px;
    color: #667781;
    position: absolute;
    bottom: 5px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Footer Android Style */
.chat-footer {
    padding: 5px 8px 15px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    width: 100%;
}

.input-box {
    background: white;
    flex: 1;
    border-radius: 25px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    height: 48px;
    min-width: 0; /* Permite que o flex-item encolha */
}

.input-box input {
    border: none;
    flex: 1;
    font-size: 17px;
    background: transparent;
    color: #111b21;
}

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

.footer-icon {
    width: 24px;
    height: 24px;
    color: #8696a0;
    cursor: pointer;
}

.mic-btn {
    width: 48px;
    height: 48px;
    min-width: 48px; /* Evita achatar no mobile */
    min-height: 48px;
    flex-shrink: 0;
    background: #111b21;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.mic-btn svg {
    width: 24px;
    height: 24px;
}

/* Offer Overlay */
.offer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.offer-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.offer-card h3 {
    color: #075E54;
    margin-bottom: 15px;
}

.offer-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.offer-btn:active { transform: scale(0.95); }

.offer-btn.primary {
    background: #22C55E;
    color: white;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4);
}

.offer-btn.secondary {
    background: #22C55E;
    color: white;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4);
}

.offer-btn strong { font-size: 18px; margin-bottom: 4px; }
.offer-btn span { font-size: 13px; opacity: 0.9; }
