/*
 * SSF Chatbot – Platform layout
 * Visuele aansluiting op het Sportservice Flevoland-platform.
 */
.ssf-chatbot {
    --ssf-chatbot-primary: #181830;
    --ssf-chatbot-accent: #EB5E1C;
    --ssf-chatbot-petrol: #1E5D65;
    --ssf-chatbot-blue: #3E9CC6;
    --ssf-chatbot-light: #F5F6F8;
    --ssf-chatbot-border: #E2E5EA;
    --ssf-chatbot-text: #1B1B1A;
    --ssf-chatbot-muted: #646874;
    --ssf-chatbot-white: #FFFFFF;
    --ssf-chatbot-shadow: 0 24px 70px rgba(24, 24, 48, .24);
    --ssf-chatbot-radius: 22px;
    font-family: GeoGrotesque, Aptos, Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ssf-chatbot-text);
    z-index: 99999;
}

.ssf-chatbot *,
.ssf-chatbot *::before,
.ssf-chatbot *::after {
    box-sizing: border-box;
}

.ssf-chatbot [hidden] {
    display: none !important;
}

.ssf-chatbot .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ssf-chatbot--floating {
    position: fixed;
    bottom: 24px;
}

.ssf-chatbot--right {
    right: 24px;
}

.ssf-chatbot--left {
    left: 24px;
}

.ssf-chatbot__toggle {
    min-width: 176px;
    min-height: 64px;
    padding: 8px 16px 8px 10px;
    border: 0;
    border-radius: 18px;
    background: var(--ssf-chatbot-accent);
    color: var(--ssf-chatbot-white);
    box-shadow: 0 14px 34px rgba(24, 24, 48, .22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.ssf-chatbot__toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(24, 24, 48, .28);
}

.ssf-chatbot__toggle:focus-visible,
.ssf-chatbot__close:focus-visible,
.ssf-chatbot__send:focus-visible,
.ssf-chatbot__input:focus-visible,
.ssf-chatbot__sources a:focus-visible {
    outline: 3px solid var(--ssf-chatbot-blue);
    outline-offset: 3px;
}

.ssf-chatbot__toggle-content {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssf-chatbot__toggle-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    background: var(--ssf-chatbot-white);
    display: grid;
    place-items: center;
}

.ssf-chatbot__toggle-mark img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.ssf-chatbot__toggle-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
}

.ssf-chatbot__toggle-copy strong {
    color: var(--ssf-chatbot-white);
    font-size: 15px;
    font-weight: 800;
}

.ssf-chatbot__toggle-copy small {
    color: rgba(255,255,255,.86);
    font-size: 11px;
    font-weight: 600;
}

.ssf-chatbot__panel {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    height: 620px;
    max-height: calc(100vh - 110px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--ssf-chatbot-white);
    border: 1px solid rgba(24, 24, 48, .09);
    border-radius: var(--ssf-chatbot-radius);
    box-shadow: var(--ssf-chatbot-shadow);
}

.ssf-chatbot__panel::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--ssf-chatbot-accent);
}

.ssf-chatbot--embedded {
    width: 100%;
}

.ssf-chatbot--embedded .ssf-chatbot__panel {
    width: 100%;
    min-height: 620px;
    height: min(720px, 78vh);
    max-height: none;
    border-radius: var(--ssf-chatbot-radius);
    box-shadow: 0 16px 45px rgba(24, 24, 48, .12);
}

.ssf-chatbot__header {
    min-height: 88px;
    padding: 18px 18px 15px;
    background: var(--ssf-chatbot-primary);
    color: var(--ssf-chatbot-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ssf-chatbot__brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ssf-chatbot__brand-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    background: var(--ssf-chatbot-white);
    display: grid;
    place-items: center;
}

.ssf-chatbot__brand-mark img {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
}

.ssf-chatbot__brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ssf-chatbot__brand-copy strong {
    overflow: hidden;
    color: var(--ssf-chatbot-white);
    font-size: 17px;
    line-height: 1.15;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ssf-chatbot__brand-copy span {
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 600;
}

.ssf-chatbot__close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: var(--ssf-chatbot-white);
    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s ease, transform .16s ease;
}

.ssf-chatbot__close:hover {
    background: rgba(255,255,255,.16);
    transform: rotate(3deg);
}

.ssf-chatbot__messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(62,156,198,.09), transparent 34%),
        var(--ssf-chatbot-light);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(24,24,48,.28) transparent;
}

.ssf-chatbot__messages::-webkit-scrollbar {
    width: 8px;
}

.ssf-chatbot__messages::-webkit-scrollbar-track {
    background: transparent;
}

.ssf-chatbot__messages::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(24,24,48,.24);
    background-clip: padding-box;
}

.ssf-chatbot__msg {
    position: relative;
    max-width: 88%;
    margin: 0 0 14px;
    padding: 13px 15px;
    border-radius: 17px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.ssf-chatbot__msg:last-child {
    margin-bottom: 0;
}

.ssf-chatbot__msg--bot {
    margin-right: auto;
    background: var(--ssf-chatbot-white);
    color: var(--ssf-chatbot-text);
    border: 1px solid var(--ssf-chatbot-border);
    border-left: 4px solid var(--ssf-chatbot-accent);
    border-bottom-left-radius: 7px;
    box-shadow: 0 7px 20px rgba(24,24,48,.06);
}

.ssf-chatbot__msg--user {
    margin-left: auto;
    background: var(--ssf-chatbot-primary);
    color: var(--ssf-chatbot-white);
    border-bottom-right-radius: 7px;
    box-shadow: 0 7px 20px rgba(24,24,48,.12);
}

.ssf-chatbot__msg a {
    color: var(--ssf-chatbot-petrol);
    font-weight: 700;
}

.ssf-chatbot__msg code {
    padding: .08em .35em;
    border-radius: 5px;
    background: rgba(24,24,48,.07);
    font-size: .92em;
}

.ssf-chatbot__sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--ssf-chatbot-border);
    font-size: 13px;
    white-space: normal;
}

.ssf-chatbot__sources-title {
    display: block;
    margin-bottom: 7px;
    color: var(--ssf-chatbot-primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ssf-chatbot__sources-list {
    display: grid;
    gap: 6px;
}

.ssf-chatbot__sources a,
.ssf-chatbot__source-label {
    position: relative;
    display: block;
    padding: 8px 28px 8px 10px;
    border: 1px solid var(--ssf-chatbot-border);
    border-radius: 10px;
    background: var(--ssf-chatbot-light);
    color: var(--ssf-chatbot-primary);
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.ssf-chatbot__sources a::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: 10px;
    color: var(--ssf-chatbot-accent);
    font-size: 16px;
    transform: translateY(-50%);
}

.ssf-chatbot__sources a:hover {
    border-color: var(--ssf-chatbot-accent);
    background: var(--ssf-chatbot-white);
}

.ssf-chatbot__composer {
    flex: 0 0 auto;
    padding: 12px 14px 0;
    background: var(--ssf-chatbot-white);
    border-top: 1px solid var(--ssf-chatbot-border);
}

.ssf-chatbot__form {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.ssf-chatbot__input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid #CDD1D8;
    border-radius: 14px;
    background: var(--ssf-chatbot-white);
    color: var(--ssf-chatbot-text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(24,24,48,.04);
}

.ssf-chatbot__input::placeholder {
    color: #777C87;
}

.ssf-chatbot__input:focus {
    border-color: var(--ssf-chatbot-accent);
    box-shadow: 0 0 0 3px rgba(235,94,28,.12);
    outline: none;
}

.ssf-chatbot__send {
    min-width: 92px;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: var(--ssf-chatbot-accent);
    color: var(--ssf-chatbot-white);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease;
}

.ssf-chatbot__send:hover {
    filter: brightness(.94);
    transform: translateY(-1px);
}

.ssf-chatbot__send:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

.ssf-chatbot__privacy {
    padding: 9px 14px 12px;
    background: var(--ssf-chatbot-white);
    color: var(--ssf-chatbot-muted);
    font-size: 11px;
    line-height: 1.35;
}

.ssf-chatbot__typing {
    color: var(--ssf-chatbot-muted);
    font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
    .ssf-chatbot *,
    .ssf-chatbot *::before,
    .ssf-chatbot *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 600px) {
    .ssf-chatbot--floating {
        right: 8px;
        left: 8px;
        bottom: 8px;
    }

    .ssf-chatbot--left,
    .ssf-chatbot--right {
        right: 8px;
        left: 8px;
    }

    .ssf-chatbot__toggle {
        min-width: 168px;
        min-height: 60px;
        margin-left: auto;
        border-radius: 17px;
    }

    .ssf-chatbot--left .ssf-chatbot__toggle {
        margin-right: auto;
        margin-left: 0;
    }

    .ssf-chatbot__panel {
        width: 100%;
        height: min(78vh, 680px);
        max-height: calc(100vh - 16px);
        border-radius: 19px;
    }

    .ssf-chatbot__header {
        min-height: 80px;
        padding: 15px 14px 13px;
    }

    .ssf-chatbot__brand-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .ssf-chatbot__brand-mark img {
        width: 31px;
        height: 31px;
    }

    .ssf-chatbot__brand-copy strong {
        font-size: 15px;
    }

    .ssf-chatbot__messages {
        padding: 16px 12px;
    }

    .ssf-chatbot__msg {
        max-width: 92%;
        padding: 12px 13px;
    }

    .ssf-chatbot__composer {
        padding: 10px 10px 0;
    }

    .ssf-chatbot__send {
        min-width: 74px;
        padding: 0 12px;
    }

    .ssf-chatbot__privacy {
        padding-right: 10px;
        padding-left: 10px;
    }
}
