/* Chatbot de Pré-Atendimento - Dra. Débora Advocacia */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chatbot-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    position: relative;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/debora-avatar.jpg') center/cover;
    border-radius: 50%;
    opacity: 0.9;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    display: none;
}

.chatbot-toggle .online-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #25d366;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 2;
}

.chatbot-container {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-container.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2d5a3d;
    font-size: 18px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
}

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

.chatbot-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

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

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.chatbot-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.4;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

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

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

.chatbot-message.user {
    background: #25d366;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-option {
    background: white;
    border: 2px solid #25d366;
    color: #25d366;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-align: left;
}

.chatbot-option:hover {
    background: #25d366;
    color: white;
}

.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #25d366;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #25d366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-send:hover {
    background: #128c7e;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #25d366;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-10px); opacity: 1; }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 70vh;
        left: 0;
    }
}
