/* ==========================================================================
   انتخاب‌گر تاریخ شمسی (PersianDatePicker) — استایل سراسری
   این فایل روی همه صفحات ادمین لود می‌شود چون کامپوننت در چند فرم به کار رفته.
   (طراحی «شیشه‌ای» هماهنگ با صفحات سال تحصیلی — بنفش لوگو #41029C)
   نکته سرعت: backdrop-filter فقط روی پاپ‌آپ کوچک تقویم است.
   ========================================================================== */

:root {
    --ay-brand: #41029c;
    --ay-brand-deep: #34017e;
    --ay-brand-mid: #5b21b6;
    --ay-brand-bright: #7c3aed;
    --ay-lavender: #dda8f8;
    --ay-ring: rgba(65, 2, 156, .2);
    --ay-glass-highlight: rgba(255, 255, 255, .72);
}

/* بدنه انتخابگر: شیشه + کالیبره با اجزای فیلامنت */
.pdp-root {
    position: relative;
    width: 100%;
}

.pdp-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: inherit;
}

.pdp-display {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    font-family: inherit;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--fi-color, inherit);
    padding: 0;
}

.pdp-display::placeholder {
    color: rgba(104, 95, 119, .9);
}

.pdp-display:focus,
.pdp-display:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

.pdp-icon {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--ay-brand-mid);
    margin-inline-start: .5rem;
    pointer-events: none;
}

.dark .pdp-icon {
    color: var(--ay-lavender);
}

/* پاپ‌آپ تقویم — شیشه بنفش */
.pdp-popover {
    position: absolute;
    top: calc(100% + .45rem);
    inset-inline-start: 0;
    z-index: 60;
    width: 19.5rem;
    max-width: calc(100vw - 2rem);
    padding: .9rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(65, 2, 156, .2);
    box-shadow:
        0 6px 12px -6px rgba(15, 10, 35, .18),
        0 26px 54px -22px rgba(65, 2, 156, .5),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}

.dark .pdp-popover {
    background: rgba(30, 21, 50, .84);
    border-color: rgba(147, 51, 234, .28);
}

.pdp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    margin-bottom: .55rem;
}

.pdp-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    border: 1px solid rgba(65, 2, 156, .16);
    background: rgba(255, 255, 255, .72);
    color: var(--ay-brand);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.pdp-nav-btn:hover {
    background: rgba(221, 168, 248, .38);
}

.pdp-nav-btn:active {
    transform: scale(.94);
}

.dark .pdp-nav-btn {
    background: rgba(65, 2, 156, .28);
    border-color: rgba(147, 51, 234, .35);
    color: var(--ay-lavender);
}

.dark .pdp-nav-btn:hover {
    background: rgba(124, 58, 237, .42);
}

.pdp-nav-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.pdp-nav-title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--ay-brand-deep);
}

.dark .pdp-nav-title {
    color: #e9d5ff;
}

.pdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .2rem;
    margin-bottom: .35rem;
}

.pdp-weekday {
    text-align: center;
    font-size: .74rem;
    font-weight: 700;
    color: var(--ay-brand-mid);
    padding: .28rem 0;
    border-radius: .5rem;
    background: rgba(65, 2, 156, .05);
}

.dark .pdp-weekday {
    color: var(--ay-lavender);
    background: rgba(147, 51, 234, .1);
}

.pdp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .2rem;
}

.pdp-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: .6rem;
    border: 1px solid transparent;
    font-size: .82rem;
    font-weight: 600;
    color: #3b3550;
    background: transparent;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
}

.pdp-cell:hover {
    background: rgba(221, 168, 248, .45);
    color: var(--ay-brand-deep);
}

.pdp-cell:active {
    transform: scale(.92);
}

.pdp-cell--empty {
    cursor: default;
}

.pdp-cell--today {
    border-color: var(--ay-brand);
    color: var(--ay-brand);
    font-weight: 800;
}

.pdp-cell--selected {
    background: linear-gradient(135deg, var(--ay-brand), var(--ay-brand-mid));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px -6px rgba(65, 2, 156, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.pdp-cell--selected:hover {
    background: linear-gradient(135deg, var(--ay-brand), var(--ay-brand-mid));
    color: #fff;
}

.dark .pdp-cell {
    color: #d9d2e8;
}

.dark .pdp-cell:hover {
    background: rgba(124, 58, 237, .3);
    color: #fff;
}

.dark .pdp-cell--today {
    border-color: var(--ay-lavender);
    color: var(--ay-lavender);
}

.pdp-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: .6rem;
    padding-top: .55rem;
    border-top: 1px dashed rgba(65, 2, 156, .18);
}

.dark .pdp-footer {
    border-top-color: rgba(147, 51, 234, .24);
}

.pdp-clear {
    font-size: .78rem;
    font-weight: 700;
    color: var(--ay-brand-mid);
    background: transparent;
    border: 0;
    padding: .25rem .6rem;
    border-radius: .5rem;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}

.pdp-clear:hover {
    background: rgba(65, 2, 156, .08);
    color: var(--ay-brand-deep);
}

.dark .pdp-clear {
    color: var(--ay-lavender);
}

.dark .pdp-clear:hover {
    background: rgba(147, 51, 234, .18);
    color: #fff;
}

/* کاهش حرکت برای کاربران حساس به انیمیشن */
@media (prefers-reduced-motion: reduce) {
    .pdp-cell,
    .pdp-nav-btn,
    .pdp-clear {
        transition: none !important;
    }
}