/* ===================== */
/*   SCHEDULE GRID       */
/* ===================== */

/* --- Nav bar --- */
.schedule__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.schedule__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background-color: var(--color-dark);
  color: var(--color-cream);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.schedule__nav-btn:hover {
  background-color: #333;
}

.schedule__week-label {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-dark);
  min-width: 200px;
  text-align: center;
}

/* --- Loading spinner --- */
.schedule__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) 0;
  gap: var(--space-md);
  color: var(--color-body-light);
  font-size: var(--text-sm);
}

.schedule__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border-light);
  border-top-color: var(--color-dark);
  border-radius: 50%;
  animation: schedule-spin 0.8s linear infinite;
}

@keyframes schedule-spin {
  to { transform: rotate(360deg); }
}

.schedule__loading.is-hidden {
  display: none;
}

/* --- Error / fallback --- */
.schedule__error {
  display: none;
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--color-body-light);
}

.schedule__error.is-visible {
  display: block;
}

.schedule__error a {
  color: var(--color-dark);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
}

/* --- Desktop grid (7 columns) --- */
.schedule__grid {
  display: none;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.schedule__grid.is-visible {
  display: grid;
}

/* Day column */
.schedule__day {
  background-color: var(--color-cream-light);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.schedule__day.is-past {
  opacity: 0.55;
}

.schedule__day.is-today {
  opacity: 1;
}

.schedule__day.is-today .schedule__day-header {
  background-color: var(--color-dark);
  color: var(--color-cream);
}

.schedule__day.is-today .schedule__day-header span {
  color: var(--color-cream);
}

/* Day header */
.schedule__day-header {
  background-color: #1a1a1a;
  color: var(--color-cream);
  padding: var(--space-sm);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.schedule__day-name {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.schedule__day-date {
  display: block;
  font-size: var(--text-xs);
  opacity: 0.7;
}

/* Period divider (Ochtend / Middag / Avond) */
.schedule__period {
  padding: var(--space-xs) var(--space-sm);
}

.schedule__period-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-body-light);
  opacity: 0.6;
}

/* --- Event card --- */
.schedule__event {
  margin: 0 6px 6px;
  padding: 8px 10px;
  background-color: var(--color-white);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-dark);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.schedule__event:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.schedule__event-time {
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  color: var(--color-dark);
  margin-bottom: 2px;
}

.schedule__event-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-dark);
  margin-bottom: 2px;
  line-height: 1.3;
}

.schedule__event-trainer {
  font-size: 10px;
  color: var(--color-body-light);
}

.schedule__event-spots {
  font-size: 10px;
  color: var(--color-body-dark);
  margin-top: 2px;
}

/* Color modifiers — left border per class type */
.schedule__event--wod        { border-left-color: #E85D3A; }
.schedule__event--basic      { border-left-color: #4A90D9; }
.schedule__event--core       { border-left-color: #7B61FF; }
.schedule__event--strength   { border-left-color: #D4A017; }
.schedule__event--hyrox      { border-left-color: #E8B500; }
.schedule__event--oly        { border-left-color: #2ECC71; }
.schedule__event--endurance  { border-left-color: #1ABC9C; }
.schedule__event--senior     { border-left-color: #9B59B6; }
.schedule__event--opengym    { border-left-color: #95A5A6; }
.schedule__event--kids       { border-left-color: #E67E22; }

/* --- Mobile list view --- */
.schedule__list {
  display: none;
}

.schedule__list.is-visible {
  display: block;
}

.schedule__list-day {
  margin-bottom: var(--space-lg);
}

.schedule__list-day.is-past {
  opacity: 0.55;
}

.schedule__list-day.is-today .schedule__list-header {
  background-color: var(--color-dark);
  color: var(--color-cream);
}

.schedule__list-header {
  background-color: #1a1a1a;
  color: var(--color-cream);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.schedule__list-day-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.schedule__list-day-date {
  font-size: var(--text-sm);
  opacity: 0.7;
}

.schedule__list-events {
  background-color: var(--color-cream-light);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: var(--space-sm);
}

.schedule__list-period-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-body-light);
  opacity: 0.6;
  padding: var(--space-xs) var(--space-xs) 2px;
}

/* Reuse event card styles in list view */
.schedule__list-events .schedule__event {
  margin: 0 0 var(--space-xs);
}

.schedule__list-events .schedule__event-title {
  font-size: var(--text-sm);
}

.schedule__list-events .schedule__event-time {
  font-size: var(--text-xs);
}

.schedule__list-events .schedule__event-trainer {
  font-size: var(--text-xs);
}

.schedule__list-events .schedule__event-spots {
  font-size: var(--text-xs);
}

.schedule__list-empty {
  font-size: var(--text-sm);
  color: var(--color-body-dark);
  padding: var(--space-sm);
  text-align: center;
  font-style: italic;
}

/* --- Responsive --- */
@media (min-width: 769px) {
  .schedule__grid.is-visible {
    display: grid;
  }
  .schedule__list {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .schedule__grid {
    display: none !important;
  }
  .schedule__list.is-visible {
    display: block;
  }
  .schedule__week-label {
    font-size: var(--text-base);
    min-width: auto;
  }
}
