/* ── Notice ─────────────────────────────────────────── */
.wpd-notice {
  font-size: 0.875rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}
.wpd-notice--success { background: hsl(#63e6be / 0.15); color: hsl(#63e6be); }
.wpd-notice--error   { background: hsl(var(--color-error) / 0.15); color: hsl(var(--color-error)); }

/* ── FullCalendar overrides ─────────────────────────── */
#wpd-calendar        { min-height: 520px; }
#wpd-calendar .fc-toolbar-title          { font-size: 1rem; font-weight: 600; }
#wpd-calendar .fc-button {
  background: transparent;
  border-color: hsl(var(--color-base-100));
  color: hsl(var(--color-primary));
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}
#wpd-calendar .fc-button.fc-prev-button,
#wpd-calendar .fc-button.fc-next-button,
#wpd-calendar .fc-button.fc-today-button {
    background-color: var(--color-accent);
    color: var(--color-neutral);
}
#wpd-calendar .fc-button.fc-prev-button {
    margin-right: 0.25em !important;
}
#wpd-calendar .fc-button:hover,
#wpd-calendar .fc-button-active {
  background-color: hsl(var(--color-primary-content)) !important;
  border-color: hsl(var(--color-primary-content)) !important;
  color: hsl(var(--color-primary)) !important;
}
#wpd-calendar .fc-event {
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 1px 4px;
  cursor: pointer;  /* clickable for edit */
}
#wpd-calendar .fc-daygrid-day-number,
#wpd-calendar .fc-col-header-cell-cushion { color: hsl(var(--color-primary)); text-decoration: none; }
#wpd-calendar .fc-day-today              { background: hsl(var(--color-primary-content) / 0.08) !important; }

.wpd-view-btn.active {
    background-color: var(--color-primary) !important;
    color:#fff
}

/* ── Modals ─────────────────────────────────────────── */
.wpd-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wpd-modal[hidden] { display: none; }

.wpd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.wpd-modal-box {
  background-color: #fff !important;
  position: relative;
  z-index: 1;
  background: hsl(var(--b1));
  border: 1px solid hsl(var(--color-base-100));
  border-radius: 1rem;
  width: 100%;
  max-width: 440px;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: wpdModalIn 0.2s ease;
}
.wpd-modal-box--sm { max-width: 360px; }

@keyframes wpdModalIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.wpd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid hsl(var(--color-base-100));
}
.wpd-modal-heading { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.wpd-modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: hsl(var(--color-primary) / 0.5);
  line-height: 1;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: color 0.15s;
}
.wpd-modal-close:hover { color: hsl(var(--color-primary)); }

.wpd-modal-body   { padding: 1.25rem; }
.wpd-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid hsl(var(--color-base-100));
}

.wpd-delete-msg { font-size: 0.875rem; color: hsl(var(--color-primary) / 0.8); margin: 0; }

/* Modal inline notice */
.wpd-modal-notice {
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.wpd-modal-notice--error   { background: hsl(var(--color-error) / 0.12); color: hsl(var(--color-error)); }
.wpd-modal-notice--success { background: hsl(#63e6be / 0.12); color: hsl(#63e6be); }

/* ── Calendar loader overlay ────────────────────────── */
.wpd-calendar-wrap {
  position: relative;
}

.wpd-cal-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: hsl(var(--b1) / 0.82);
  backdrop-filter: blur(3px);
  border-radius: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Visible state toggled by JS */
.wpd-cal-loader.is-loading {
  opacity: 1;
  pointer-events: auto;
}

/* ── Progress bar track + animated bar ─────────────── */
.wpd-cal-loader__track {
  width: 120px;
  height: 3px;
  border-radius: 99px;
  background: hsl(var(--color-primary-content) / 0.18);
  overflow: hidden;
}

.wpd-cal-loader__bar {
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: hsl(var(--color-primary-content));
  animation: wpdBarSlide 1.2s ease-in-out infinite;
}

@keyframes wpdBarSlide {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(150%); }
  100% { transform: translateX(300%); }
}

/* ── Bouncing dots ──────────────────────────────────── */
.wpd-cal-loader__dots {
  display: flex;
  gap: 5px;
}

.wpd-cal-loader__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--color-primary-content));
  animation: wpdDotBounce 1.1s ease-in-out infinite both;
}
.wpd-cal-loader__dots span:nth-child(1) { animation-delay: 0s;    }
.wpd-cal-loader__dots span:nth-child(2) { animation-delay: 0.18s; }
.wpd-cal-loader__dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes wpdDotBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%            { transform: translateY(-7px); opacity: 1;   }
}

/* ── Label ──────────────────────────────────────────── */
.wpd-cal-loader__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--color-primary) / 0.55);
  margin: 0;
  letter-spacing: 0.02em;
}

/* Keep calendar visible but dimmed beneath the overlay */
.wpd-cal-loader.is-loading + #wpd-calendar {
  pointer-events: none;
  filter: blur(1px);
  transition: filter 0.2s ease;
}

/* ── Button spinner ─────────────────────────────────── */
.wpd-btn-spinner {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: wpdSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4em;
  opacity: 0.8;
}

@keyframes wpdSpin {
  to { transform: rotate(360deg); }
}

/* ── Modal processing overlay ───────────────────────── */
/*
 * While .is-processing, a translucent veil sits over the modal content
 * (backdrop + body + footer) so the user can see the modal is busy but
 * cannot interact with it.
 */
.wpd-modal-box {
  /* needed so the ::after pseudo-overlay is clipped to the box */
  isolation: isolate;
}

.wpd-modal.is-processing .wpd-modal-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: hsl(var(--b1) / 0.45);
  backdrop-filter: blur(1px);
  z-index: 2;
  pointer-events: auto;   /* absorb all clicks */
  cursor: not-allowed;
}

/* Keep the primary-action button (spinner btn) above the overlay */
.wpd-modal.is-processing .wpd-primary-action {
  position: relative;
  z-index: 3;
}