/* Dual-calendar (Hijri / Gregorian) date picker.
   Loaded on the front-end layouts and inside the Filament admin panel. */

.hdp-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.hdp-display {
    cursor: pointer;
    background-image: none;
}
.hdp-display::placeholder {
    color: #9ca3af;
}

/* Popup */
.hdp-pop {
    position: fixed;
    z-index: 99999;
    width: 300px;
    max-width: calc(100vw - 16px);
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 0.6rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    padding: 12px;
    direction: rtl;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}
.hdp-hidden {
    display: none !important;
}

.hdp-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.hdp-toggle button {
    flex: 1;
    font: inherit;
    font-size: 12px;
    padding: 5px 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
}
.hdp-toggle button.hdp-active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
    font-weight: 700;
}

.hdp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 8px;
    direction: ltr; /* keep ‹ prev on the left, › next on the right */
}
.hdp-nav {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    color: #374151;
}
.hdp-nav:hover {
    background: #f3f4f6;
}
.hdp-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    direction: rtl;
}

.hdp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.hdp-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    padding: 4px 0;
}
.hdp-day {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    padding: 7px 0;
    border-radius: 6px;
    cursor: pointer;
    color: #111827;
}
.hdp-day:hover:not(:disabled) {
    background: #fef3c7;
}
.hdp-day.hdp-today {
    box-shadow: inset 0 0 0 1px #f59e0b;
}
.hdp-day.hdp-selected {
    background: #f59e0b;
    color: #ffffff;
    font-weight: 700;
}
.hdp-day:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}
.hdp-day.hdp-pad {
    visibility: hidden;
}

.hdp-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.hdp-foot button {
    font: inherit;
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
}
.hdp-foot button:hover {
    background: #f3f4f6;
}

/* Dark mode (Filament toggles `.dark` on <html>) */
.dark .hdp-pop,
[data-theme="dark"] .hdp-pop {
    background: #1f2937;
    color: #f3f4f6;
    border-color: #374151;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.dark .hdp-toggle button,
[data-theme="dark"] .hdp-toggle button,
.dark .hdp-foot button,
[data-theme="dark"] .hdp-foot button {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}
.dark .hdp-toggle button.hdp-active,
[data-theme="dark"] .hdp-toggle button.hdp-active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #111827;
}
.dark .hdp-nav,
[data-theme="dark"] .hdp-nav,
.dark .hdp-day,
[data-theme="dark"] .hdp-day {
    color: #e5e7eb;
}
.dark .hdp-nav:hover,
[data-theme="dark"] .hdp-nav:hover,
.dark .hdp-day:hover:not(:disabled),
[data-theme="dark"] .hdp-day:hover:not(:disabled) {
    background: #4b5563;
}
.dark .hdp-day:disabled,
[data-theme="dark"] .hdp-day:disabled {
    color: #4b5563;
}
