/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0a;
    height: 100vh;
    overflow: hidden;
}

/* Container Principal do WhatsApp */
.whatsapp-container {
    width: 100%;
    height: 100vh;
    background: #e5ddd5;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Padrão de Doodles no Fundo */
.whatsapp-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext x='10' y='20' font-size='12' fill='%23ffffff' opacity='0.1'%3E😊%3C/text%3E%3Ctext x='80' y='30' font-size='10' fill='%23ffffff' opacity='0.1'%3E❤️%3C/text%3E%3Ctext x='20' y='60' font-size='8' fill='%23ffffff' opacity='0.1'%3E🚗%3C/text%3E%3Ctext x='70' y='70' font-size='14' fill='%23ffffff' opacity='0.1'%3E🍕%3C/text%3E%3Ctext x='50' y='40' font-size='6' fill='%23ffffff' opacity='0.1'%3E📚%3C/text%3E%3Ctext x='30' y='80' font-size='10' fill='%23ffffff' opacity='0.1'%3E📷%3C/text%3E%3Ctext x='90' y='50' font-size='8' fill='%23ffffff' opacity='0.1'%3E🚁%3C/text%3E%3Ctext x='60' y='20' font-size='12' fill='%23ffffff' opacity='0.1'%3E🦕%3C/text%3E%3C/svg%3E");
    background-size: 200px 200px;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

/* Header do WhatsApp */
.whatsapp-header {
    background: #075e54;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 10;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    margin-right: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

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

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

.contact-details h3 {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.verified-badge {
    color: #4fc3f7;
    font-size: 16px;
}

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

.action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Área de Mensagens */
.whatsapp-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whatsapp-messages::-webkit-scrollbar {
    width: 4px;
}

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

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

/* Mensagens */
.message {
    display: flex;
    margin-bottom: 4px;
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.bot-message .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-message .message-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #303030;
}

.user-message .message-bubble p {
    color: #303030;
}

.message-time {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: #667781;
}

.message-time span {
    font-size: 11px;
}

.message-time i {
    font-size: 10px;
}

.message-time i.read {
    color: #4fc3f7;
}

/* Container de vídeo */
.video-container {
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-container iframe,
.video-container video {
    border-radius: 12px;
    display: block;
}

/* Botões de Resposta */
.response-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    padding: 0 16px;
}

.response-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.response-btn:hover {
    border-color: #25d366;
    background: #f8fff8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.response-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Área de Input */
.whatsapp-input {
    background: #f0f0f0;
    padding: 8px 16px;
    border-top: 1px solid #e0e0e0;
    z-index: 10;
    position: relative;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 25px;
    padding: 8px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

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

.input-wrapper {
    flex: 1;
}

#messageInput {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    background: transparent;
    color: #303030;
}

#messageInput::placeholder {
    color: #999;
}

.send-btn {
    background: #25d366;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #128c7e;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Indicador de Digitação */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 80px;
}

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

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

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

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

/* Animações */
.message {
    animation: messageSlide 0.3s ease-out;
}

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

/* Responsividade */
@media (max-width: 480px) {
    .whatsapp-container {
        height: 100vh;
        height: 100dvh; /* Para dispositivos móveis */
    }
    
    .whatsapp-header {
        height: 56px;
        padding: 0 12px;
    }
    
    .whatsapp-messages {
        padding: 12px;
    }
    
    .whatsapp-input {
        padding: 6px 12px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* Modal de Vídeo */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.video-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #075e54;
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.video-options {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.option-btn {
    flex: 1;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.option-btn:hover {
    border-color: #25d366;
    background: #f8fff8;
    transform: translateY(-2px);
}

.option-btn.active {
    border-color: #25d366;
    background: #25d366;
    color: white;
}

.option-btn i {
    font-size: 24px;
}

.video-form {
    margin-top: 20px;
}

.video-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.video-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.video-form input:focus {
    outline: none;
    border-color: #25d366;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #128c7e;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Barra de navegação inferior (para mobile) */
@media (max-width: 480px) {
    body::after {
        content: '';
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #999;
        border-radius: 2px;
        z-index: 1000;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .video-options {
        flex-direction: column;
    }
}