/**
 * FullCalendar Notion-style overrides (U7).
 *
 * ponytail: covers only the 4 stable FC class groups named in the U7 plan
 * (.fc-toolbar, .fc-col-header, .fc-day-today, .fc-event) plus FC's own CSS
 * variables. Accept the maintenance cost when FC upgrades its class names.
 * All colors resolve to tokens.css custom properties — no hardcoded hex.
 */

/* ── FC CSS variable bridge to design tokens ── */
.fc {
  --fc-border-color: var(--border-color);
  --fc-page-bg-color: var(--bg-primary);
  --fc-neutral-bg-color: var(--bg-tertiary);
  --fc-today-bg-color: var(--color-primary-light);
  --fc-now-indicator-color: var(--color-error);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* ── .fc-toolbar: button style aligns with main UI ── */
.fc-toolbar .fc-button {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  text-transform: none;
  box-shadow: none;
  padding: 4px 12px;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.fc-toolbar .fc-button:hover,
.fc-toolbar .fc-button:focus {
  background: var(--bg-tertiary);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  box-shadow: none;
}

.fc-toolbar .fc-button.fc-button-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

.fc-toolbar .fc-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fc-toolbar .fc-button-primary:not(:disabled).fc-button-active:focus {
  box-shadow: none;
}

.fc-toolbar h2.fc-toolbar-title {
  font-size: var(--font-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

/* ── .fc-col-header: weekday header row ── */
.fc .fc-col-header-cell {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.fc .fc-col-header-cell-cushion {
  color: var(--text-tertiary);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-2) 0;
  text-decoration: none;
}

/* ── .fc-day-today: today highlight ── */
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today {
  background: var(--color-primary-light) !important;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

/* ── .fc-event: event card typography + border ── */
.fc-event {
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-tight);
  padding: 1px 4px;
  border-width: 1px;
  cursor: pointer;
}

.fc-event.fc-event-invited {
  border-style: dashed !important;
  border-width: 2px !important;
  opacity: 0.75;
}

.fc .fc-daygrid-event {
  margin-top: 2px;
}

.fc .fc-daygrid-day-events {
  margin-top: var(--space-1);
}

/* ── Dark theme ── */
[data-theme='dark'] .fc {
  --fc-page-bg-color: var(--bg-primary);
  --fc-neutral-bg-color: var(--bg-tertiary);
  --fc-today-bg-color: var(--color-primary-light);
}

[data-theme='dark'] .fc-toolbar .fc-button {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme='dark'] .fc-toolbar .fc-button:hover,
[data-theme='dark'] .fc-toolbar .fc-button:focus {
  background: var(--bg-elevated);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

[data-theme='dark'] .fc-toolbar .fc-button.fc-button-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

[data-theme='dark'] .fc .fc-col-header-cell {
  background: var(--bg-secondary);
}

[data-theme='dark'] .fc .fc-daygrid-day.fc-day-today {
  background: var(--color-primary-light) !important;
}
