/* Grafik zajęć — ładowany tylko na stronach grafiku. */

body.schedule .site-main {
  max-width: 1400px;
}

/* Sterowanie grafikiem — bez zaznaczania, żeby dwuklik nie łapał tekstu przycisków. */
.schedule-nav-btn,
.schedule-tab,
.schedule-filters-toggle,
.schedule-chip,
.schedule-day-header {
  user-select: none;
  -webkit-user-select: none;
}

.schedule-page {
  width: 100%;
  margin: 1.5rem 0 0.5rem;
}

.schedule-week {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.schedule-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 1rem;
  border-radius: 50px;
  border: 1px solid rgba(184, 158, 220, 0.35);
  background: rgba(111, 77, 164, 0.22);
  color: #d4b8f0;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.schedule-nav-btn:hover {
  transform: translateY(-2px);
  background: rgba(111, 77, 164, 0.4);
  border-color: rgba(201, 167, 245, 0.6);
  color: #fff;
}

.schedule-week-label {
  min-width: 260px;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 600;
  color: #c9a7f5;
}

.schedule-filters-toggle {
  display: none;
  margin: 0 auto 1rem;
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  border: 1px solid rgba(184, 158, 220, 0.35);
  background: rgba(111, 77, 164, 0.22);
  color: #d4b8f0;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.schedule-chip-count {
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 50px;
  background: #9b6dd7;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.schedule-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.schedule-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.schedule-filter-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a892c8;
  padding-left: 0.9rem;
  text-align: left;
}

.schedule-filter-select {
  appearance: none;
  max-width: 260px;
  padding: 0.5rem 2.1rem 0.5rem 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(111, 77, 164, 0.45);
  background-color: rgba(61, 43, 90, 0.55);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b89edc' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.85rem;
  color: #d4b8f0;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.schedule-filter-select:hover {
  border-color: rgba(201, 167, 245, 0.6);
  color: #e6d6ff;
}

.schedule-filter-select:focus-visible {
  outline: none;
  border-color: #c9a7f5;
  box-shadow: 0 0 0 3px rgba(201, 167, 245, 0.25);
}

.schedule-filter-select.is-active {
  background-color: rgba(155, 109, 215, 0.45);
  border-color: rgba(201, 167, 245, 0.75);
  color: #fff;
  font-weight: 600;
}

.schedule-filter-select option {
  background: #2a1a47;
  color: #eddfff;
  font-weight: 400;
}

.schedule-filters-reset {
  display: flex;
  justify-content: center;
  width: 100%;
}

.schedule-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(111, 77, 164, 0.4);
  background: rgba(61, 43, 90, 0.45);
  color: #b89edc;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.schedule-chip:hover {
  background: rgba(111, 77, 164, 0.35);
  color: #e6d6ff;
}

/* Zakładki dni */
.schedule-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.schedule-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 96px;
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(111, 77, 164, 0.3);
  background: rgba(26, 14, 46, 0.6);
  color: #b89edc;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.schedule-tab:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(201, 167, 245, 0.5);
  color: #e6d6ff;
}

.schedule-tab[aria-selected="true"] {
  background: linear-gradient(140deg, #6f4da4, #4a3370);
  border-color: rgba(201, 167, 245, 0.7);
  color: #fff;
}

.schedule-tab:disabled {
  opacity: 0.4;
  cursor: default;
}

.schedule-tab-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.schedule-tab-date {
  font-size: 0.68rem;
  opacity: 0.75;
}

.schedule-tab-count {
  margin-top: 0.15rem;
  padding: 0.05rem 0.45rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.62rem;
}

.schedule-tab.is-today .schedule-tab-name::after {
  content: " •";
  color: #ffd479;
}

/* Zajęcia wybranego dnia */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.schedule-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(111, 77, 164, 0.3);
  border-left: 4px solid var(--accent, #9b6dd7);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(61, 43, 90, 0.65) 0%, rgba(26, 14, 46, 0.75) 100%);
  padding: 0.8rem 0.85rem;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.schedule-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(111, 77, 164, 0.35);
  border-color: rgba(201, 167, 245, 0.5);
}

.schedule-card-time {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.schedule-card-duration {
  margin-left: 0.4rem;
  font-size: 0.7rem;
  color: #9f88c4;
}

.schedule-card-name {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: #eddfff;
}

.schedule-card-meta {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: #a892c8;
}

.schedule-card-spots {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.18rem 0.55rem;
  border-radius: 50px;
  background: rgba(111, 77, 164, 0.3);
  color: #cbb2ec;
  font-size: 0.68rem;
  font-weight: 600;
}

.schedule-card-spots.is-full {
  background: rgba(164, 77, 77, 0.3);
  color: #f0b8b8;
}

.schedule-state,
.schedule-empty {
  padding: 2.5rem 1rem;
  color: #a990c9;
}

.schedule-empty {
  font-size: 0.85rem;
  color: #a892c8;
}

.schedule-state.is-error {
  color: #f0b8b8;
}

.schedule-legend {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #b89edc;
}

/* Modal zapisu */
.schedule-stale {
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(249, 212, 35, 0.35);
  background: rgba(249, 212, 35, 0.1);
  font-size: 0.78rem;
  color: #f9d423;
}

.schedule-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 6, 22, 0.75);
  backdrop-filter: blur(4px);
}

.schedule-modal-overlay[hidden] {
  display: none;
}

.schedule-modal {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(111, 77, 164, 0.5);
  background: linear-gradient(160deg, #2a1a47 0%, #1a0e2e 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  text-align: left;
}

.schedule-modal h2 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.schedule-modal-sub {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(111, 77, 164, 0.3);
  font-size: 0.8rem;
  color: #a892c8;
}

.schedule-modal-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(111, 77, 164, 0.4);
  background: rgba(61, 43, 90, 0.5);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.schedule-modal-option:hover {
  transform: translateY(-2px);
  background: rgba(111, 77, 164, 0.45);
  border-color: rgba(201, 167, 245, 0.6);
}

.schedule-modal-option-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.schedule-modal-option-desc {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: #b09bd0;
}

.schedule-modal-close {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  border: none;
  background: none;
  color: #a892c8;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.schedule-modal-close:hover {
  color: #fff;
}

/* Grafik stały (arkusz) */
.schedule-grid-week {
  display: grid;
  grid-template-columns: repeat(var(--days, 5), minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(111, 77, 164, 0.3);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(26, 14, 46, 0.45);
}

.schedule-day {
  border-right: 1px solid rgba(111, 77, 164, 0.2);
}

.schedule-day:last-child {
  border-right: none;
}

.schedule-day-header {
  padding: 0.6rem 0.5rem;
  background: linear-gradient(140deg, #6f4da4, #3d2b5a);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
}

.schedule-day-slots {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
}

.schedule-day-empty {
  padding: 0.75rem 0;
  color: #a892c8;
}

.schedule-slot {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(111, 77, 164, 0.25);
  background: linear-gradient(160deg, rgba(61, 43, 90, 0.55) 0%, rgba(26, 14, 46, 0.7) 100%);
  text-align: left;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.schedule-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 167, 245, 0.5);
  box-shadow: 0 10px 24px rgba(111, 77, 164, 0.3);
}

.schedule-slot-hours {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
  color: #d4b8f0;
  font-variant-numeric: tabular-nums;
}

.schedule-slot-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.schedule-slot-name {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #eddfff;
}

.schedule-slot-group {
  margin-top: 0.1rem;
  font-size: 0.68rem;
  color: #b89edc;
}

.schedule-slot-instructor {
  margin-top: 0.1rem;
  font-size: 0.66rem;
  font-style: italic;
  color: #a892c8;
}

.schedule-slot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.schedule-slot-tag {
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(111, 77, 164, 0.35);
  background: rgba(111, 77, 164, 0.18);
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  color: #cbb2ec;
}

/* Poniżej tej szerokości kolumna dnia jest za wąska na godziny obok treści. */
@media (max-width: 1100px) {
  .schedule-slot {
    flex-direction: column;
    gap: 0.15rem;
  }

  .schedule-slot-hours {
    flex-direction: row;
    gap: 0.1rem;
  }
}

@media (max-width: 760px) {
  .schedule-filters-toggle {
    display: block;
  }

  .schedule-filters.is-collapsed {
    display: none;
  }

  .schedule-filters {
    flex-direction: column;
    gap: 0.6rem;
  }

  .schedule-filter {
    width: 100%;
  }

  .schedule-filter-label {
    padding-left: 0;
    text-align: center;
  }

  .schedule-filter-select {
    width: 100%;
    max-width: none;
  }

  .schedule-week-label {
    order: -1;
    flex: 1 1 100%;
    min-width: 0;
    margin-bottom: 0.5rem;
  }

  .schedule-tabs {
    gap: 0.3rem;
  }

  .schedule-tab {
    flex: 1 1 28%;
    min-width: 0;
    padding: 0.5rem 0.4rem;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .schedule-grid-week {
    grid-template-columns: 1fr;
  }

  .schedule-day {
    border-right: none;
    border-bottom: 1px solid rgba(111, 77, 164, 0.2);
  }

  .schedule-day:last-child {
    border-bottom: none;
  }
}
