/*
 * Cursus Compleet Knowledge Hub - Floating Form
 * Version: 1.3.0
 *
 * Desktop:
 * - Trigger blijft vast rechts staan.
 * - Alleen het formulierpaneel klapt naar links open.
 * - Voldoende afstand tot de browser-scrollbar.
 *
 * Mobile:
 * - Trigger staat onderaan.
 * - Formulier opent als een bijna schermvullend paneel.
 */

/* Extra hero-animatie, ook zichtbaar wanneer een feature image is ingesteld */
.cckh-hero::before,
.cckh-hero::after {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}

.cckh-hero::before {
    left: -150px;
    top: -180px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 0 0 55px rgba(255, 255, 255, 0.035),
        0 0 0 115px rgba(255, 255, 255, 0.025);
    animation: cckhHeroDrift 9s ease-in-out infinite;
}

.cckh-hero::after {
    left: 18%;
    bottom: -115px;
    width: 250px;
    height: 250px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.11),
        rgba(255, 255, 255, 0) 68%
    );
    animation: cckhHeroGlow 7s ease-in-out infinite;
}

.cckh-hero-copy,
.cckh-hero-image {
    position: relative;
    z-index: 2;
}

@keyframes cckhHeroDrift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(0.96);
        opacity: 0.62;
    }
    50% {
        transform: translate3d(35px, 22px, 0) scale(1.08);
        opacity: 1;
    }
}

@keyframes cckhHeroGlow {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.45;
    }
    50% {
        transform: translate3d(-38px, -24px, 0);
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cckh-hero::before,
    .cckh-hero::after {
        animation: none;
    }
}

/* Verberg het oude floating element uit Theme Layer v1.1 */
.cckh-floating {
    display: none !important;
}

/* Wrapper blijft op exact dezelfde plaats staan */
.cckh-float-wrap {
    position: fixed;
    right: 24px;
    top: 50%;
    z-index: 10020;
    transform: translateY(-50%);
    font-family: Gilroy, "Segoe UI", Arial, sans-serif;
}

/* Trigger beweegt niet meer naar links of rechts */
.cckh-float-trigger {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 220px;
    min-height: 68px;
    padding: 11px 13px;
    border: 0;
    border-radius: 17px;
    color: #ffffff;
    background: linear-gradient(145deg, #173895, #3f83e4);
    box-shadow: 0 18px 48px rgba(19, 52, 130, 0.34);
    cursor: pointer;
    text-align: left;
    transform: none;
    transition:
        box-shadow 0.25s ease,
        filter 0.25s ease,
        scale 0.25s ease;
}

.cckh-float-trigger:hover,
.cckh-float-trigger:focus-visible,
.cckh-float-wrap.is-open .cckh-float-trigger {
    transform: none;
    scale: 1.02;
    filter: brightness(1.04);
    box-shadow: 0 22px 58px rgba(19, 52, 130, 0.42);
}

.cckh-float-trigger:focus-visible,
.cckh-float-close:focus-visible {
    outline: 3px solid rgba(69, 174, 231, 0.45);
    outline-offset: 3px;
}

.cckh-float-trigger-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 22px;
}

.cckh-float-trigger-copy {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.cckh-float-trigger-copy small {
    font-size: 11px;
    opacity: 0.8;
}

.cckh-float-trigger-copy strong {
    font-size: 14px;
}

.cckh-float-trigger-arrow {
    margin-left: auto;
    font-size: 25px;
    line-height: 1;
    transition: transform 0.25s ease;
}

.cckh-float-wrap.is-open .cckh-float-trigger-arrow {
    transform: rotate(180deg);
}

/*
 * Het paneel is fixed en staat los van de wrapper-layout.
 * Het opent links naast de knop, terwijl de knop op zijn plaats blijft.
 */
.cckh-float-panel {
    position: fixed;
    right: 268px;
    top: 50%;
    z-index: 2;
    width: min(430px, calc(100vw - 330px));
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    padding: 26px;
    background: #ffffff;
    border: 1px solid #dce5f1;
    border-radius: 24px;
    box-shadow: 0 28px 85px rgba(12, 34, 83, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(24px, -50%) scale(0.97);
    transform-origin: right center;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: #a9bce0 transparent;
}

.cckh-float-wrap.is-open .cckh-float-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
}

.cckh-float-panel::-webkit-scrollbar {
    width: 8px;
}

.cckh-float-panel::-webkit-scrollbar-thumb {
    background: #a9bce0;
    border-radius: 999px;
}

.cckh-float-panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e3eaf4;
}

.cckh-float-panel header small {
    color: #2447c6;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.cckh-float-panel h2 {
    margin: 5px 0 0;
    color: #10224a;
    font: 700 30px/1.05 Gilroy, "Segoe UI", sans-serif;
}

.cckh-float-close {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    background: #eef3fb;
    color: #173895;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.cckh-float-intro {
    margin: 18px 0;
    color: #64718b;
    line-height: 1.55;
}

/* Fluent Forms binnen het floating paneel */
.cckh-float-form .ff-el-group {
    margin-bottom: 14px !important;
}

.cckh-float-form label {
    color: #10224a !important;
    font-weight: 700 !important;
}

.cckh-float-form input,
.cckh-float-form textarea,
.cckh-float-form select {
    width: 100% !important;
    padding: 12px 13px !important;
    border: 1px solid #cdd9e9 !important;
    border-radius: 11px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    font-family: Gilroy, "Segoe UI", Arial, sans-serif !important;
}

.cckh-float-form textarea {
    min-height: 105px;
    resize: vertical;
}

.cckh-float-form input:focus,
.cckh-float-form textarea:focus,
.cckh-float-form select:focus {
    border-color: #3f72dd !important;
    outline: 0 !important;
    box-shadow: 0 0 0 4px #e6edff !important;
}

.cckh-float-form button[type="submit"],
.cckh-float-form input[type="submit"] {
    width: 100% !important;
    padding: 13px 18px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: linear-gradient(135deg, #173895, #3f83e4) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    cursor: pointer;
}

.cckh-float-placeholder {
    padding: 18px;
    border-radius: 15px;
    background: #f3f7fd;
    color: #50617c;
}

.cckh-float-placeholder strong {
    display: block;
    color: #10224a;
}

.cckh-float-placeholder p {
    margin: 7px 0 12px;
}

.cckh-float-placeholder a {
    display: inline-flex;
    padding: 9px 13px;
    border-radius: 9px;
    background: #2447c6;
    color: #ffffff;
    text-decoration: none;
}

.cckh-float-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10010;
    background: rgba(8, 22, 55, 0.28);
    backdrop-filter: blur(2px);
}

body.cckh-float-lock {
    overflow: hidden;
}

/* Op desktop is geen backdrop nodig */
@media (min-width: 801px) {
    .cckh-float-backdrop {
        display: none !important;
    }
}

/* Small desktop en tablet landscape */
@media (min-width: 801px) and (max-width: 1100px) {
    .cckh-float-wrap {
        right: 16px;
    }

    .cckh-float-trigger {
        width: 196px;
    }

    .cckh-float-panel {
        right: 228px;
        width: min(400px, calc(100vw - 260px));
    }
}

/* Mobiel: trigger onderaan en paneel als modal */
@media (max-width: 800px) {
    .cckh-float-wrap {
        top: auto;
        right: 14px;
        bottom: 14px;
        left: 14px;
        transform: none;
    }

    .cckh-float-trigger {
        width: 100%;
        min-height: 58px;
        justify-content: center;
        border-radius: 15px;
        transform: none;
    }

    .cckh-float-trigger-copy {
        display: block;
    }

    .cckh-float-trigger-copy small {
        margin-right: 5px;
    }

    .cckh-float-trigger-arrow {
        margin-left: 6px;
    }

    .cckh-float-panel {
        position: fixed;
        right: 12px;
        left: 12px;
        top: auto;
        bottom: 12px;
        width: auto;
        max-height: calc(100vh - 24px);
        transform: translateY(25px) scale(0.98);
        transform-origin: bottom center;
    }

    .cckh-float-wrap.is-open .cckh-float-panel {
        transform: translateY(0) scale(1);
    }

    .cckh-float-wrap.is-open .cckh-float-trigger {
        opacity: 0;
        pointer-events: none;
    }

    .cckh-hero::before {
        left: -260px;
    }
}
