/* Appizum Chatbot */
.az-chat {
    --az-chat-primary: #003261;
    --az-chat-primary-2: #004d8c;
    --az-chat-accent: #0066b3;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1080;
    font-family: inherit;
}

.az-chat__launcher {
    position: relative;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--az-chat-accent), var(--az-chat-primary));
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 50, 97, 0.35);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.az-chat__launcher:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 32px rgba(0, 50, 97, 0.42);
}

.az-chat__launcher-close {
    display: none;
}

.az-chat.is-open .az-chat__launcher-icon {
    display: none;
}

.az-chat.is-open .az-chat__launcher-close {
    display: inline-block;
}

.az-chat__pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(0, 102, 179, 0.45);
    animation: azChatPulse 2.2s ease-out infinite;
    pointer-events: none;
}

.az-chat.is-open .az-chat__pulse {
    display: none;
}

@keyframes azChatPulse {
    0% { transform: scale(0.92); opacity: 0.85; }
    100% { transform: scale(1.35); opacity: 0; }
}

.az-chat__panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(380px, calc(100vw - 28px));
    height: min(540px, calc(100vh - 120px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 50, 97, 0.08);
    transform-origin: bottom right;
    animation: azChatIn 0.28s ease;
}

.az-chat__panel[hidden] {
    display: none !important;
}

@keyframes azChatIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.az-chat__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, var(--az-chat-primary) 0%, var(--az-chat-primary-2) 55%, var(--az-chat-accent) 100%);
    color: #fff;
}

.az-chat__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.az-chat__header-text {
    flex: 1;
    min-width: 0;
}

.az-chat__header-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
}

.az-chat__header-text span {
    display: block;
    font-size: 0.72rem;
    opacity: 0.88;
    margin-top: 0.15rem;
}

.az-chat__header-text .fa-circle {
    font-size: 0.45rem;
    color: #4ade80;
    vertical-align: middle;
    margin-right: 0.2rem;
}

.az-chat__minimize {
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.az-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background:
        radial-gradient(ellipse 80% 40% at 100% 0%, rgba(0, 77, 140, 0.05), transparent 50%),
        #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.az-chat__bubble {
    max-width: 88%;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.az-chat__bubble--bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.az-chat__bubble--user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--az-chat-primary-2), var(--az-chat-primary));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.az-chat__bubble a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.az-chat__bubble--bot a {
    color: var(--az-chat-primary-2);
}

.az-chat__typing {
    align-self: flex-start;
    display: inline-flex;
    gap: 4px;
    padding: 0.7rem 0.9rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.az-chat__typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: azChatDot 1.1s infinite ease-in-out;
}

.az-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.az-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes azChatDot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.az-chat__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid #eef2f7;
    background: #fff;
}

.az-chat__chip {
    border: 1px solid rgba(0, 50, 97, 0.18);
    background: #f0f6fc;
    color: var(--az-chat-primary);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.az-chat__chip:hover {
    background: var(--az-chat-primary);
    color: #fff;
    border-color: var(--az-chat-primary);
}

.az-chat__form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #eef2f7;
    background: #fff;
}

.az-chat__input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    outline: none;
    min-width: 0;
}

.az-chat__input:focus {
    border-color: rgba(0, 77, 140, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 77, 140, 0.12);
}

.az-chat__send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--az-chat-primary);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.az-chat__send:hover {
    background: var(--az-chat-primary-2);
    transform: scale(1.05);
}

@media (max-width: 575.98px) {
    .az-chat {
        right: 14px;
        bottom: 14px;
    }
    .az-chat__panel {
        width: calc(100vw - 28px);
        height: min(70vh, 520px);
        bottom: 70px;
    }
    .az-chat__launcher {
        width: 54px;
        height: 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .az-chat__pulse,
    .az-chat__panel,
    .az-chat__typing span {
        animation: none !important;
    }
}
