/*!
 * AA Jalali Date-Time Picker — استایل مدرن، RTL
 * در پنل مینیاپ و پیشخوان وردپرس یکسان است؛ رنگ‌ها با --jp-* قابل تغییرند.
 */

.aa-jp {
    --jp-ink: #16202e;
    --jp-muted: #8a95a5;
    --jp-line: #e7ecf3;
    --jp-soft: #f4f7fb;
    --jp-accent: #22364e;
    --jp-gold: #ffb321;
    --jp-radius: 18px;

    position: fixed;
    inset: 0;
    z-index: 2147483000;
    direction: rtl;
    font-family: Vazirmatn, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
    color: var(--jp-ink);
    -webkit-tap-highlight-color: transparent;
}

.aa-jp[hidden] {
    display: none !important;
}

.aa-jp-scrim {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 26, 0);
    transition: background .18s ease;
}

.aa-jp.is-sheet .aa-jp-scrim {
    background: rgba(10, 16, 26, .34);
}

.aa-jp-card {
    position: fixed;
    box-sizing: border-box;
    width: 316px;
    padding: 12px 12px 10px;
    border: 1px solid var(--jp-line);
    border-radius: var(--jp-radius);
    background: #fff;
    box-shadow: 0 24px 60px -16px rgba(11, 20, 34, .38), 0 4px 14px -6px rgba(11, 20, 34, .18);
    outline: none;
    animation: aa-jp-pop .16s ease-out;
}

@keyframes aa-jp-pop {
    from { opacity: 0; transform: translateY(6px) scale(.985); }
    to { opacity: 1; transform: none; }
}

/* موبایل: شیت پایین‌بازشو */
.aa-jp.is-sheet .aa-jp-card {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    animation: aa-jp-sheet .22s cubic-bezier(.2, .8, .2, 1);
}

@keyframes aa-jp-sheet {
    from { transform: translateY(26px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

/* ---------- سرصفحه ---------- */

.aa-jp-head {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.aa-jp-nav {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #5b6a7d;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.aa-jp-nav svg {
    width: 18px;
    height: 18px;
}

.aa-jp-nav:hover {
    background: var(--jp-soft);
    color: var(--jp-ink);
}

/* در RTL، دکمهٔ «بعدی» فلش رو‌به‌چپ می‌خواهد */
.aa-jp-nav.is-next svg {
    transform: scaleX(-1);
}

.aa-jp-title {
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--jp-ink);
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -.1px;
    cursor: pointer;
}

.aa-jp-title:hover {
    background: var(--jp-soft);
}

/* ---------- شبکهٔ روزها ---------- */

.aa-jp-week,
.aa-jp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.aa-jp-week {
    margin-bottom: 4px;
}

.aa-jp-week span {
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--jp-muted);
    padding: 4px 0;
}

.aa-jp-grid {
    grid-auto-rows: 36px;
}

.aa-jp-day {
    position: relative;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--jp-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}

.aa-jp-day:hover {
    background: var(--jp-soft);
}

.aa-jp-day.is-today {
    box-shadow: inset 0 0 0 1.5px var(--jp-gold);
}

.aa-jp-day.is-sel {
    background: var(--jp-accent);
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(20, 35, 55, .6);
}

.aa-jp-day.is-sel:hover {
    background: var(--jp-accent);
}

/* ---------- ماه/سال ---------- */

.aa-jp-months,
.aa-jp-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 2px 0 4px;
}

.aa-jp-years {
    grid-template-columns: repeat(4, 1fr);
}

.aa-jp-month,
.aa-jp-year {
    height: 40px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--jp-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.aa-jp-month:hover,
.aa-jp-year:hover {
    background: var(--jp-soft);
}

.aa-jp-month.is-sel,
.aa-jp-year.is-sel {
    background: var(--jp-accent);
    color: #fff;
}

/* ---------- ساعت ---------- */

.aa-jp-time {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--jp-line);
}

.aa-jp-timerow {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.aa-jp-tfield {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.aa-jp-tfield span {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--jp-muted);
}

.aa-jp-tfield select {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--jp-line);
    border-radius: 11px;
    background-color: #fff;
    color: var(--jp-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a95a5' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    background-size: 16px 16px;
}

.aa-jp-tfield select:focus {
    border-color: var(--jp-accent);
    box-shadow: 0 0 0 3px rgba(34, 54, 78, .12);
    outline: none;
}

.aa-jp-colon {
    padding-bottom: 11px;
    font-size: 15px;
    font-weight: 800;
    color: #b4bdc9;
}

.aa-jp-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.aa-jp-quick button {
    padding: 5px 10px;
    border: 1px solid var(--jp-line);
    border-radius: 999px;
    background: var(--jp-soft);
    color: #3c4a5c;
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease;
}

.aa-jp-quick button:hover {
    background: #eaf0f7;
    border-color: #d7e0ea;
}

/* ---------- پایین ---------- */

.aa-jp-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.aa-jp-spacer {
    flex: 1 1 auto;
}

.aa-jp-foot button {
    height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background .14s ease, box-shadow .14s ease;
}

.aa-jp-today {
    border: 1px solid var(--jp-line);
    background: #fff;
    color: #3c4a5c;
}

.aa-jp-today:hover {
    background: var(--jp-soft);
}

.aa-jp-clear {
    border: 0;
    background: transparent;
    color: #98a3b2;
}

.aa-jp-clear:hover {
    color: #b23a36;
    background: #fdeeee;
}

.aa-jp-ok {
    border: 0;
    background: var(--jp-accent);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(20, 35, 55, .7);
}

.aa-jp-ok:hover {
    background: #1a2b40;
}

.aa-jp.is-dateonly .aa-jp-clear {
    margin-inline-start: auto;
}

/* ---------- خود input ---------- */

.aa-jp-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 17px 17px;
    padding-left: 34px;
}

.aa-jp-input:focus {
    outline: none;
}

/* ---------- تم پنل مینیاپ (توکن‌های پروژه) ---------- */

.aa-pwa-app ~ .aa-jp,
.aa-jp {
    --jp-accent: #22364e;
    --jp-gold: #ffb321;
}

/* ---------- پیشخوان وردپرس ---------- */

body.wp-admin .aa-jp-card {
    font-size: 13px;
}

@media (max-width: 640px) {
    .aa-jp-card {
        width: min(360px, calc(100vw - 24px));
    }

    .aa-jp.is-sheet .aa-jp-card {
        width: auto;
    }
}
