/* FullCalendar, appointment rendering, and calendar effects. */
.manual-block-event { display: flex; width: 100%; min-height: 100%; box-sizing: border-box; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px; padding: 8px 10px; color: #475569; line-height: 1.2; }

.manual-block-event strong { font-size: .85rem; font-weight: 700; line-height: 1.2; }

.manual-block-event span { color: #64748b; font-size: .7rem; line-height: 1.2; }

.manual-block-event__remove { position: absolute; top: 5px; right: 5px; display: grid; width: 22px; height: 22px; place-items: center; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; opacity: 0; transition: opacity 120ms ease, color 120ms ease; }

.manual-block-event__remove svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.fc-event.manual-block-calendar-event:hover .manual-block-event__remove, .manual-block-event__remove:focus-visible { opacity: 1; }

.manual-block-event__remove:hover { background: transparent; color: #fecaca; }

.manual-block-event__remove[data-confirming="true"] { color: #fecaca; }

.manual-block-event.is-remove-confirming { cursor: pointer; }

.manual-block-event.is-remove-confirming strong { color: #fecaca; }

.manual-block-event--mirror, .manual-block-event--mirror span { color: #fff; }

.manual-block-event--mirror { position: relative; overflow: hidden; border-radius: 8px; background: #64748b; }

.manual-block-event--mirror::before { position: absolute; inset: -24px; z-index: 0; background: url('../assets/manual-block-stripes.svg') repeat; content: ''; opacity: .65; animation: manual-block-stripes 360ms linear infinite; }

.manual-block-event--mirror > * { position: relative; z-index: 1; }

@keyframes manual-block-stripes { from { transform: translateX(0); } to { transform: translateX(24px); } }

.fc-event.manual-block-selection-mirror { background: transparent !important; border-color: transparent !important; }

.fc-event.manual-block-calendar-event { background: linear-gradient(135deg, #525d6b 0%, #4b5563 100%) !important; border: 1px solid #374151 !important; }

.fc-daygrid-event.manual-block-calendar-event { border: 0 !important; }

.fc-event.manual-block-calendar-event .fc-event-main { height: 100%; padding: 0; }

.fc-event.manual-block-calendar-event .manual-block-event, .fc-event.manual-block-calendar-event .manual-block-event span { color: #fff; }

.fc-list-event.manual-block-calendar-event { background: #94a3b8; }

.fc-list-event.manual-block-calendar-event .fc-list-event-time, .fc-list-event.manual-block-calendar-event .fc-list-event-title { color: #f8fafc !important; }

.fc-list-event.manual-block-calendar-event:hover { background: #e2e8f0; }

.fc-list-event.manual-block-calendar-event:hover .fc-list-event-time, .fc-list-event.manual-block-calendar-event:hover .fc-list-event-title { color: #1f2937 !important; }

.manual-list-event { min-width: 0; min-height: 42px; color: #475569; }

.manual-list-event .appointment-event__customer { color: #334155; }

.manual-list-event .appointment-event__service { color: #64748b; }

.manual-list-event .appointment-event__status { color: #94a3b8; }

.fc-list-event.manual-block-calendar-event .manual-list-event .appointment-event__customer,
.fc-list-event.manual-block-calendar-event .manual-list-event .appointment-event__service,
.fc-list-event.manual-block-calendar-event .manual-list-event .appointment-event__status { color: #f8fafc !important; }

.fc-list-event.manual-block-calendar-event:hover .manual-list-event .appointment-event__customer,
.fc-list-event.manual-block-calendar-event:hover .manual-list-event .appointment-event__service,
.fc-list-event.manual-block-calendar-event:hover .manual-list-event .appointment-event__status { color: #1f2937 !important; }

#calendar, #calendar:focus, #calendar:focus-visible { outline: none; }

.new-booking-button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: #4f46e5; color: white; font-size: 0.8rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 5px rgba(79,70,229,0.2); transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease; }

.new-booking-button:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(79,70,229,0.25); }

.new-booking-button:focus-visible { outline: 3px solid rgba(79,70,229,0.28); outline-offset: 2px; }

.fc {
  --fc-border-color: #e5e7eb;
  --fc-today-bg-color: #e9edff;
  --fc-neutral-bg-color: #fafafa;
  font-family: var(--font-ui);
}

.fc .fc-day-today { background-color: #e9edff !important; }

.fc .fc-timegrid-col.fc-day-today,
.fc .fc-timegrid-col-bg .fc-day-today { background-color: #e9edff !important; }

.fc .fc-timegrid-col.fc-day-today .fc-timegrid-slot-lane,
.fc .fc-timegrid-col-bg .fc-day-today .fc-timegrid-slot-lane { background-color: #e9edff !important; }

.fc .fc-timegrid-col.fc-day-today { box-shadow: inset 2px 0 #818cf8, inset -2px 0 #818cf8; }

.fc .fc-col-header-cell.fc-day-today { background-color: #c7d2fe; color: #312e81; }

.fc .fc-daygrid-day.fc-day-today { box-shadow: inset 0 0 0 2px rgba(129,140,248,.55); }

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: #4338ca; font-weight: 700; }

.fc .fc-list-day.fc-list-day-today > th { background-color: #c7d2fe; color: #312e81; }

.fc .calendar-day--nonworking { background-color: #f1f3f5 !important; }

.fc .fc-col-header-cell.calendar-day--nonworking { color: #94a3b8; }

.fc .fc-daygrid-day.calendar-day--nonworking .fc-daygrid-day-number { color: #94a3b8; }

.fc .fc-timegrid-now-indicator-line { border-color: #dc2626; border-width: 3px 0 0; box-shadow: 0 0 3px rgba(220,38,38,.4); }

.fc .fc-timegrid-now-indicator-arrow { margin-top: -4px; border-top-color: transparent; border-bottom-color: transparent; border-left-color: #dc2626; filter: drop-shadow(0 0 1.5px rgba(220,38,38,.4)); }

.fc .fc-toolbar-title { font-weight: 600; color: var(--brand); }

.lunch-break-label { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #334155; font-size: .85rem; font-weight: 600; text-align: center; }

.fc .fc-bg-event.lunch-break-background { opacity: 1; background: rgba(148, 163, 184, .22) !important; }

.lunch-break-label span { position: relative; padding: 4px 10px; border-radius: 6px; background: #f1f5f9; color: #1e293b; }

.fc .fc-bg-event { cursor: default; }

.fc .fc-workingWeekToggle-button { border-radius: 999px; }

.fc-theme-standard .fc-scrollgrid,
.fc-theme-standard td,
.fc-theme-standard th { border-color: #e5e7eb; }

.fc-timegrid-event {
  border-radius: 8px;
  border: none !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  padding: 2px 4px;
  background-image: linear-gradient(135deg, rgba(0,0,0,0.16) 0%, rgba(255,255,255,0) 42%, rgba(255,255,255,0.24) 100%);
  background-blend-mode: soft-light;
  background-size: 115% 115%;
  background-position: 0% 0%;
  transform-origin: center;
  transition: transform 180ms ease, box-shadow 180ms ease, background-position 260ms ease, filter 180ms ease;
}

.fc-timegrid-event:not(.manual-block-selection-mirror):not(.fc-event-mirror):hover {
  z-index: 3;
  transform: scale(1.04);
  filter: brightness(1.08) saturate(1.14);
  box-shadow: 0 7px 18px rgba(15,23,42,.2), 0 0 15px rgba(99,102,241,.28);
  background-position: 100% 100%;
}

.fc-timegrid-event:not(.manual-block-selection-mirror):not(.fc-event-mirror):hover::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--event-border-angle), transparent 0 58%, rgba(199,210,254,.25) 68%, #fff 78%, #818cf8 86%, transparent 100%);
  content: '';
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: event-border-orbit 1150ms linear infinite;
}

@keyframes event-border-orbit { to { --event-border-angle: 360deg; } }

.fc-timegrid-event-harness:has(.fc-timegrid-event:hover) {
  z-index: 20 !important;
}

.fc-event-title { font-weight: 600; }

.fc-event-time { font-weight: 400; opacity: 0.85; }

.fc-timegrid-event .fc-event-main { padding: 0; }

.appointment-event {
  min-width: 0;
  padding: 8px 10px;
  line-height: 1.2;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.appointment-event__customer,
.appointment-event__service,
.appointment-event__addons {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-event__customer { font-size: 0.85rem; font-weight: 700; }

.appointment-event__service { margin-top: 1px; font-size: 0.75rem; opacity: 0.9; }

.appointment-event__addons { margin-top: 2px; font-size: .7rem; opacity: .82; }

.fc .fc-button {
  background-color: white;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: var(--ui-accent-ink);
  text-transform: capitalize;
  box-shadow: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fc .fc-resourceTimeGridDay-button,
.fc .fc-timeGridWeek-button,
.fc .fc-dayGridMonth-button,
.fc .fc-listWeek-button { display: inline-flex; align-items: center; gap: 6px; }

.fc-view-button__icon { width: 14px; height: 14px; flex: 0 0 auto; }

.fc .fc-button:hover:not(:disabled) {
  background-color: var(--ui-accent-soft);
  border-color: #a5b4fc;
  color: var(--ui-accent-ink);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.14);
}

.fc .fc-today-button { border-color: transparent; background: transparent; color: #64748b; box-shadow: none; }

.fc .fc-today-button.is-calendar-hidden { display: none !important; }

.fc .fc-today-button:hover:not(:disabled) { border-color: #c7d2fe; background: #f5f3ff; color: #4338ca; box-shadow: none; }

.fc .fc-button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.3);
  outline-offset: 2px;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: var(--ui-accent-soft);
  border-color: #c7d2fe;
  color: var(--ui-accent-ink);
  box-shadow: none !important;
  font-weight: 600;
}

.fc .fc-button-primary:not(:disabled).fc-button-active:hover,
.fc .fc-button-primary:not(:disabled):active:hover {
  background-color: #e0e7ff;
  border-color: #a5b4fc;
  color: var(--ui-accent-ink);
  box-shadow: none !important;
}

.fc .fc-button:disabled { cursor: default; opacity: 0.55; }

.fc .fc-toolbar {
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.fc .fc-toolbar-chunk { display: flex; justify-content: center; }

.fc .fc-toolbar-title { font-size: 1rem; text-align: center; }

.fc .fc-button {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  min-height: 40px;
}

.fc .fc-timegrid-slot-label-cushion { font-size: 0.7rem; }

.fc-event-title, .fc-event-time { font-size: 0.72rem; line-height: 1.1; }

@media (min-width: 640px) {
  .fc .fc-toolbar { flex-direction: row; justify-content: space-between; }
  .fc .fc-toolbar-title { font-size: 1.15rem; }
  .fc-event-title, .fc-event-time { font-size: 0.8rem; }
}

@media (min-width: 1024px) {
  .fc .fc-toolbar-title { font-size: 1.3rem; }
  .fc .fc-button { font-size: 0.875rem; }
  .fc-event-title, .fc-event-time { font-size: 0.85rem; }
}

.fc .fc-toolbar .fc-workingWeekToggle-button {
  min-height: 28px;
  align-self: center;
  padding: 3px 8px;
  border-color: #e2e8f0;
  background: transparent;
  color: #64748b;
  font-size: 0;
  font-weight: 600;
  box-shadow: none;
}

.fc .fc-toolbar .fc-workingWeekToggle-button::after {
  content: attr(data-label);
  font-size: .68rem;
}

.fc .fc-toolbar .fc-workingWeekToggle-button:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
  box-shadow: none;
}

.fc .fc-toolbar .fc-workingWeekToggle-button[aria-pressed="true"] {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.person-tab {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}

.person-tab.active { color: #1f2937; border-bottom-color: #1f2937; }

.agenda-status {
  min-height: 18px;
  margin: 0 4px 8px;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 18px;
}

.agenda-status--warning { color: #92400e; }

.calendar-error { color: #dc2626; font-size: .875rem; }

.fc .fc-col-header-cell-cushion { padding: 10px 6px; font-size: 0.85rem; font-weight: 600; }

.fc .fc-resource .fc-col-header-cell-cushion::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--operator-color, #6b7280);
}

.fc .fc-timegrid-slot { height: 14px; }

.fc .fc-timegrid-slot-minor { border-top-style: dotted; }

.fc .fc-timegrid-slot-lane.calendar-slot--today { background: #f7f7ff !important; }

.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 12px; }

.fc .fc-event { cursor: pointer; }

.fc .fc-daygrid-event { background: transparent !important; border: 0; border-bottom: 1px solid #e5e7eb; color: #1f2937; border-radius: 0; }

.month-event { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 1px 3px; padding: 4px 5px 5px; font-size: 0.78rem; line-height: 1.25; transition: background-color 150ms ease, transform 150ms ease; }

.fc .fc-daygrid-event:hover .month-event { background: #f8fafc; transform: translateX(2px); }

.fc .fc-daygrid-day-frame { min-height: 0; }

.fc .fc-daygrid-more-link { margin: 3px 5px; color: #4f46e5; font-size: 0.72rem; font-weight: 600; }

.fc .fc-daygrid-more-link:hover { color: #4338ca; text-decoration: none; }

.fc-dayGridMonth-view .fc-daygrid-body,
.fc-dayGridMonth-view .fc-daygrid-body > table { height: 100% !important; }

.fc-dayGridMonth-view .fc-daygrid-body > table > tbody > tr { height: 16.6667% !important; }

.fc-dayGridMonth-view .fc-daygrid-day-events { max-height: calc(100% - 24px); overflow: hidden; }

.month-event__dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 999px; }

.month-event__customer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.fc .fc-event-draggable { cursor: grab; }

.fc .fc-event:focus-visible { outline: 2px solid #111827; outline-offset: 2px; }

@media (min-width: 1024px) {
  .fc .fc-toolbar-title { font-size: 1.15rem; }
  .fc .fc-button { min-height: 36px; padding: 6px 12px; font-size: 0.8rem; }
  .appointment-event { line-height: 1.2; padding: 8px 10px; }
  .appointment-event__customer { font-size: 0.85rem; }
  .appointment-event__service { font-size: 0.75rem; }
}

@media (max-width: 639px) {
  .fc .fc-timegrid-slot { height: 22px; }
  .new-booking-button { min-height: 34px; padding: 0 9px; font-size: 0.7rem; }
}

.booking-highlight {
  z-index: 30 !important;
  transform-origin: center;
  animation: booking-highlight 2200ms cubic-bezier(.2,.8,.2,1);
}

.booking-confetti { position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; pointer-events: none; }

.fc-timegrid-event-harness:has(.booking-highlight) { z-index: 30 !important; }

.fc-resourceTimeGridDay-view .appointment-event { padding: 8px 10px; }

.fc-resourceTimeGridDay-view .appointment-event__customer { font-size: 0.85rem; }

.fc-resourceTimeGridDay-view .appointment-event__service { font-size: 0.75rem; }

.appointment-event__status { margin-top: auto; padding-top: 8px; font-size: 0.72rem; font-weight: 500; opacity: 0.78; }

.appointment-event--compact .appointment-event__status { display: none; }

.appointment-event--tiny { justify-content: center; padding: 3px 8px; }

.appointment-event--tiny .appointment-event__customer { font-size: .72rem; }

.appointment-event--tiny .appointment-event__service,
.appointment-event--tiny .appointment-event__status { display: none !important; }

.fc-resourceTimeGridDay-view .appointment-event--compact { padding: 5px 10px; }

.fc-resourceTimeGridDay-view .appointment-event--compact .appointment-event__customer { font-size: 0.82rem; }

.fc-resourceTimeGridDay-view .appointment-event--compact .appointment-event__service { font-size: 0.75rem; }

.fc-resourceTimeGridDay-view .appointment-event--tiny .appointment-event__service { display: none !important; }

.fc-resourceTimeGridDay-view .appointment-event--compact .appointment-event__status { display: none; }

.fc-resourceTimeGridDay-view .appointment-event--roomy .appointment-event__status { display: block; }

@keyframes booking-highlight {
  0% {
    opacity: 0;
    transform: scale(.88);
    filter: brightness(1.35) saturate(1.2);
    box-shadow: 0 0 0 0 rgba(245,158,11,0), 0 0 0 rgba(245,158,11,0);
  }
  12% {
    opacity: 1;
    transform: scale(1.045);
    filter: brightness(1.18) saturate(1.15);
    box-shadow: 0 0 0 7px rgba(245,158,11,.9), 0 0 28px 12px rgba(245,158,11,.48);
  }
  34% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 0 0 3px rgba(245,158,11,.62), 0 0 14px 5px rgba(245,158,11,.25);
  }
  52% {
    transform: scale(1.025);
    box-shadow: 0 0 0 7px rgba(245,158,11,.72), 0 0 24px 9px rgba(245,158,11,.36);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245,158,11,0), 0 0 0 rgba(245,158,11,0);
  }
}

.booking-cancelled {
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
  transform-origin: center;
  animation: booking-cancelled 700ms cubic-bezier(.4,0,.8,.2) forwards;
}

@keyframes booking-cancelled {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgba(239,68,68,0);
  }
  14% {
    transform: translateX(-3px) scale(1.025);
    filter: brightness(1.12) saturate(1.3);
    box-shadow: 0 0 0 6px rgba(239,68,68,.82), 0 0 24px 9px rgba(239,68,68,.4);
  }
  24% { transform: translateX(3px) scale(1.025); }
  34% {
    opacity: 1;
    transform: translateX(-2px) scale(1.015);
    filter: grayscale(.35) brightness(.92);
    box-shadow: 0 0 0 3px rgba(239,68,68,.55), 0 0 12px 4px rgba(239,68,68,.2);
  }
  100% {
    opacity: 0;
    transform: translateY(8px) scale(.78);
    filter: grayscale(1) brightness(.65);
    box-shadow: 0 0 0 0 rgba(239,68,68,0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .booking-highlight { animation: none; }
  .booking-cancelled { display: none; }
  .fc-timegrid-event:hover::after { animation: none; }
}
