/* chatbot.css */

:root {
    --ak-primary: #111827;
    --ak-primary-2: #1f2937;
    --ak-accent: #c9a86a;
    --ak-bg: #ffffff;
    --ak-soft: #f3f4f6;
    --ak-text: #111827;
    --ak-text-soft: #6b7280;
    --ak-border: #e5e7eb;
    --ak-success: #10b981;
    --ak-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    --ak-radius-xl: 20px;
    --ak-radius-lg: 16px;
    --ak-radius-md: 12px;
    --ak-fab-bottom: 40px;
    --ak-fab-size: 64px;
    --ak-fab-left: 30px;
    --ak-fab-right: 30px;
}


#ak-chatbot-root {
    position: fixed;
    left: var(--ak-fab-left);
    bottom: var(--ak-fab-bottom);
    z-index: 99999;
    font-family: Arial, Helvetica, sans-serif;
}

.ak-chatbot-toggle {
    width: var(--ak-fab-size);
    height: var(--ak-fab-size);
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ak-primary), var(--ak-primary-2));
    color: #fff;
    cursor: pointer;
    box-shadow: var(--ak-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ak-chatbot-toggle:hover {
    transform: translateY(-2px);
}

.ak-chatbot-toggle svg {
    width: 28px;
    height: 28px;
}

.ak-chatbot-panel {
    position: fixed;
    left: 50%;
    bottom: calc(var(--ak-fab-bottom) + var(--ak-fab-size) + 0px);
    width: 550px;
    max-width: calc(100vw - 24px);
    height: 500px;
    background: var(--ak-bg);
    border-radius: var(--ak-radius-xl);
    box-shadow: var(--ak-shadow);
    overflow: hidden;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;

    transition:
        opacity .3s ease,
        transform .3s ease,
        visibility .3s ease;
    flex-direction: column;
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.ak-chatbot-panel.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.ak-chatbot-header {
    background: linear-gradient(135deg, var(--ak-primary), var(--ak-primary-2));
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ak-chatbot-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ak-chatbot-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ak-chatbot-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.ak-chatbot-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
}

.ak-chatbot-close {
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.9;
}

.ak-chatbot-close svg {
    width: 20px;
    height: 20px;
}

.ak-chatbot-body {
    flex: 1;
    background: #fafafa;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ak-chatbot-message-row {
    display: flex;
}

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

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

.ak-chatbot-message {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.45;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.ak-chatbot-message.bot {
    background: #eceff3;
    color: var(--ak-text);
    border-bottom-left-radius: 6px;
}

.ak-chatbot-message.bot a {
    color: var(--ak-accent);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.ak-chatbot-message.bot a:hover {
    color: #1f2937;
}

.ak-chatbot-message.user {
    background: linear-gradient(135deg, var(--ak-primary), var(--ak-primary-2));
    color: #fff;
    border-bottom-right-radius: 6px;
}

.ak-chatbot-typing {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.ak-chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #9ca3af;
    display: inline-block;
    animation: akTyping 1s infinite ease-in-out;
}

.ak-chatbot-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.ak-chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes akTyping {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.6;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ak-chatbot-quick-replies {
    padding: 10px 16px 16px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fafafa;
}

.ak-chatbot-chip {
    border: 1px solid var(--ak-border);
    background: #fff;
    color: var(--ak-text);
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ak-chatbot-chip:hover {
    border-color: var(--ak-accent);
    transform: translateY(-1px);
}

.ak-chatbot-footer {
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--ak-border);
}

.ak-chatbot-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid var(--ak-border);
    border-radius: 14px;
    padding: 8px;
    min-width: 0;
}

.ak-chatbot-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    color: var(--ak-text);
    font-size: 16px;
    padding: 8px;
}

.ak-chatbot-input::placeholder {
    color: #9ca3af;
}

.ak-chatbot-send {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ak-primary), var(--ak-primary-2));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-chatbot-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ak-chatbot-send svg {
    width: 18px;
    height: 18px;
}

.ak-chatbot-note {
    margin-top: 8px;
    font-size: 11px;
    color: var(--ak-text-soft);
    text-align: center;
}

@media (max-width: 640px) {
    :root {
        --ak-fab-bottom: 12px;
        --ak-fab-size: 58px;
    }

    .ak-chatbot-panel {
        width: min(100vw - 24px, 380px);
        height: min(75vh, 620px);
        bottom: calc(var(--ak-fab-bottom) + var(--ak-fab-size) + 20px);
    }
}

#whatsappBtn {
    position: fixed;
    bottom: var(--ak-fab-bottom);
    right: var(--ak-fab-right);
    background-color: #25D366;
    border-radius: 50%;
    width: var(--ak-fab-size);
    height: var(--ak-fab-size);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 99998;
    transition: transform 0.3s ease;
    overflow: visible;
}

#whatsappBtn:hover {
    transform: scale(1.1);
}

#whatsappBtn img {
    position: relative;
    z-index: 2;
    width: calc(var(--ak-fab-size) * 0.47);
    height: calc(var(--ak-fab-size) * 0.47);
}

#waPulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.5);
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0;
}

@keyframes waPulseAnim {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.ak-chatbot-badge {
    position: absolute;
    bottom: calc(var(--ak-fab-size) + 14px);
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
    animation: akFloat 2s infinite ease-in-out;
}

.ak-chatbot-badge::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #111827;
    transform: translateX(-50%) rotate(45deg);
}

@keyframes akFloat {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-6px);
    }
}

.ak-chatbot-toggle::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(201, 168, 106, .5);
    animation: akPulse 2s infinite;
}

@keyframes akPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.ak-chatbot-toggle {
    position: relative;
}

html.ak-chatbot-scroll-lock,
body.ak-chatbot-scroll-lock {
    overflow: hidden !important;
}

body.ak-chatbot-scroll-lock {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}