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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.whatsapp-container {
    background: #fff;
    width: 100%;
    max-width: 480px;
    height: 90vh;
    min-height: 600px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header do WhatsApp */
.whatsapp-header {
    background: #128c7e;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.contact-details h1 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.status {
    font-size: 12px;
    opacity: 0.8;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #4fc3f7;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat container */
.chat-container {
    flex: 1;
    background: #e5ddd5;
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 15px 100px;
    scroll-behavior: smooth;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mensagens */
.message {
    max-width: 85%;
    padding: 12px 16px 8px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message.loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.message.received {
    background: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.sent {
    background: #dcf8c6;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

.message.received .message-time {
    text-align: left;
}

/* Formatação do texto */
.message strong {
    font-weight: 600;
    color: #2d3748;
}

.message .emoji {
    font-size: 16px;
}

.service-item {
    margin: 8px 0;
    padding: 8px 0;
    border-left: 3px solid #128c7e;
    padding-left: 12px;
    background: rgba(18, 140, 126, 0.05);
    border-radius: 0 8px 8px 0;
}

/* CTAs fixos */
.cta-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: linear-gradient(to top, rgba(255,255,255,0.98) 70%, transparent);
    padding: 15px 20px 20px;
    display: flex;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.cta-whatsapp,
.cta-tiktok {
    flex: 1;
    padding: 14px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cta-whatsapp {
    background: #25d366;
    color: white;
    flex: 2;
}

.cta-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.cta-tiktok {
    background: #000;
    color: white;
}

.cta-tiktok:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .whatsapp-container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    
    .chat-container {
        padding: 15px 10px 120px;
    }
    
    .message {
        max-width: 90%;
        padding: 10px 14px 6px;
        font-size: 14px;
    }
    
    .cta-container {
        max-width: 100%;
        padding: 15px 15px 25px;
        gap: 8px;
    }
    
    .cta-whatsapp,
    .cta-tiktok {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .whatsapp-header {
        padding: 12px 15px;
    }
    
    .contact-details h1 {
        font-size: 15px;
    }
    
    .status {
        font-size: 11px;
    }
    
    .message {
        font-size: 13px;
        padding: 8px 12px 6px;
    }
    
    .cta-whatsapp,
    .cta-tiktok {
        padding: 10px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .cta-whatsapp svg,
    .cta-tiktok svg {
        width: 18px;
        height: 18px;
    }
}

/* Animações suaves para hover em desktop */
@media (hover: hover) {
    .message:hover {
        transform: scale(1.01);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .message.received:hover {
        box-shadow: 0 4px 12px rgba(18, 140, 126, 0.1);
    }
}

/* Estados de carregamento e digitação */
.typing-indicator {
    background: #fff !important;
    padding: 16px 18px 12px !important;
}

.typing-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.loading-dots {
    display: inline-block;
    width: 40px;
    text-align: center;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
