/* Sandbox autoschedule — local testing mode on Scheduler2 calendar */

body.page-scheduler2.scheduler-sandbox-active .admin-calendar-grid,
body.page-scheduler2.scheduler-sandbox-active .employee-sidebar,
body.page-scheduler2.scheduler-sandbox-active .calendar-controls {
    filter: grayscale(0.55) brightness(0.92);
    transition: filter 0.35s ease;
}

body.page-scheduler2.scheduler-sandbox-active .scheduler-sandbox-banner,
body.page-scheduler2.scheduler-sandbox-active .scheduler-sandbox-rules-panel,
body.page-scheduler2.scheduler-sandbox-active #sandboxAutoscheduleBtn {
    pointer-events: auto;
    filter: none;
}

.scheduler-sandbox-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(76, 29, 149, 0.35);
}

body.page-scheduler2.scheduler-sandbox-active .scheduler-sandbox-banner {
    display: flex;
}

.scheduler-sandbox-banner-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.scheduler-sandbox-banner-label i {
    opacity: 0.9;
}

.scheduler-sandbox-banner-hint {
    font-size: 0.82rem;
    opacity: 0.88;
    font-weight: 400;
}

.scheduler-sandbox-exit-btn {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.scheduler-sandbox-exit-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 770px) {
    .scheduler-sandbox-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 0.82rem;
    }

    .scheduler-sandbox-banner-hint {
        display: block;
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .scheduler-sandbox-exit-btn {
        align-self: flex-end;
    }
}

#sandboxAutoscheduleBtn {
    background: #7c3aed;
    color: #fff;
    border-color: #6d28d9;
}

#sandboxAutoscheduleBtn:hover:not(:disabled) {
    background: #6d28d9;
}

#sandboxAutoscheduleBtn.active {
    background: #5b21b6;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.45);
}

#sandboxAutoscheduleBtn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.scheduler-sandbox-rules-panel {
    display: none;
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9000;
    width: min(320px, calc(100vw - 32px));
    background: var(--card-bg, #1e1e2e);
    border: 1px solid rgba(124, 58, 237, 0.45);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

body.page-scheduler2.scheduler-sandbox-active .scheduler-sandbox-rules-panel {
    display: block;
}

.scheduler-sandbox-rules-header {
    padding: 12px 14px;
    background: rgba(124, 58, 237, 0.18);
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheduler-sandbox-rules-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.scheduler-sandbox-rule {
    padding: 10px 14px;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.scheduler-sandbox-rule-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.25);
    color: #a78bfa;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 8px;
}

.scheduler-sandbox-rule-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.scheduler-sandbox-rule-desc {
    margin: 4px 0 0 28px;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.35;
}

.scheduler-sandbox-rule.active {
    background: rgba(124, 58, 237, 0.14);
    border-left-color: #a78bfa;
}

.scheduler-sandbox-rule.active .scheduler-sandbox-rule-num {
    background: #7c3aed;
    color: #fff;
    animation: sandbox-rule-pulse 1s ease-in-out infinite;
}

.scheduler-sandbox-rule.done {
    opacity: 0.55;
}

.scheduler-sandbox-rule.done .scheduler-sandbox-rule-num {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.scheduler-sandbox-rules-status {
    padding: 10px 14px;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    min-height: 2.4em;
}

@keyframes sandbox-rule-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* Week selection */
.week-label-cell.sandbox-week-picker {
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.week-label-cell.sandbox-week-picker:hover {
    background: rgba(124, 58, 237, 0.12);
}

.week-label-cell.sandbox-week-picker:focus {
    outline: 2px solid rgba(124, 58, 237, 0.55);
    outline-offset: -2px;
}

.week-label-cell.sandbox-week-label-selected {
    background: rgba(124, 58, 237, 0.22);
    box-shadow: inset 0 0 0 2px rgba(167, 139, 250, 0.65);
}

body.scheduler-sandbox-pick-week .week-label-cell.sandbox-week-picker {
    animation: sandbox-week-pick-hint 1.6s ease-in-out infinite;
}

@keyframes sandbox-week-pick-hint {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(167, 139, 250, 0); }
    50% { box-shadow: inset 0 0 0 2px rgba(167, 139, 250, 0.45); }
}

.admin-calendar-day.sandbox-week-selected {
    box-shadow: inset 0 0 0 2px rgba(124, 58, 237, 0.55);
    background: rgba(124, 58, 237, 0.08);
}

.admin-calendar-day.sandbox-day-scheduling {
    box-shadow: inset 0 0 0 3px #a78bfa, 0 0 16px rgba(167, 139, 250, 0.45);
    background: rgba(124, 58, 237, 0.18) !important;
    z-index: 2;
    position: relative;
    animation: sandbox-day-scheduling-pulse 0.9s ease-in-out infinite;
}

.admin-calendar-day.sandbox-day-done {
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.1) !important;
}

.admin-calendar-day.sandbox-week-selected.sandbox-day-done {
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.65);
}

@keyframes sandbox-day-scheduling-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}
