/* ================== Chatbot Premium v2 ================== */
.chatbot-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    font-family: 'Poppins', sans-serif;
    will-change: transform;
}

@media (max-width: 639px) {
    .chatbot-container {
        bottom: 1rem;
        right: 1rem;
        will-change: auto !important;
    }

    .chatbot-toggle {
        width: 56px;
        /* reducido de 70px */
        height: 56px;
        /* reducido de 70px */
    }

    .chatbot-toggle i {
        font-size: 20px;
        /* reducido */
    }
}

.chatbot-toggle {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: var(--transition-all);
}

.chatbot-toggle i {
    font-size: 24px;
    color: white;
}

.chatbot-toggle:hover {
    transform: scale(1.15) rotateZ(15deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.chatbot-window {
    width: 480px;
    max-width: min(480px, calc(100vw - 2rem));
    height: 600px;
    max-height: calc(100dvh - 8rem);
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: none;
    flex-direction: column;
    opacity: 0;
    position: fixed;
    bottom: 120px;
    right: 1.5rem;
    transform: translateY(30px);
    z-index: 2000;
}

.dark .chatbot-window {
    background: #1f2937;
    border-color: #374151;
}

@media (max-width: 639px) {
    .chatbot-window {
        position: fixed !important;
        right: 1rem !important;
        left: auto !important;
        transform: translateY(0) !important;
        width: 90vw !important;
        max-width: 360px !important;
        bottom: 80px !important;
        height: auto !important;
        max-height: calc(100dvh - 140px) !important;
        min-height: 400px;
        border-radius: 20px;
    }

    .chatbot-window.active {
        transform: translateY(0) !important;
    }

    .chatbot-header {
        padding: 12px 15px;
        border-radius: 20px 20px 0 0;
    }

    .chatbot-header h3 {
        font-size: 1rem;
    }

    .chatbot-messages {
        padding: 12px;
        max-height: 300px;
        min-height: 200px;
    }

    .chatbot-input {
        padding: 10px;
        gap: 8px;
    }

    .chatbot-input input {
        padding: 10px 14px;
        font-size: 14px;
        min-width: 0;
        flex: 1;
    }

    .chatbot-input button {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin-left: 8px;
    }
}

.chatbot-window.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.chatbot-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 25px 25px 0 0;
}

.chatbot-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    color: white;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chatbot-close:hover {
    transform: rotate(90deg) scale(1.2);
}

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

.dark .chatbot-messages {
    background: #111827;
}

.message {
    margin-bottom: 15px;
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    animation: messageSlideIn 0.4s var(--transition-medium);
    white-space: pre-wrap;
}

.bot-message {
    background: #e5e7eb;
    color: #1f2937;
    border-top-left-radius: 5px;
    align-self: flex-start;
    white-space: normal;
}

.dark .bot-message {
    background: #374151;
    color: #f9fafb;
}

.bot-message strong {
    color: #1e3a8a;
}

.dark .bot-message strong {
    color: #93c5fd;
}

p.bot-message-title {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
    padding: 0;
    line-height: 1.4;
}

.user-message {
    background: var(--primary-gradient);
    color: white;
    border-top-right-radius: 5px;
    margin-left: auto;
}

.chatbot-input {
    display: flex;
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.dark .chatbot-input {
    background: #1f2937;
    border-color: #374151;
    transition: border-color 0.3s ease;
}

.chatbot-input input {
    flex-grow: 1;
    padding: 12px 18px;
    border: 1px solid #d1d5db;
    border-radius: 25px;
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    color: #1f2937;
    background: #f9fafb;
}

.dark .chatbot-input input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.chatbot-input input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: #ffffff;
}

.dark .chatbot-input input:focus {
    background: #1f2937;
    border-color: #60a5fa;
}

.chatbot-input button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    margin-left: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition-fast);
}

.chatbot-input button:hover {
    transform: scale(1.1) rotateZ(15deg);
}

.chatbot-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    color: #3a47d5;
    border: 1.5px solid rgba(58, 71, 213, 0.3);
    border-radius: 1.25rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    text-align: left;
    width: 100%;
    box-shadow: 0 2px 4px rgba(58, 71, 213, 0.08);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

.quick-reply::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f0eb';
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.quick-reply:nth-child(2)::before {
    content: '\f0e7';
}

.quick-reply:nth-child(3)::before {
    content: '\f080';
}

.quick-reply:hover {
    background: linear-gradient(135deg, #3a47d5 0%, #5a67e8 100%);
    color: white;
    transform: translateX(4px);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(58, 71, 213, 0.25);
}

.typing-indicator {
    display: flex;
    padding: 12px 18px;
    background: #e5e7eb;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 15px;
    align-items: center;
    align-self: flex-start;
}

.dark .typing-indicator {
    background: #374151;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #64748b;
    border-radius: 50%;
    display: inline-block;
    margin: 0 3px;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

@keyframes typingBounce {

    0%,
    100% {
        transform: translateY(0);
        background: #94a3b8;
    }

    50% {
        transform: translateY(-8px);
        background: #64748b;
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}