/*
 * FieldHub date picker mockup — styling extracted from
 * uam/htdocs/v3/scss/jsapp3/jsapp3-datepicker.scss (fh-urbase).
 *
 * Loaded AFTER vendor/vue-datepicker.css so these rules override the stock theme.
 */

/* ------------------------------------------------------------------
 * Vendor theme variables (jsapp3-datepicker.scss .dp__theme_light)
 * ------------------------------------------------------------------ */

.dp__theme_light {
    --dp-background-color: #ffffff;
    --dp-icon-color: #59676b;
    --dp-border-color: #ced4da;
    --dp-text-color: #495057;
    --dp-border-color-hover: #aaaeb7;
    --dp-hover-color: #f3f3f3;
    --dp-hover-text-color: #212121;
    --dp-hover-icon-color: #959595;
    --dp-primary-color: #1976d2;
    --dp-primary-text-color: #f8f5f5;
    --dp-secondary-color: #c0c4cc;
    --dp-disabled-color: #f6f6f6;
    --dp-scroll-bar-background: #f3f3f3;
    --dp-scroll-bar-color: #959595;
    --dp-success-color: #76d275;
    --dp-danger-color: #ff6f60;
    --dp-disabled-color-text: #8e8e8e;
}

:root {
    --dp-font-family: "Open Sans", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --dp-border-radius: 1px;
    --dp-cell-border-radius: 1px;
    --dp-font-size: 13px;
    --dp-cell-size: 35px;
    --dp-cell-padding: 5px;
    --dp-common-padding: 10px;
    --dp-month-year-row-height: 35px;
    --dp-input-padding: 6px 12px;

    /* Page chrome */
    --fh-header-blue: #03a9f4;
    --fh-calendar-header-blue: #0398db;
    --fh-input-border: #ced4da;
    --fh-input-addon-bg: #e9ecef;
    --fh-label-color: #59676b;
    --fh-text: #212121;
    --fh-muted: #59676b; /* was #8a9296 — bumped for WCAG AA on 11px text */
    --fh-focus-ring: #1976d2;
    --fh-page-bg: #f4f6f8;
    --fh-panel-bg: #ffffff;
    --fh-panel-border: #e3e8ec;
}

/* ------------------------------------------------------------------
 * Page shell (mockup harness only — not part of the component)
 * ------------------------------------------------------------------ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--dp-font-family);
    font-size: 13px;
    color: var(--fh-text);
    background: var(--fh-page-bg);
    -webkit-font-smoothing: antialiased;
}

.app-header {
    background: #263238;
    color: #fff;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.app-header__text {
    flex: 1 1 320px;
    min-width: 0;
}

.app-header__docs-btn {
    flex-shrink: 0;
    display: inline-block;
    padding: 8px 16px;
    background: #0398db;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
}

.app-header__docs-btn:hover {
    background: #0284bd;
}

.app-header__docs-btn:focus-visible {
    outline: 2px solid #80d8ff;
    outline-offset: 2px;
}

.app-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.app-header p {
    margin: 6px 0 0;
    font-size: 12px;
    color: #b0bec5;
}

.app-header code {
    color: #80d8ff;
    font-size: 11px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    padding: 24px 28px 120px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.panel {
    background: var(--fh-panel-bg);
    border: 1px solid var(--fh-panel-border);
    border-radius: 3px;
    margin-bottom: 20px;
}

.panel__title {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fh-panel-border);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.panel__title small {
    font-weight: 400;
    color: var(--fh-muted);
    font-size: 11px;
}

.panel__body {
    padding: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px 20px;
}

.note {
    font-size: 11px;
    color: var(--fh-muted);
    margin: 8px 0 0;
    line-height: 1.5;
}

.note--warn {
    color: #b26a00;
    background: #fff8e1;
    border-left: 3px solid #ffb300;
    padding: 8px 10px;
    margin-top: 12px;
}

.value-readout {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    background: #263238;
    color: #b2ebf2;
    padding: 10px 12px;
    border-radius: 2px;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
    margin: 0;
}

.sidebar {
    position: sticky;
    top: 24px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    cursor: pointer;
}

.toggle-row input {
    cursor: pointer;
}

.event-log {
    max-height: 220px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    line-height: 1.7;
}

.event-log div {
    border-bottom: 1px solid #f0f3f5;
    padding: 2px 0;
    color: #546e7a;
}

.event-log strong {
    color: #1976d2;
}

/* ------------------------------------------------------------------
 * FormRow chrome (common/forms/layout/form-row)
 * ------------------------------------------------------------------ */

.form-row-component {
    position: relative;
}

.form-row-component .form-field-group > label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--fh-label-color);
    font-weight: 600;
}

.field-input-container {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 100%;
}

.value-icon-wrapper {
    flex-shrink: 0;
}

.value-icon-wrapper .value-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100%;
    min-height: 32px;
    padding: 0;
    font: inherit;
    background: var(--fh-input-addon-bg);
    border: 1px solid var(--fh-input-border);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    color: #59676b;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.value-icon-wrapper .value-icon:hover {
    background: #dde2e6;
}

.value-icon-wrapper .value-icon:focus-visible,
.field-clear:focus-visible,
.dp--preset-range:focus-visible {
    outline: 2px solid var(--fh-focus-ring);
    outline-offset: 1px;
}

.value-icon-wrapper .value-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    pointer-events: none;
}

.form-row-component--disabled .value-icon-wrapper .value-icon {
    cursor: not-allowed;
    color: var(--dp-disabled-color-text);
    background: var(--dp-disabled-color);
}

.field-input-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.form-row-component .dp__input {
    border: 1px solid var(--fh-input-border);
    border-radius: 0 4px 4px 0;
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    line-height: 20px;
    height: 34px;
    width: 100%;
    color: var(--fh-text);
    font-family: var(--dp-font-family);
}

.form-row-component .dp__input::placeholder {
    color: #767676; /* was #b0bcc2 — 4.5:1 on white */
}

.form-row-component--focused .dp__input,
.form-row-component .dp__input:focus {
    outline: none;
    border-color: #66afe9;
    box-shadow: 0 0 4px rgba(102, 175, 233, 0.5);
}

.form-row-component--focused .value-icon-wrapper .value-icon {
    border-color: #66afe9;
}

.form-row-component--error .dp__input,
.form-row-component--error .value-icon-wrapper .value-icon {
    border-color: var(--dp-danger-color);
}

.field-error {
    color: #d32f2f;
    font-size: 11px;
    margin-top: 4px;
}

.field-hint {
    color: var(--fh-muted);
    font-size: 11px;
    margin-top: 4px;
}

/* Clear ("x") button rendered by FormRow when the field has a value */
.field-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 0;
    background: transparent;
    color: #9aa5aa;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 2;
}

.field-clear:hover {
    background: #eceff1;
    color: #546e7a;
}

.field-clear svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ------------------------------------------------------------------
 * Datepicker menu (jsapp3-datepicker.scss)
 * ------------------------------------------------------------------ */

.dp__main {
    font-family: var(--dp-font-family);
}

.dp__menu {
    padding: 8px;
    border-radius: 1px;
    font-family: var(--dp-font-family);
    font-size: 13px;
    border: 1px solid var(--dp-border-color);
    z-index: 1050;
    box-shadow: 0 5px 25px 0 rgba(123, 123, 123, 0.15);
}

.dp__menu:not(.time-input-menu):not(.datepicker-multi-calendars):not(.datepicker-with-presets) {
    width: 260px;
    min-width: 260px;
}

.dp__menu.datepicker-multi-calendars,
.dp__menu.datepicker-with-presets {
    width: auto;
}

/* Preset ranges sidebar (proposed addition — no jsapp3 equivalent yet) */
.dp--preset-dates {
    border-right: 1px solid var(--dp-border-color);
    padding: 5px;
    min-width: 118px;
}

.dp--preset-range {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--dp-text-color);
    font-family: var(--dp-font-family);
    font-size: 12px;
    line-height: 1.5;
    padding: 5px 8px;
    border-radius: 1px;
    cursor: pointer;
    white-space: nowrap;
}

.dp--preset-range:hover {
    background: var(--dp-hover-color);
    color: var(--dp-hover-text-color);
}

.dp__menu_inner {
    padding: 0;
}

/* Custom month/year header — replaces the stock nav row */
.dp__month_year_row {
    display: flex;
    align-items: center;
    height: auto;
    color: var(--dp-text-color);
    width: 100%;
}

/* Weekday header row */
.dp__calendar_header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    background-color: var(--fh-calendar-header-blue);
    font-weight: normal;
    border: 0;
    width: 100%;
    white-space: nowrap;
}

.dp__calendar_header_item {
    text-align: center;
    flex-grow: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    height: 40px;
    width: auto;
    font-weight: normal;
}

.dp__calendar_header_separator {
    display: none;
}

/* DateInput #calendar-header slot marks indexes 5 and 6 */
.red-color {
    color: #ffcdd2;
}

.dp__calendar_row {
    margin: 5px 0;
}

.dp__cell_inner {
    border-radius: 1px;
    height: 35px;
    width: 35px;
    padding: 5px;
    border: 1px solid transparent;
    font-size: 13px;
}

.dp__today {
    border: 1px solid var(--dp-primary-color);
}

/*
 * highlightToday prop (proposed addition). Applied via the library's dayClass
 * hook, so it is independent of noToday — the bold marking and the today
 * outline can be toggled separately. Bold only, no background fill.
 */
.dp__cell_inner.fh-today {
    font-weight: 700;
}

.dp__active_date,
.dp__range_start,
.dp__range_end {
    background: var(--dp-primary-color);
    color: var(--dp-primary-text-color);
}

.dp__range_between {
    background: var(--dp-hover-color);
    border-radius: 0;
    border-top: 1px solid var(--dp-hover-color);
    border-bottom: 1px solid var(--dp-hover-color);
}

/* Multi-calendar spacing */
.dp__menu .dp__instance_calendar > .dp__flex_display > .dp__instance_calendar:nth-child(2) {
    margin-left: 15px;
}

.dp__menu .dp__instance_calendar > .dp__flex_display > .dp__instance_calendar:nth-child(2) > .dp__calendar {
    margin-left: 0;
}

/* Inline time picker (DateTimeInput) */
.date-time-input-menu {
    position: relative;
}

.date-time-input-menu .dp__time_picker_inline_container {
    justify-content: center;
}

.date-time-input-menu .dp__time_input .dp__btn {
    border: none;
    outline: none;
    background: #fff;
}

.date-time-input-menu .dp__time_input .dp__pm_am_button {
    width: 40px;
    border-radius: 4px;
}

.date-time-input-menu .dp__time_input > .dp__time_col {
    padding: 0 8px;
}

.date-time-input-menu .dp__time_input > .dp__time_col > .dp__time_display {
    border: none;
    outline: none;
    background: #fff;
}

.date-time-input-menu .dp__time_input > .dp__time_col > .dp__btn {
    position: relative;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
 * Hour/minute steppers — intentional improvement over production, whose
 * flat 10x2px #e0e0e0 bars read as dashes rather than arrows. These form
 * clear chevrons in the field-label gray with a primary-blue hover.
 */
.date-time-input-menu .dp__tp_btn_in_l,
.date-time-input-menu .dp__tp_btn_in_r,
.time-input-menu .dp__tp_btn_in_l,
.time-input-menu .dp__tp_btn_in_r {
    display: block;
    width: 12px;
    height: 3px;
    border-radius: 2px;
    background-color: #59676b;
    transition: background-color 0.12s ease;
}

.date-time-input-menu .dp__tp_inline_btn_top .dp__tp_btn_in_l,
.time-input-menu .dp__tp_inline_btn_top .dp__tp_btn_in_l {
    transform: rotate(-35deg) translate(3px, 0);
}

.date-time-input-menu .dp__tp_inline_btn_top .dp__tp_btn_in_r,
.time-input-menu .dp__tp_inline_btn_top .dp__tp_btn_in_r {
    transform: rotate(35deg) translate(-3px, 0);
}

.date-time-input-menu .dp__tp_inline_btn_bottom .dp__tp_btn_in_l,
.time-input-menu .dp__tp_inline_btn_bottom .dp__tp_btn_in_l {
    transform: rotate(35deg) translate(3px, 0);
}

.date-time-input-menu .dp__tp_inline_btn_bottom .dp__tp_btn_in_r,
.time-input-menu .dp__tp_inline_btn_bottom .dp__tp_btn_in_r {
    transform: rotate(-35deg) translate(-3px, 0);
}

.date-time-input-menu .dp__btn:hover .dp__tp_btn_in_l,
.date-time-input-menu .dp__btn:hover .dp__tp_btn_in_r,
.time-input-menu .dp__btn:hover .dp__tp_btn_in_l,
.time-input-menu .dp__btn:hover .dp__tp_btn_in_r {
    background-color: #1976d2;
}

/* Time-only picker menu (TimeInput) */
.time-input-menu.dp__menu {
    min-width: 215px;
}

/* Non-inline time columns render SVG chevrons — size and color them. */
.time-input-menu .dp__inc_dec_button,
.date-time-input-menu .dp__inc_dec_button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    padding: 0;
    color: #59676b;
    cursor: pointer;
    border-radius: 2px;
}

.time-input-menu .dp__inc_dec_button svg,
.date-time-input-menu .dp__inc_dec_button svg {
    width: 22px;
    height: 22px;
}

.time-input-menu .dp__inc_dec_button:hover,
.date-time-input-menu .dp__inc_dec_button:hover {
    color: #1976d2;
    background: var(--dp-hover-color);
}

.time-input-menu .dp__time_picker_inline_container {
    justify-content: center;
}

.time-input-menu .dp__time_input .dp__btn {
    border: none;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.time-input-menu .dp__time_input .dp__pm_am_button {
    width: 40px;
    border-radius: 4px;
    background: var(--dp-primary-color);
    color: var(--dp-primary-text-color);
}

.time-input-menu .dp__time_input > .dp__time_col {
    padding: 0 8px;
}

.time-input-menu .dp__time_input > .dp__time_col > .dp__time_display {
    border: none;
    outline: none;
    background: #fff;
}

.time-input-menu .dp__time_input > .dp__time_col > .dp__btn {
    position: relative;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Docs panel */
.doc-list {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
}

.doc-list dt {
    font-weight: 600;
    color: var(--fh-text);
    margin-top: 10px;
}

.doc-list dt:first-child {
    margin-top: 0;
}

.doc-list dd {
    margin: 2px 0 0;
    color: var(--fh-muted);
}

.doc-list code {
    font-size: 11px;
    background: #f0f3f5;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Arrow */
.dp__arrow_top {
    border-left: 1px solid var(--dp-border-color);
    border-top: 1px solid var(--dp-border-color);
    background-color: var(--dp-background-color);
    height: 12px;
    width: 12px;
}

.dp__arrow_bottom {
    border-right: 1px solid var(--dp-border-color);
    border-bottom: 1px solid var(--dp-border-color);
    background-color: var(--dp-background-color);
    height: 12px;
    width: 12px;
}
