/**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */
/******************************* Design Tokens *********************************/
div#calendar,
.order-box {
    --pi-cal-bg: #ffffff;
    --pi-cal-surface: #f8fafc;
    --pi-cal-border: #e2e8f0;
    --pi-cal-text: #0f172a;
    --pi-cal-muted: #64748b;
    --pi-cal-accent: #4f46e5;
    --pi-cal-accent-soft: #eef2ff;
    --pi-cal-radius: 14px;
    --pi-cal-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .18);
    --pi-cal-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*******************************Calendar Top Navigation*********************************/
div#calendar {
    margin: 24px auto;
    padding: 20px;
    width: 640px;
    max-width: 100%;
    box-sizing: border-box;
    font-family: var(--pi-cal-font);
    background: var(--pi-cal-bg);
    border: 1px solid var(--pi-cal-border);
    border-radius: var(--pi-cal-radius);
    box-shadow: var(--pi-cal-shadow);
    color: var(--pi-cal-text);
}

div#calendar *,
div#calendar *::before,
div#calendar *::after {
    box-sizing: border-box;
}

div#calendar div.box {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: transparent;
    margin-bottom: 16px;
}

div#calendar div.header {
    line-height: normal;
    vertical-align: middle;
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    text-align: center;
}

div#calendar div.header a.prev,
div#calendar div.header a.next {
    position: static;
    top: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--pi-cal-surface);
    border: 1px solid var(--pi-cal-border);
    color: var(--pi-cal-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

div#calendar div.header a.prev::before {
    content: "\2039";
    font-size: 18px;
    line-height: 1;
    margin-top: -2px;
}

div#calendar div.header a.next::after {
    content: "\203A";
    font-size: 18px;
    line-height: 1;
    margin-top: -2px;
}

div#calendar div.header a.prev:hover,
div#calendar div.header a.next:hover {
    background: var(--pi-cal-accent-soft);
    border-color: var(--pi-cal-accent);
    color: var(--pi-cal-accent);
    box-shadow: 0 2px 10px rgba(79, 70, 229, .18);
}

div#calendar div.header a.prev:active,
div#calendar div.header a.next:active {
    transform: scale(.97);
}

div#calendar div.header span.title {
    color: var(--pi-cal-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
}

div#calendar div.header a.prev {
    justify-self: start;
}

div#calendar div.header a.next {
    justify-self: end;
}




/******************************* Calendar Grid *********************************/
div#calendar div.box-content {
    border: 0;
    padding-top: 12px;
    border-top: 1px solid var(--pi-cal-border);
}

div#calendar ul.label,
div#calendar ul.dates {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

div#calendar ul.label {
    margin-bottom: 8px;
}

div#calendar ul.label li {
    margin: 0;
    padding: 8px 0;
    min-width: 0;
    list-style: none;
    text-align: center;
    color: var(--pi-cal-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

div#calendar ul.dates li {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
    height: 80px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background: var(--pi-cal-surface);
    color: var(--pi-cal-text);
    border: 1px solid var(--pi-cal-border);
    border-radius: 12px;
    transition: background-color .15s ease, border-color .15s ease;
}

div#calendar ul.dates li:nth-child(7n),
div#calendar ul.dates li:nth-child(7n - 1) {
    background: #f1f5f9;
}

div#calendar ul.dates li:has(.pisol-order-count) {
    background: var(--pi-cal-accent-soft);
    border-color: #c7d2fe;
    color: #3730a3;
}

div#calendar ul.dates li:not(.mask):hover,
div#calendar ul.dates li:focus-within {
    background: var(--pi-cal-accent-soft);
    border-color: var(--pi-cal-accent);
}

div#calendar ul.dates li.mask {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

div#calendar div.clear {
    clear: both;
}

div#calendar .pisol-order-count {
    position: absolute;
    top: 5px;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    max-width: calc(100% - 4px);
    padding: 3px 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 2px 6px rgba(79, 70, 229, .2);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: box-shadow .15s ease, transform .15s ease;
}

div#calendar .pisol-order-count:hover {
    color: #fff;
    background: #3730a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, .3);
}

div#calendar a:focus-visible,
.order-box a:focus-visible,
.order-box button:focus-visible {
    outline: 2px solid var(--pi-cal-accent);
    outline-offset: 3px;
}

/******************************* Order Popup *********************************/
.order-box {
    box-sizing: border-box;
    width: 70%;
    max-width: 960px;
    background: var(--pi-cal-bg);
    color: var(--pi-cal-text);
    font-family: var(--pi-cal-font);
    margin: 24px auto;
    position: relative;
    padding: 12px 50px 12px 12px;
    border: 1px solid var(--pi-cal-border);
    border-radius: var(--pi-cal-radius);
    box-shadow: var(--pi-cal-shadow);
}

.order-box h3 {
    color: var(--pi-cal-text);
    font-size: 18px;
    line-height: 1.5;
}

.order-box .pi-status {
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 8px 12px;
    background: #166534;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.order-box .pi-status-cancelled,
.order-box .pi-status-refunded {
    background: #b91c1c;
}

.order-box .pi-status:hover {
    filter: brightness(.9);
    color: #fff;
}

/******************************* Small Screens *********************************/
@media (max-width: 600px) {
    div#calendar {
        padding: 12px;
        margin: 16px auto;
    }

    div#calendar div.header {
        gap: 6px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    div#calendar div.header span.title {
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    div#calendar div.header a.prev,
    div#calendar div.header a.next {
        min-height: 36px;
        padding: 6px 8px;
        font-size: 12px;
    }

    div#calendar ul.label,
    div#calendar ul.dates {
        gap: 4px;
    }

    div#calendar ul.label li {
        font-size: 11px;
        overflow-wrap: anywhere;
    }

    div#calendar ul.dates li {
        height: 70px;
        padding-top: 24px;
        border-radius: 8px;
        font-size: 16px;
    }

    div#calendar .pisol-order-count {
        top: 2px;
        right: 2px;
        font-size: 10px;
    }

    .order-box {
        width: 94%;
    }
}

@media (prefers-reduced-motion: reduce) {
    div#calendar ul.dates li,
    div#calendar div.header a.prev,
    div#calendar div.header a.next,
    div#calendar .pisol-order-count {
        transition: none;
        transform: none;
    }
}
