/* =========================
   AZIEL LIVE CHAT V2.5
   Shared Theme Compatible
========================= */

.aziel-support-tab,
.chat-ball {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;

    width: 128px !important;
    height: 46px !important;

    border: none !important;
    border-radius: 12px !important;

    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    color: #fff !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;

    font-size: 14px !important;
    font-weight: 800 !important;
    font-family: inherit !important;

    cursor: pointer !important;
    z-index: 999999 !important;

    box-shadow:
        0 12px 28px rgba(124, 58, 237, .38),
        0 0 0 6px rgba(139, 92, 246, .13) !important;

    transition:
        transform var(--motion-duration-normal, .25s) var(--motion-ease-standard, ease),
        box-shadow var(--motion-duration-normal, .25s) var(--motion-ease-standard, ease) !important;
}

.aziel-support-tab:hover,
.chat-ball:hover {
    transform: translateY(-3px) !important;
}

.aziel-support-tab i,
.chat-ball i {
    font-size: 18px !important;
    color: #fff !important;
}

.chat-ball::after {
    content: "Support";
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.chat-text,
.chat-badge {
    display: none !important;
}

.online-dot,
.aziel-support-tab b {
    position: absolute !important;
    right: 7px !important;
    bottom: 6px !important;

    width: 9px !important;
    height: 9px !important;

    border-radius: 50% !important;
    background: var(--success) !important;
    border: 2px solid #fff !important;
}

/* =========================
   CHAT PANEL
========================= */

.live-chat-panel {
    position: fixed !important;
    right: 24px !important;
    bottom: 88px !important;

    width: 370px !important;
    height: 540px !important;

    background: var(--surface-strong) !important;
    color: var(--text) !important;

    backdrop-filter: blur(22px) !important;
    -webkit-backdrop-filter: blur(22px) !important;

    border: 1px solid var(--border) !important;
    border-radius: 26px !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;

    z-index: 999998 !important;
    box-shadow: var(--shadow-lg) !important;

    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(18px) scale(.96) !important;
    transition:
        opacity var(--motion-duration-normal, .25s) var(--motion-ease-enter, ease),
        transform var(--motion-duration-normal, .25s) var(--motion-ease-enter, ease) !important;
}

.live-chat-panel.open {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
}

.chat-header {
    padding: 16px;

    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-agent {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-agent-icon {
    width: 42px;
    height: 42px;

    border-radius: 50%;
    background: rgba(255, 255, 255, .2);

    display: grid;
    place-items: center;

    font-size: 13px;
    font-weight: 900;
}

.chat-agent strong {
    display: block;
    color: #fff;
    font-size: 15px;
}

.chat-agent small {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-top: 3px;

    color: rgba(255, 255, 255, .9);
    font-size: 12px;
}

.mini-online {
    width: 7px;
    height: 7px;

    display: inline-block;

    border-radius: 50%;
    background: var(--success);
}

.chat-close-btn {
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, .18);
    color: #fff;

    font-size: 16px;
    cursor: pointer;
}

/* =========================
   CHAT BODY
========================= */

.chat-body {
    flex: 1;

    padding: 16px;
    overflow-y: auto;

    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, .10), transparent 35%),
        var(--bg-soft);
}

.chat-message {
    max-width: 78%;

    padding: 11px 13px;
    margin-bottom: 12px;

    border-radius: 17px;

    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;

    animation: az-motion-chat-pop var(--motion-duration-fast, .18s) var(--motion-ease-enter, ease);
}

@keyframes az-motion-chat-pop {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.chat-message.bot {
    background: var(--surface);
    color: var(--text);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.chat-message.user {
    margin-left: auto;

    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;

    border-bottom-right-radius: 6px;
    box-shadow: 0 10px 24px rgba(124, 58, 237, .22);
}

.chat-message small {
    display: block;

    margin-top: 6px;

    color: inherit;
    opacity: .65;
    font-size: 10px;
}

body.theme-light .chat-body {
    background:
        radial-gradient(circle at top left, rgba(139, 92, 246, .10), transparent 35%),
        var(--bg-soft);
}

body.theme-light .chat-message.bot {
    background: #ffffff;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, .10);
}

body.theme-light .chat-message.user {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
}

body.theme-light .chat-message.bot small {
    color: #64748b;
    opacity: 1;
}

body.theme-light .chat-message.user small {
    color: rgba(255, 255, 255, .82);
    opacity: 1;
}

body.theme-light .typing-indicator {
    background: var(--bg-soft);
    color: var(--text-muted);
}

body.theme-light .chat-input-row {
    background: var(--surface-strong);
}

body.theme-light .chat-input-row input {
    background: #ffffff;
    color: #111827;
}

body.theme-light .chat-input-row input::placeholder {
    color: #64748b;
}

@media (min-width: 1024px) {
    body:has(.support-page) .live-chat-panel {
        right: 18px !important;
        width: 340px !important;
        height: min(520px, calc(100dvh - 132px)) !important;
    }
}

/* =========================
   TYPING
========================= */

.typing-indicator {
    display: none;

    padding: 8px 16px;

    color: var(--text-muted);
    background: var(--bg-soft);

    font-size: 12px;
}

.typing-indicator.show {
    display: block;
}

.typing-indicator span {
    animation: typingBlink 1s infinite;
}

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

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

@keyframes typingBlink {

    0%,
    100% {
        opacity: .2;
    }

    50% {
        opacity: 1;
    }
}

/* =========================
   INPUT
========================= */

.chat-input-row {
    display: flex;
    gap: 10px;

    padding: 14px;

    background: var(--surface-strong);
    border-top: 1px solid var(--border);
}

.chat-input-row input {
    flex: 1;

    border: 1px solid var(--border);
    border-radius: 15px;

    padding: 12px 14px;

    outline: none;
    background: var(--surface);
    color: var(--text);
}

.chat-input-row input::placeholder {
    color: var(--text-muted);
}

.chat-input-row input:focus {
    border-color: rgba(168, 85, 247, .65);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, .12);
}

.chat-input-row button {
    width: 48px;

    border: none;
    border-radius: 15px;

    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;

    cursor: pointer;
    font-weight: 900;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .aziel-support-tab,
    .chat-ball {
        right: 14px !important;
        bottom: 16px !important;

        width: 118px !important;
        height: 46px !important;

        border-radius: 12px !important;
    }

    .chat-ball::after {
        font-size: 14px !important;
    }

    .live-chat-panel {
        left: 12px !important;
        right: 12px !important;
        bottom: 78px !important;

        width: auto !important;
        height: 70vh !important;

        border-radius: 24px !important;
    }
}
