/*==============================================================
  chatbot-widget.css — Deutschzentrum Kosovo
  Floating AI assistant for the PUBLIC (unauthenticated) site.
  Built on the SiteModern.css design tokens (--dz-*), so the
  dark theme (html[data-dz-theme="dark"]) applies automatically.
==============================================================*/

.dzcb {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99998;
    font-family: var(--dz-sans, 'Inter', 'Segoe UI', system-ui, sans-serif);
}

/*---------------- Launcher button ----------------*/
.dzcb-fab {
    position: relative;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--dz-grad, linear-gradient(135deg, #4f46e5, #7c3aed 48%, #d926aa));
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--dz-shadow, 0 16px 40px -18px rgba(49, 46, 129, 0.35));
    transition: transform .25s ease, box-shadow .25s ease;
}

    .dzcb-fab:hover {
        transform: translateY(-3px) scale(1.04);
        box-shadow: var(--dz-shadow-lg, 0 36px 80px -28px rgba(49, 46, 129, 0.45));
    }

    .dzcb-fab:focus-visible {
        outline: none;
        box-shadow: var(--dz-ring, 0 0 0 4px rgba(124, 58, 237, 0.18));
    }

    .dzcb-fab i {
        pointer-events: none;
        line-height: 1;
    }

.dzcb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--dz-grad-amber, linear-gradient(135deg, #f59e0b, #f97316));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/*---------------- Panel ----------------*/
.dzcb-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 382px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--dz-r-lg, 26px);
    background: var(--dz-card, #fff);
    border: 1px solid var(--dz-line, #e6e8f0);
    box-shadow: var(--dz-shadow-lg, 0 36px 80px -28px rgba(49, 46, 129, 0.45));
    opacity: 0;
    transform: translateY(14px) scale(.98);
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
}

.dzcb-open .dzcb-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/*---------------- Header ----------------*/
.dzcb-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--dz-mesh, linear-gradient(160deg, #0b1020, #161a3a 60%, #1d1740));
    color: #fff;
    flex-shrink: 0;
}

.dzcb-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    font-size: 22px;
}

.dzcb-head-txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-right: auto;
}

    .dzcb-head-txt strong {
        font-family: var(--dz-display, 'Plus Jakarta Sans', sans-serif);
        font-size: 15.5px;
        font-weight: 700;
        letter-spacing: -0.01em;
        line-height: 1.25;
    }

    .dzcb-head-txt small {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11.5px;
        opacity: .82;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.dzcb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
    flex-shrink: 0;
}

.dzcb-hbtn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 19px;
    cursor: pointer;
    transition: background .2s ease;
}

    .dzcb-hbtn:hover {
        background: rgba(255, 255, 255, 0.22);
    }

    .dzcb-hbtn i {
        pointer-events: none;
    }

/*---------------- Messages ----------------*/
.dzcb-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--dz-bg, #f7f8fc);
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.dzcb-m {
    display: flex;
}

.dzcb-m-user {
    justify-content: flex-end;
}

.dzcb-m-assistant {
    justify-content: flex-start;
}

.dzcb-bubble {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.8px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: dzcb-in .25s ease both;
}

.dzcb-m-user .dzcb-bubble {
    background: var(--dz-grad, linear-gradient(135deg, #4f46e5, #7c3aed 48%, #d926aa));
    color: #fff;
    border-bottom-right-radius: 6px;
}

.dzcb-m-assistant .dzcb-bubble {
    background: var(--dz-card, #fff);
    color: var(--dz-body, #475569);
    border: 1px solid var(--dz-line, #e6e8f0);
    border-bottom-left-radius: 6px;
    box-shadow: var(--dz-shadow-sm, 0 2px 8px rgba(17, 24, 56, 0.06));
}

.dzcb-bubble p {
    margin: 0 0 6px;
}

    .dzcb-bubble p:last-child {
        margin-bottom: 0;
    }

.dzcb-bubble ul {
    margin: 4px 0 6px;
    padding-left: 18px;
}

.dzcb-bubble li {
    margin-bottom: 3px;
}

.dzcb-bubble strong {
    color: var(--dz-heading, #131a2e);
}

.dzcb-m-user .dzcb-bubble strong {
    color: #fff;
}

.dzcb-bubble a {
    color: var(--dz-indigo, #4f46e5);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dzcb-bubble code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--dz-bg-2, #eef0ff);
    font-size: 12.5px;
}

@keyframes dzcb-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/*---------------- Typing indicator ----------------*/
.dzcb-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 20px;
}

    .dzcb-typing span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--dz-violet, #7c3aed);
        opacity: .35;
        animation: dzcb-dots 1.2s infinite ease-in-out;
    }

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

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

@keyframes dzcb-dots {
    0%, 60%, 100% {
        opacity: .3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/*---------------- Suggestion chips ----------------*/
.dzcb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 2px 6px;
}

.dzcb-chip {
    padding: 8px 13px;
    border: 1px solid var(--dz-line, #e6e8f0);
    border-radius: 999px;
    background: var(--dz-card, #fff);
    color: var(--dz-heading, #131a2e);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

    .dzcb-chip:hover {
        border-color: var(--dz-violet, #7c3aed);
        background: var(--dz-bg-2, #eef0ff);
        transform: translateY(-1px);
    }

/*---------------- Input area ----------------*/
.dzcb-foot {
    flex-shrink: 0;
    padding: 10px 12px 12px;
    background: var(--dz-card, #fff);
    border-top: 1px solid var(--dz-line, #e6e8f0);
}

.dzcb-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
}

.dzcb-input {
    flex: 1;
    resize: none;
    max-height: 110px;
    padding: 10px 14px;
    border: 1px solid var(--dz-line, #e6e8f0);
    border-radius: 14px;
    background: var(--dz-bg, #f7f8fc);
    color: var(--dz-heading, #131a2e);
    font-family: inherit;
    font-size: 13.8px;
    line-height: 1.45;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .dzcb-input:focus {
        border-color: var(--dz-violet, #7c3aed);
        box-shadow: var(--dz-ring, 0 0 0 4px rgba(124, 58, 237, 0.18));
    }

.dzcb-send {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--dz-grad, linear-gradient(135deg, #4f46e5, #7c3aed 48%, #d926aa));
    color: #fff;
    font-size: 19px;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
}

    .dzcb-send:hover:not(:disabled) {
        transform: scale(1.07);
    }

    .dzcb-send:disabled {
        opacity: .55;
        cursor: default;
    }

    .dzcb-send i {
        pointer-events: none;
    }

/*---------------- Dark theme fine-tuning ----------------*/
html[data-dz-theme="dark"] .dzcb-m-user .dzcb-bubble strong {
    color: #fff;
}

html[data-dz-theme="dark"] .dzcb-bubble a {
    color: #a5b4fc;
}

html[data-dz-theme="dark"] .dzcb-chip:hover {
    background: rgba(124, 58, 237, 0.18);
}

/*---------------- Mobile ----------------*/
@media (max-width: 575.98px) {
    .dzcb {
        right: 16px;
        bottom: 16px;
    }

    .dzcb-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: 0;
        bottom: 0;
    }

    .dzcb-open .dzcb-fab {
        display: none;
    }
}

/*---------------- Reduced motion ----------------*/
@media (prefers-reduced-motion: reduce) {
    .dzcb-panel,
    .dzcb-fab,
    .dzcb-bubble,
    .dzcb-chip,
    .dzcb-send {
        transition: none;
        animation: none;
    }

    .dzcb-typing span {
        animation: none;
        opacity: .8;
    }
}
