/* Scoped styling for the jQuery UI datepicker widget (Purchase Date field, New Owner panel).
   Matches the V2 design system — does not affect any other page since it only targets
   .ui-datepicker and its descendants, which no other CSS file currently styles. */

.ui-datepicker {
    position: absolute;
    display: none;
    width: 260px;
    padding: 12px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-family: var(--font-family);
    font-size: 14px;
    z-index: 1000;
}

.ui-datepicker .ui-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text);
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background: var(--color-border);
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    display: none; /* hide default icon sprite text; replaced with arrows below */
}

.ui-datepicker .ui-datepicker-prev::before { content: "‹"; font-size: 18px; }
.ui-datepicker .ui-datepicker-next::before { content: "›"; font-size: 18px; }

.ui-datepicker .ui-datepicker-title {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex: 1;
}

.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
    padding: 2px 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 13px;
}

.ui-datepicker table {
    width: 100%;
    border-collapse: collapse;
}

.ui-datepicker th {
    padding: 4px;
    text-align: center;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 12px;
}

.ui-datepicker td {
    padding: 2px;
    text-align: center;
}

.ui-datepicker td span,
.ui-datepicker td a {
    display: block;
    padding: 6px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text);
    cursor: pointer;
}

.ui-datepicker td a:hover {
    background: var(--color-border);
}

.ui-datepicker td .ui-datepicker-today a,
.ui-datepicker td.ui-datepicker-current-day a {
    background: var(--color-primary);
    color: var(--color-white);
}

.ui-datepicker .ui-datepicker-unselectable {
    color: var(--color-border-hover);
}

/* Transparent click-catcher sitting exactly over the year <select> — intercepts
   the click before the browser opens the native (uncappable) year popup, so our
   custom list below can open instead. The select stays visible underneath and
   still receives focus/keyboard input normally; only the mouse click is caught. */
.reg-year-catcher {
    position: absolute; /* size/position set inline via JS to match the year <select> exactly */
    z-index: 3;
    cursor: pointer;
}

/* Custom year list overlay (Purchase Date field only) — replaces the native
   year <select>'s open popup, which the browser renders full-height with no
   way to cap it to a few rows. Shows 5 years at a time; scroll for the rest. */
.reg-year-list {
    position: absolute; /* left/width set inline via JS to match the clicked select exactly */
    top: 100%;
    z-index: 2;
    max-height: 130px; /* ~5 rows at the item height below */
    overflow-y: auto;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    font-family: var(--font-family);
    font-size: 13px;
}

.reg-year-list__item {
    padding: 6px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.reg-year-list__item:hover {
    background: var(--color-border);
}

.reg-year-list__item.is-selected {
    background: var(--color-primary);
    color: var(--color-white);
}
