/* ---- Availability calendar overlay ---- */
.flatpickr-calendar, .flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year {
    font-family: 'Zilla Slab', sans-serif;
}

/* Flatpickr date picker — restyled to match the custom availability overlay
   below (neutral chrome, square grid lines, yellow selected day, grey/
   strikethrough disabled days) so the two calendars read as one design. */
.flatpickr-calendar {
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    /* content-box so the 0.75rem padding wraps the fixed-width day grid
       instead of squeezing it (flatpickr fixes the grid width). */
    box-sizing: content-box;
    padding: 0.75rem;
}
.flatpickr-current-month {
    font-weight: 600;
    font-size: 115%;
}

/* Month-nav arrows as small bordered boxes, matching the overlay's prev/next. */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    height: auto;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 9px;
    height: 12px;
    fill: var(--ipie-primary, #002b41);
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--ipie-primary, #002b41);
}
.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, .flatpickr-months .flatpickr-next-month.flatpickr-next-month {
    right: 10px /* /*rtl:end:ignore*/;
    top: 5px;
}
.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, .flatpickr-months .flatpickr-next-month.flatpickr-prev-month {
    left: 10px /* /*rtl:end:ignore*/;
    top: 5px;
}
/* Square grid lines (#d2d2d2) on the weekday header and day cells, matching the
   overlay's collapsed table borders. Outer top/left come from the containers;
   each cell supplies its own right/bottom edge. Days are widened to fill their
   column (flatpickr otherwise caps them at 39px with gaps) so the lines join. */
.flatpickr-weekdaycontainer {
    border-top: 1px solid #d2d2d2;
    border-left: 1px solid #d2d2d2;
}
.flatpickr-weekdays {
    height: auto;
}
span.flatpickr-weekday {
    color: #444;
    font-weight: 600;
    font-size: 100%;
    border-right: 1px solid #d2d2d2;
    border-bottom: 1px solid #d2d2d2;
    padding: 10px 0;
}
.dayContainer {
    border-left: 1px solid #d2d2d2;
    justify-content: flex-start;
}
.flatpickr-day {
    position: relative;
    max-width: 14.2857143%;
    border: 0;
    /* !important so every day state keeps the same grid line — flatpickr sets
       per-state border colours (transparent on disabled/adjacent, blue on
       selected) that would otherwise break the grid. */
    border-right: 1px solid #d2d2d2 !important;
    border-bottom: 1px solid #d2d2d2 !important;
    border-radius: 0;
}

/* Selected day: yellow circle centred in the square cell (overlay style). */
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: transparent;
    color: var(--ipie-primary, #002b41);
}
.flatpickr-day.selected::before,
.flatpickr-day.startRange::before,
.flatpickr-day.endRange::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--ipie-accent, #ffd700);
    z-index: -1;
}
/* Today: bold (grid borders handled by the !important rule above). */
.flatpickr-day.today {
    font-weight: 600;
}
.flatpickr-day:hover {
    background: #f0f0f0;
}
.flatpickr-day.selected:hover {
    background: transparent;
}
/* Disabled / past days: grey + strikethrough, matching the overlay's greyed days. */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #888;
    text-decoration: line-through;
}
.room-avail-toggle-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}
.room-avail-disclaimer {
    font-size: 0.95em;
    color: #666;
    margin-top: 0.25rem;
}
#ipie-avail-overlay {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
    font-family: 'Zilla Slab', sans-serif;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: 320px;
    padding: 0.75rem;
    font-size: 0.9rem;
}
#ipie-avail-overlay-inner {
    position: relative;
}
#ipie-avail-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #555;
}
#ipie-avail-close:hover { color: #000; }
#ipie-avail-calendar-content { margin-top: 0.25rem; }
.ipie-avail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.ipie-avail-nav button {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
    font-size: 0.85rem;
}
.ipie-avail-nav button:disabled {
    opacity: 0.3;
    cursor: default;
}
.ipie-avail-nav-label {
    font-weight: 600;
    font-size: 0.95rem;
}
.ipie-avail-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.ipie-avail-grid th,
.ipie-avail-grid td {
    text-align: center;
    padding: 3px 0;
    font-size: 0.9rem;
}
.ipie-avail-grid th {
    font-weight: 600;
    color: #444;
}
.ipie-avail-grid td.ipie-avail-empty { }
.ipie-avail-grid td.ipie-avail-day { }
.ipie-avail-grid td.ipie-avail-greyed { color: #888; text-decoration: line-through; }

/* Check-in/out range highlights — a circle rendered on the inner <span>. */
.ipie-avail-grid td.ipie-avail-range span,
.ipie-avail-grid td.ipie-avail-checkout span {
    display: block;
    padding-top: 3px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    line-height: 1;
}
/* Check-in date and nights in range: yellow filled circle. */
.ipie-avail-grid td.ipie-avail-range span { background: var(--ipie-accent, #ffd700); }
/* Check-out date: yellow border circle only. */
.ipie-avail-grid td.ipie-avail-checkout span { border: 2px solid var(--ipie-accent, #ffd700); }
.ipie-avail-loading {
    text-align: center;
    padding: 1.5rem 0;
    color: #666;
    font-size: 0.85rem;
}
