/**
 * AeDatePicker styling — gedeeld door home zoekbalk + archive filter.
 *
 * Sinds v2 is de popover een gecentreerde modal i.p.v. dropdown:
 * fixed-position midden in viewport, met semi-transparante backdrop
 * op body. Geldt zowel op desktop als mobiel — datum-blokken zijn
 * altijd groot genoeg om vlot aan te tikken.
 */

.ae-datepicker {
    position: relative;
    display: block;
    width: 100%;
}
.ae-datepicker__trigger {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 38px;
    padding: 0;
    background: #fff;
    /* Groene accent-border zodat het block subtiel opvalt als
       "speciale sectie" — zelfde groen als .ae-avail-bar--available
       om visueel een lijn te trekken tussen "kies datum" en
       "beschikbaarheid". */
    border: 1px solid rgba(83, 193, 96, 0.55);
    border-radius: 6px;
    color: #1f2937;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.ae-datepicker__trigger:hover {
    border-color: #53c160;
}
.ae-datepicker__trigger:focus,
.ae-datepicker.is-open .ae-datepicker__trigger {
    outline: none;
    border-color: #53c160;
    box-shadow: 0 0 0 3px rgba(83, 193, 96, 0.22);
}
.ae-datepicker__trigger-from,
.ae-datepicker__trigger-to {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.ae-datepicker__trigger-to {
    /* Gestippelde verticale scheiding tussen aankomst en vertrek.
       border-left is robuuster dan een aparte sep-span met
       background-image (sommige mobile browsers renderen 1px
       breed flex-items inconsistent met inhoud erin). */
    border-left: 1px dashed rgba(15, 38, 60, 0.32);
    margin: 6px 0;
    padding-left: 12px;
    padding-right: 12px;
}
.ae-datepicker__trigger-from.is-empty,
.ae-datepicker__trigger-to.is-empty {
    color: #6c7a83;
    font-weight: 400;
}
.ae-datepicker__trigger-sep {
    /* Sep-span uit de markup heeft geen visuele rol meer sinds
       de dashed border-left op .__trigger-to; verbergen voor
       screen readers + visueel. */
    display: none;
}
/* Leeg-state: geen datums gekozen → één centrale "Zoek op datum"
   placeholder. Sep en to-span verbergen, from-span centreren met
   subtiele icon-flair (optioneel via emoji of ::before). */
.ae-datepicker.is-empty .ae-datepicker__trigger-sep,
.ae-datepicker.is-empty .ae-datepicker__trigger-to {
    display: none;
}
.ae-datepicker.is-empty .ae-datepicker__trigger-from {
    flex: 1 1 100%;
    text-align: center;
    color: #6c7a83;
    font-weight: 500;
    border-left: 0;
}

/* Modal-popup --------------------------------------------------- */
/* Backdrop op body wanneer er een datepicker open is. CSS-only
   pseudo-element zodat we geen extra DOM-node hoeven te beheren. */
body.aedp-modal-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 38, 60, 0.32);
    z-index: 1000;
    animation: aedp-fade 140ms ease;
}
@keyframes aedp-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ae-datepicker__popover {
    position: fixed;
    z-index: 1001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(15, 38, 60, 0.18);
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 38, 60, 0.28);
    padding: 18px 20px 16px;
    color: #1f2937;
    font-size: 14px;
    animation: aedp-pop 160ms ease;
}
.ae-datepicker__popover[hidden] { display: none; }
@keyframes aedp-pop {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Nav -------------------------------------------------------------- */
.aedp-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.aedp-nav__titles {
    flex: 1 1 auto;
    display: flex;
    justify-content: space-around;
    gap: 10px;
    font-weight: 700;
    text-transform: capitalize;
    font-size: 15px;
    color: #0f263c;
}
.aedp-nav__title { flex: 1 1 0; text-align: center; }
.aedp-nav__btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    /* Flex-centering zodat de ‹ › chevrons visueel midden in de
       button-box landen. Zonder dit gebruikt 't z'n baseline-
       alignment van de font waardoor de chevrons net iets te
       hoog of laag staan afhankelijk van de gerenderde font. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid rgba(15, 38, 60, 0.14);
    background: #fff;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    color: #1f2937;
    transition: background 120ms ease, border-color 120ms ease;
    /* touch-action: manipulation kill de 300ms tap-delay op
       oudere mobile webviews en sluit double-tap zoom uit
       binnen de popover. */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.aedp-nav__btn:hover { background: #f3f5f7; border-color: #35666f; }

/* Months grid ------------------------------------------------------ */
.aedp-months {
    display: flex;
    gap: 24px;
}
.aedp-month {
    flex: 1 1 0;
    min-width: 0;
}
.aedp-month__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
}
.aedp-month__wd {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6c7a83;
    text-transform: lowercase;
    padding: 4px 0;
}
.aedp-month__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.aedp-cell {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    position: relative;
    transition: background 100ms ease, color 100ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 121, 0, 0.18);
}
.aedp-cell--empty { cursor: default; }
.aedp-cell:not(.is-disabled):not(.aedp-cell--empty):hover {
    background: #e8eff5;
}
.aedp-cell.is-disabled {
    color: #c0c8d0;
    cursor: not-allowed;
}
.aedp-cell.is-in-range,
.aedp-cell.is-preview {
    background: rgba(255, 121, 0, 0.16);
    border-radius: 0;
}
.aedp-cell.is-from,
.aedp-cell.is-to {
    background: #ff7900;
    color: #fff;
    font-weight: 700;
}
.aedp-cell.is-from { border-radius: 8px 0 0 8px; }
.aedp-cell.is-to   { border-radius: 0 8px 8px 0; }
.aedp-cell.is-from.is-to { border-radius: 8px; }

/* Footer ----------------------------------------------------------- */
.aedp-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 38, 60, 0.08);
}
.aedp-foot__msg {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.5px;
    color: #6c7a83;
    line-height: 1.25;
}
.aedp-foot__msg.is-error {
    color: #cf3a3a;
    font-weight: 600;
}
.aedp-foot__btns {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}
.aedp-foot__reset,
.aedp-foot__apply {
    height: 36px;
    padding: 0 18px;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
.aedp-foot__reset {
    background: transparent;
    color: #6c7a83;
    border-color: rgba(15, 38, 60, 0.14);
}
.aedp-foot__reset:hover { background: #f3f5f7; }
.aedp-foot__apply {
    background: #ff7900;
    color: #fff;
}
.aedp-foot__apply:hover { background: #e66f00; }

/* Mobiel: één maand zichtbaar, modal vult bijna het scherm en de
   date-blokken zijn nog wat steviger zodat aantikken op vinger-
   formaat lekker werkt. */
@media (max-width: 720px) {
    .ae-datepicker__popover {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        padding: 14px 14px 12px;
    }
    .aedp-months { gap: 0; }
    .aedp-nav__titles { font-size: 14px; }
    .aedp-cell {
        height: 44px;
        font-size: 15px;
    }
}
