/* RESET E BASE */
* {
    box-sizing: border-box;
}

/* CONTAINER PRINCIPAL DO CHAT */
.ai-chat-container {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ai-chat-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-chat-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* BOTÃO FLUTUANTE */
.ai-chat-button {
    position: relative;
    min-width: 200px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0 20px;
    animation: bounce 2s infinite;
}

.ai-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
    animation: none;
}

.ai-chat-button-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-button-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.ai-chat-button-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.ai-chat-button-subtitle {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* WIDGET DO CHAT */
.ai-chat-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.ai-chat-widget.show {
    transform: translateY(0);
    opacity: 1;
}

/* CABEÇALHO DO CHAT */
.ai-chat-header {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ai-chat-header-text p,
.ai-chat-datetime,
#ai-chat-datetime {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: white !important;
    opacity: 1 !important;
    font-weight: 500;
}

.ai-chat-minimize-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.ai-chat-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ÁREA DE MENSAGENS */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

/* MENSAGENS */
.ai-chat-message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeInUp 0.3s ease;
}

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

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

.ai-chat-message-content {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.ai-chat-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.ai-chat-message-bot .ai-chat-message-bubble {
    background: white;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-chat-message-user .ai-chat-message-bubble {
    background: #007cba;
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.ai-chat-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    opacity: 0.7;
}

.ai-chat-message-bot .ai-chat-message-time {
    text-align: left;
}

.ai-chat-message-user .ai-chat-message-time {
    text-align: right;
}

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

/* BOTÕES PEQUENOS - LAYOUT WHATSAPP */
.ai-chat-small-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 0;
}

.ai-chat-small-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0, 124, 186, 0.2);
}

.ai-chat-small-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.3);
}

.ai-chat-small-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 124, 186, 0.2);
}

/* BOTÕES VERTICAIS - ALINHADOS UM ABAIXO DO OUTRO */
.ai-chat-vertical-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 0;
}

.ai-chat-vertical-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.2);
    width: 100%;
    text-align: left;
}

.ai-chat-vertical-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 124, 186, 0.3);
}

.ai-chat-vertical-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.2);
}

/* RESPOSTAS RÁPIDAS */
.ai-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.ai-chat-quick-reply {
    padding: 4px 10px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    color: #495057;
    white-space: nowrap;
    line-height: 1.2;
}

.ai-chat-quick-reply:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
    transform: translateY(-1px);
}

/* BOTÃO WHATSAPP */
.ai-chat-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
    box-shadow: 0 1px 3px rgba(37, 211, 102, 0.2);
}

.ai-chat-whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

/* ÁREA DE INPUT */
.ai-chat-input-area {
    border-top: 1px solid #eee;
    padding: 15px;
    background: white;
}

.ai-chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 100px;
}

.ai-chat-input:focus {
    border-color: #007cba;
}

.ai-chat-send-btn {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-chat-send-btn:hover {
    background: #005a87;
    transform: scale(1.05);
}

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

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

/* RESPONSIVIDADE */
@media (max-width: 480px) {
    .ai-chat-widget {
        width: calc(100vw - 40px);
        height: 70vh;
        bottom: 80px;
        right: -10px;
    }
    
    .ai-chat-container.bottom-left .ai-chat-widget {
        left: -10px;
        right: auto;
    }
    
    .ai-chat-small-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .ai-chat-quick-reply {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .ai-chat-whatsapp-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* LOADING */
.ai-chat-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ai-chat-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

