/**
 * Vacature-alert [rbd_job_alert_inline]
 * Hergebruikt de formulierstijl (.rbd-apply__input, .rbd-apply__submit, apply-form.css)
 * en de filters (.rbd-vac-filters__group, .rbd-vac-check, job-overview.css).
 * Alle waarden via de --rbd-vac-* variabelen.
 */

/* ---------- Rij: e-mail | interesses | knop ---------- */

.rbd-alert__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--rbd-vac-form-gap);
}

.rbd-alert .rbd-alert__submit {
    justify-content: center;
    height: calc(var(--rbd-vac-input-height) * 1.25);
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
}

.rbd-alert__note {
    margin: 30px 0 0;
    color: var(--rbd-vac-filter-color);
    font-size: var(--rbd-vac-form-small-size);
    line-height: 1.6;
    text-align: center;
}

.rbd-alert .rbd-apply__alert {
    margin-bottom: var(--rbd-vac-form-gap);
}

/* ---------- Interesses-knop (ziet eruit als de dropdown) ---------- */

.rbd-alert__interest {
    position: relative;
}

.rbd-alert__trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.rbd-alert__summary {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rbd-alert__summary.is-placeholder {
    opacity: 0.85;
}

.rbd-alert__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    color: var(--rbd-vac-badge-color);
    background: var(--rbd-vac-badge-bg);
    border-radius: var(--rbd-vac-badge-radius);
    font-size: 12px;
    font-weight: 700;
}

.rbd-alert__trigger .rbd-vac-icon {
    font-size: 14px;
    transition: transform var(--rbd-vac-transition);
}

.rbd-alert__trigger.is-open .rbd-vac-icon {
    transform: rotate(180deg);
}

/* ---------- Popup (zelfde uitstraling als de filters) ---------- */

.rbd-alert__popup {
    /* Filters iets compacter in de popup */
    --rbd-vac-filter-title-size: 16px;
    --rbd-vac-filter-label-size: 15px;
    --rbd-vac-check-size: 20px;
    --rbd-vac-filter-group-gap: 20px;

    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: var(--rbd-vac-z-index);
    display: flex;
    flex-direction: column;
    width: max(100%, 340px);
    max-height: min(70vh, 540px);
    color: var(--rbd-vac-filter-color);
    background: var(--rbd-vac-primary);
    border: 1px solid var(--rbd-vac-panel-divider);
    border-radius: var(--rbd-vac-card-radius);
    box-shadow: var(--rbd-vac-toggle-shadow);
    font-family: var(--rbd-vac-font);
    animation: rbd-vac-fade-in 0.2s ease;
}

.rbd-alert__popup:focus {
    outline: none;
}

.rbd-alert__popup-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 12px 18px;
    border-bottom: 1px solid var(--rbd-vac-panel-divider);
}

.rbd-alert__popup-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.rbd-alert__popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    color: var(--rbd-vac-filter-color);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.rbd-alert__popup-close:focus-visible {
    outline: 2px solid var(--rbd-vac-filter-color);
}

.rbd-alert__popup-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--rbd-vac-filter-group-gap);
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.rbd-alert__popup-hint {
    margin: 0;
    font-size: var(--rbd-vac-form-small-size);
    line-height: 1.5;
    opacity: 0.75;
}

.rbd-alert__popup-footer {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-top: 1px solid var(--rbd-vac-panel-divider);
}

.rbd-alert__reset {
    padding: 8px 2px;
    color: var(--rbd-vac-filter-color);
    background: transparent;
    border: 0;
    font-family: var(--rbd-vac-font);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.rbd-alert__reset:disabled {
    cursor: default;
    opacity: 0.5;
}

.rbd-alert .rbd-alert__done {
    margin: 0;
    padding: 10px 24px;
    color: var(--rbd-vac-primary) !important;
    background: var(--rbd-vac-white);
}

.rbd-alert .rbd-alert__done:hover,
.rbd-alert .rbd-alert__done:focus-visible {
    background: #e6edf3;
}

.rbd-alert__backdrop {
    display: none;
}

/* ---------- Gelukt ---------- */

.rbd-alert__success {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: var(--rbd-vac-primary);
    background: var(--rbd-vac-card-bg);
    border-radius: var(--rbd-vac-input-radius);
    font-size: 20px!important;
    line-height: 1.6;
}

.rbd-alert__success:focus {
    outline: none;
}

.rbd-alert__success p {
    margin: 0;
    padding: 0;
    font-size: 18px;
}

.rbd-alert__success-icon {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #1a3c7f;
    background: var(--rbd-vac-empty-icon-bg);
    border-radius: 50%;
    font-size: 20px;
}

/* ---------- Mobiel ---------- */

@media (max-width: 767px) {
    .rbd-alert__fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .rbd-alert .rbd-alert__submit {
        width: 100%;
    }

    html.rbd-alert-locked,
    html.rbd-alert-locked body {
        overflow: hidden;
    }

    .rbd-alert__backdrop {
        position: fixed;
        inset: 0;
        z-index: var(--rbd-vac-z-index);
        display: block;
        background: var(--rbd-vac-backdrop);
    }

    /* Popup wordt een paneel vanaf onderen, net als de filters */
    .rbd-alert__popup {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: calc(var(--rbd-vac-z-index) + 1);
        width: auto;
        max-height: var(--rbd-vac-panel-max-height);
        border: 0;
        border-radius: var(--rbd-vac-panel-radius) var(--rbd-vac-panel-radius) 0 0;
        animation: rbd-alert-slide-up 0.25s ease;
    }

    .rbd-alert__popup-header,
    .rbd-alert__popup-body,
    .rbd-alert__popup-footer {
        padding-right: var(--rbd-vac-panel-padding);
        padding-left: var(--rbd-vac-panel-padding);
    }

    .rbd-alert__popup-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .rbd-alert .rbd-alert__done {
        flex: 1;
        padding: 14px 20px;
    }
}

@keyframes rbd-alert-slide-up {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rbd-alert__popup,
    .rbd-alert__trigger .rbd-vac-icon {
        animation: none;
        transition: none;
    }
}
