/* Hebrew Date Picker — shared styles (single + range) */

.fi-hebrew-panel {
    direction: rtl;
    color: rgb(17 24 39);
}
:is(.dark .fi-hebrew-panel) {
    color: rgb(249 250 251);
}

.fi-hebrew-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem;
}

.fi-hebrew-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    border-radius: 0.375rem;
    cursor: pointer;
    background: transparent;
    border: none;
    color: inherit;
    transition: background-color 150ms ease;
}
.fi-hebrew-nav-btn:hover {
    background-color: rgb(243 244 246);
}
:is(.dark .fi-hebrew-nav-btn:hover) {
    background-color: rgb(55 65 81);
}
.fi-hebrew-nav-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.fi-hebrew-month-year-display {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}
.fi-hebrew-month-btn,
.fi-hebrew-year-btn {
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    background: transparent;
    border: none;
    color: inherit;
    transition: background-color 150ms ease;
}
.fi-hebrew-month-btn:hover,
.fi-hebrew-year-btn:hover {
    background-color: rgb(243 244 246);
}
:is(.dark .fi-hebrew-month-btn:hover),
:is(.dark .fi-hebrew-year-btn:hover) {
    background-color: rgb(55 65 81);
}

.fi-hebrew-range-display {
    font-weight: 600;
    font-size: 0.875rem;
    flex: 1;
    text-align: center;
    color: rgb(55 65 81);
}
:is(.dark .fi-hebrew-range-display) {
    color: rgb(209 213 219);
}

.fi-hebrew-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
}
.fi-hebrew-grid-item {
    padding: 0.625rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: center;
    font-size: 0.875rem;
    background: transparent;
    border: 1px solid transparent;
    color: rgb(55 65 81);
    transition: all 150ms ease;
}
:is(.dark .fi-hebrew-grid-item) {
    color: rgb(209 213 219);
}
.fi-hebrew-grid-item:hover {
    background-color: rgb(243 244 246);
}
:is(.dark .fi-hebrew-grid-item:hover) {
    background-color: rgb(55 65 81);
}
.fi-hebrew-grid-item-selected {
    background-color: var(--primary-600, rgb(79 70 229)) !important;
    color: white !important;
    font-weight: 600;
}

/* Clear (X) button inside the range input */
.fi-input-wrapper.fi-hebrew-date-picker,
.fi-hebrew-date-picker {
    position: relative;
}
.fi-hebrew-clear-x {
    position: absolute;
    inset-inline-end: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgb(107 114 128);
    border-radius: 9999px;
    z-index: 10;
}
.fi-hebrew-clear-x:hover {
    background-color: rgb(243 244 246);
    color: rgb(17 24 39);
}
:is(.dark .fi-hebrew-clear-x:hover) {
    background-color: rgb(55 65 81);
    color: rgb(243 244 246);
}
.fi-hebrew-clear-x-icon {
    width: 1rem;
    height: 1rem;
}

/* Calendar switcher (Hebrew / Gregorian tabs) */
.fi-hebrew-cal-switch {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 0.5rem;
    background-color: rgb(243 244 246);
    border-radius: 0.5rem;
}
:is(.dark .fi-hebrew-cal-switch) {
    background-color: rgb(31 41 55);
}
.fi-hebrew-cal-switch-btn {
    flex: 1;
    padding: 0.3125rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: rgb(107 114 128);
    transition: all 150ms ease;
}
.fi-hebrew-cal-switch-active {
    background-color: white;
    color: rgb(17 24 39);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
:is(.dark .fi-hebrew-cal-switch-active) {
    background-color: rgb(55 65 81);
    color: rgb(243 244 246);
}

/* Expanded day cell: primary (Hebrew) + secondary (Gregorian) lines */
.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-expanded {
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
    height: 2.75rem;
}
.fi-hebrew-day-secondary {
    font-size: 0.625rem;
    opacity: 0.6;
}

/* Event marking dot (expanded mode) */
.fi-hebrew-event-dot {
    width: 0.3125rem;
    height: 0.3125rem;
    border-radius: 9999px;
    background-color: rgb(99 102 241);
    margin-top: 0.0625rem;
}
.fi-fo-date-time-picker-calendar-day[data-event-type="yomtov"] { color: rgb(21 128 61); font-weight: 700; }
.fi-fo-date-time-picker-calendar-day[data-event-type="yomtov"] .fi-hebrew-event-dot { background-color: rgb(22 163 74); }
.fi-fo-date-time-picker-calendar-day[data-event-type="cholhamoed"] { color: rgb(180 83 9); }
.fi-fo-date-time-picker-calendar-day[data-event-type="cholhamoed"] .fi-hebrew-event-dot { background-color: rgb(217 119 6); }
.fi-fo-date-time-picker-calendar-day[data-event-type="fast"] { color: rgb(120 113 108); }
.fi-fo-date-time-picker-calendar-day[data-event-type="fast"] .fi-hebrew-event-dot { background-color: rgb(120 113 108); }
.fi-fo-date-time-picker-calendar-day[data-event-type="minor"] .fi-hebrew-event-dot { background-color: rgb(202 138 4); }
.fi-fo-date-time-picker-calendar-day[data-event-type="chanukah"] .fi-hebrew-event-dot { background-color: rgb(217 119 6); }
.fi-fo-date-time-picker-calendar-day[data-event-type="roshchodesh"] .fi-hebrew-event-dot { background-color: rgb(79 70 229); }
.fi-fo-date-time-picker-calendar-day[data-event-type="shabbat"] .fi-hebrew-event-dot { background-color: rgb(190 24 93); }
:is(.dark .fi-fo-date-time-picker-calendar-day[data-event-type="yomtov"]) { color: rgb(74 222 128); }
:is(.dark .fi-fo-date-time-picker-calendar-day[data-event-type="cholhamoed"]) { color: rgb(251 191 36); }

/* Shabbat / holiday emphasis */
.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-shabbat:not(.fi-hebrew-day-selected) {
    color: rgb(190 24 93);
    font-weight: 700;
}
:is(.dark .fi-fo-date-time-picker-calendar-day.fi-hebrew-day-shabbat:not(.fi-hebrew-day-selected)) {
    color: rgb(244 114 182);
}
.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-holiday:not(.fi-hebrew-day-selected) {
    font-weight: 700;
}

.fi-hebrew-gregorian-line {
    text-align: center;
    font-size: 0.75rem;
    color: rgb(107 114 128);
    font-variant-numeric: tabular-nums;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgb(229 231 235);
}
:is(.dark .fi-hebrew-gregorian-line) {
    color: rgb(156 163 175);
    border-top-color: rgb(55 65 81);
}

.fi-hebrew-today-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgb(229 231 235);
}
:is(.dark .fi-hebrew-today-container) {
    border-top-color: rgb(55 65 81);
}
.fi-hebrew-today-btn {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    background: transparent;
    border: 1px solid rgb(209 213 219);
    color: inherit;
    transition: all 150ms ease;
}
.fi-hebrew-today-btn:hover {
    background-color: rgb(243 244 246);
    border-color: rgb(156 163 175);
}
:is(.dark .fi-hebrew-today-btn) {
    border-color: rgb(75 85 99);
}
:is(.dark .fi-hebrew-today-btn:hover) {
    background-color: rgb(55 65 81);
    border-color: rgb(107 114 128);
}

.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-selected {
    background-color: var(--primary-600, rgb(79 70 229)) !important;
    color: white !important;
    border-radius: 9999px !important;
    font-weight: 600;
}
.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-today:not(.fi-hebrew-day-selected) {
    border: 2px solid var(--primary-600, rgb(79 70 229));
    border-radius: 9999px;
}
.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-holiday:not(.fi-hebrew-day-selected) {
    background-color: rgba(79, 70, 229, 0.15);
    border-radius: 9999px;
}
.fi-fo-date-time-picker-calendar-day.fi-hebrew-day-in-range:not(.fi-hebrew-day-selected) {
    background-color: rgba(79, 70, 229, 0.12);
}
:is(.dark .fi-fo-date-time-picker-calendar-day.fi-hebrew-day-in-range:not(.fi-hebrew-day-selected)) {
    background-color: rgba(129, 140, 248, 0.18);
}
.fi-fo-date-time-picker-calendar-day.fi-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Base layout fallbacks (mirrors Filament defaults so range-only pages still render) */
.fi-hebrew-date-picker .fi-fo-date-time-picker-panel {
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    padding: 1rem;
    min-width: 280px;
}
.dark .fi-hebrew-date-picker .fi-fo-date-time-picker-panel {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
    color: rgb(249 250 251);
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-calendar-header-day {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(107 114 128);
    padding: 0.25rem;
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 150ms ease;
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-calendar-day:hover:not(.fi-disabled):not(.fi-hebrew-day-selected) {
    background-color: rgb(243 244 246);
    border-radius: 9999px;
}
.dark .fi-hebrew-date-picker .fi-fo-date-time-picker-calendar-day:hover:not(.fi-disabled):not(.fi-hebrew-day-selected) {
    background-color: rgb(55 65 81);
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-trigger {
    display: block;
    width: 100%;
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-display-text-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
}
.fi-hebrew-date-picker .fi-fo-date-time-picker-display-text-input:focus {
    outline: none;
}
