/* Chatbot do Doutor - Odonto Peres */

.chatbot-container {
    position: fixed;
    bottom: 160px;
    right: 30px;
    width: 380px;
    max-height: 600px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: #000a5b;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chatbot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
    line-height: 1;
    padding: 0;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    max-height: 400px;
    scroll-behavior: smooth;
}

.chatbot-messages:hover {
    cursor: default;
}

.bot-message,
.user-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message p {
    background: #fff;
    color: #333;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    margin: 5px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.5;
}

.user-message p {
    background: #000a5b;
    color: #fff;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    margin: 5px 0 5px auto;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
}

.chatbot-options {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.chatbot-option-btn {
    background: #fff;
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-option-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.chatbot-option-btn:hover {
    background: #000a5b;
    color: #fff;
    border-color: #000a5b;
    transform: translateX(5px);
}

.chatbot-option-btn:hover .chatbot-option-icon {
    filter: brightness(0) invert(1);
}

/* Scrollbar customizada */
.chatbot-messages::-webkit-scrollbar,
.chatbot-options::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track,
.chatbot-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb,
.chatbot-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover,
.chatbot-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Indicador de digitação */
.typing-indicator p {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #000a5b;
    border-radius: 50%;
    display: inline-block;
    animation: typingDot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 140px;
        max-height: 500px;
    }
    
    .chatbot-messages {
        max-height: 300px;
    }
    
    .chatbot-options {
        max-height: 180px;
    }
}
