/* Group classes schedule — shared between home (/) and /l/grupovi */

#schedule { scroll-margin-top: 80px; }
#schedule .sched {
  max-width: 1100px; margin: 0 auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px;
  padding: 18px 16px;
}
@media (min-width: 700px) { #schedule .sched { padding: 24px; } }

/* Week navigator */
#schedule .sched-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 16px;
}
#schedule .sched-week-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: transparent; color: #fff; cursor: pointer; font-size: 18px; line-height: 1;
  display: grid; place-items: center; transition: background .15s ease, border-color .15s ease;
  font-family: inherit;
}
#schedule .sched-week-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--accent); }
#schedule .sched-week-btn:disabled { opacity: 0.35; cursor: not-allowed; }
#schedule .sched-week {
  font-family: 'Benzin', sans-serif; font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em; min-width: 180px; text-align: center;
}
@media (min-width: 700px) { #schedule .sched-week { font-size: 17px; min-width: 220px; } }

/* Day tabs */
#schedule .sched-days {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px;
  margin: 0 -4px 18px; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
#schedule .sched-days::-webkit-scrollbar { height: 6px; }
#schedule .sched-days::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
#schedule .sched-day {
  flex: 1 0 auto; min-width: 64px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  font-family: inherit; color: #fff;
}
@media (min-width: 700px) { #schedule .sched-day { flex: 1; min-width: 0; padding: 12px 14px; } }
#schedule .sched-day:hover { border-color: rgba(126,255,110,0.4); }
#schedule .sched-day.is-active {
  background: var(--accent); border-color: var(--accent); color: #000;
}
#schedule .sched-day.is-today::after {
  content: '·'; display: block; line-height: 0; font-size: 28px; color: var(--accent);
  margin-top: 2px;
}
#schedule .sched-day.is-active.is-today::after { color: #000; }
#schedule .sched-day .dow {
  display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 3px; font-weight: 500;
}
#schedule .sched-day.is-active .dow { color: rgba(0,0,0,0.6); }
#schedule .sched-day .dom {
  display: block; font-family: 'Benzin', sans-serif; font-weight: 800; font-size: 18px;
  line-height: 1; font-variant-numeric: tabular-nums;
}
#schedule .sched-day .cnt {
  display: block; font-size: 10px; color: var(--fg-subtle); margin-top: 4px;
}
#schedule .sched-day.is-active .cnt { color: rgba(0,0,0,0.55); }
#schedule .sched-day.is-empty { opacity: 0.55; }

/* Class list */
#schedule .sched-list { display: flex; flex-direction: column; gap: 16px; min-height: 120px; }

/* Day sections (visible on tablet/desktop, hidden on mobile except active) */
#schedule .day-section { display: none; flex-direction: column; gap: 8px; scroll-margin-top: 80px; }
#schedule .day-section.is-active { display: flex; animation: dayFadeIn .35s cubic-bezier(.4,.2,.2,1) both; }
@keyframes dayFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
/* Swipe hint on tabs scroller */
#schedule .sched-list { touch-action: pan-y; }
#schedule .day-section-head { position: static; display: none; align-items: baseline; gap: 12px; padding: 0 4px 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
#schedule .day-section-head h4 {
  font-family: 'Benzin', sans-serif; font-weight: 700; font-size: 16px; margin: 0;
  color: #fff; letter-spacing: 0.01em;
}
#schedule .day-section-head h4 em { font-style: normal; color: var(--accent); font-weight: 800; margin-right: 8px; }
#schedule .day-section-head .day-count { font-size: 12px; color: var(--fg-muted); margin-left: auto; font-variant-numeric: tabular-nums; }
#schedule .day-section.is-today .day-section-head h4::before {
  content: 'СЬОГОДНІ'; display: inline-block; background: var(--accent); color: #000;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; padding: 3px 7px; border-radius: 4px;
  margin-right: 10px; vertical-align: middle; line-height: 1;
}
#schedule .day-empty {
  padding: 18px 16px; text-align: center; color: var(--fg-subtle); font-size: 13px;
  background: var(--bg-3); border: 1px dashed var(--border); border-radius: 12px;
}

/* DESKTOP ≥1024px: 4-day rolling window (today + 3 next), no day tabs */
@media (min-width: 1024px) {
  #schedule .sched-days { display: none; }
  #schedule .sched-list {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px; align-items: start;
  }
  #schedule .day-section { display: none; }
  #schedule .day-section.is-window {
    display: flex; gap: 8px; min-width: 0;
    padding: 10px 8px 10px;
    border-radius: 14px;
  }
  #schedule .day-section.is-window.is-today {
    background: rgba(126,255,110,0.05);
    outline: 1px solid rgba(126,255,110,0.3);
  }

  /* Day header */
  #schedule .day-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px; padding: 0 8px 10px; margin: 0 0 6px;
    border-bottom: 1px solid var(--border); border-radius: 0;
    background: transparent;
  }
  #schedule .day-section-head h4 {
    font-family: 'Benzin', sans-serif; font-weight: 700;
    font-size: 14px; letter-spacing: 0.02em; color: #fff;
    display: flex; align-items: baseline; gap: 6px; line-height: 1;
  }
  #schedule .day-section-head h4 em {
    font-style: normal; color: var(--fg-muted); font-size: 11px;
    font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    margin-right: 0;
  }
  #schedule .day-section-head .day-count {
    font-size: 11px; color: var(--fg-subtle);
    font-variant-numeric: tabular-nums;
  }
  #schedule .day-section.is-window.is-today .day-section-head h4::before { content: none; }
  #schedule .day-section.is-window.is-today .day-section-head h4 em { color: var(--accent); }

  #schedule .sched-count { display: none; }
  #schedule .day-empty {
    padding: 16px 10px; font-size: 12px; line-height: 1.4;
    background: transparent; border: 1px dashed var(--border);
    color: var(--fg-subtle);
  }

  /* Card — wider columns ~250px, more comfortable */
  #schedule .cls {
    grid-template-columns: 1fr; border-radius: 12px; padding: 0;
    border: 1px solid var(--border); background: var(--bg-3);
    transition: border-color .15s ease, transform .15s ease, box-shadow .2s ease;
  }
  #schedule .cls:hover {
    background: var(--bg-3); border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(126,255,110,0.15);
  }
  #schedule .cls .cls-body { padding: 14px 14px 14px; gap: 10px; }
  #schedule .cls .cls-head {
    flex-direction: row; align-items: baseline;
    gap: 12px; width: 100%; flex-wrap: nowrap;
  }
  #schedule .cls .cls-time {
    gap: 4px; align-items: center; white-space: nowrap;
    flex-wrap: nowrap; flex-shrink: 0;
  }
  #schedule .cls .cls-time .hhmm {
    font-family: 'Benzin', sans-serif; font-weight: 800;
    font-size: 19px; line-height: 1; color: #fff; letter-spacing: 0.01em;
  }
  #schedule .cls .cls-title {
    font-family: 'Benzin', sans-serif; font-weight: 700;
    font-size: 13.5px; line-height: 1.25; color: #fff; margin: 0;
    flex: 1; min-width: 0;
    white-space: normal; word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #schedule .cls .cls-desc { display: none; }
  #schedule .cls .cls-foot {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  }
  #schedule .cls .cls-trainer {
    gap: 8px; min-width: 0; overflow: hidden; flex: 1;
  }
  #schedule .cls .cls-trainer img { width: 24px; height: 24px; }
  #schedule .cls .cls-trainer .name {
    font-size: 12px; line-height: 1.2; color: var(--fg-muted); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #schedule .cls .cls-info { gap: 4px; flex-shrink: 0; }
  #schedule .cls .cls-info .pill {
    padding: 4px 9px; font-size: 11px; font-weight: 500;
    border: 0; background: transparent; white-space: nowrap;
  }
  #schedule .cls .cls-info .pill.places-pill { display: none; }

  #schedule .cls .cls-more { display: none; }

  /* Hint that more days exist — subtle */
  #schedule .sched-foot .sched-hint::before {
    content: '+ '; color: var(--accent); font-weight: 600;
  }
}
#schedule .sched-empty {
  padding: 36px 20px; text-align: center; color: var(--fg-muted); font-size: 14px;
  background: var(--bg-3); border: 1px dashed var(--border-strong); border-radius: 14px;
}
#schedule .sched-skeleton { display: flex; flex-direction: column; gap: 8px; }
#schedule .sched-skeleton .sk {
  height: 70px; background: linear-gradient(90deg, var(--bg-3), rgba(255,255,255,0.04), var(--bg-3));
  background-size: 200% 100%; border-radius: 12px;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
@keyframes sk-shimmer { 0% { background-position: -100% 0; } 100% { background-position: 200% 0; } }

/* Class card — magazine layout */
#schedule .cls {
  display: grid; grid-template-columns: 6px 1fr;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; cursor: pointer;
  transition: border-color .15s ease, transform .1s ease, background .15s ease;
  text-align: left; width: 100%; font-family: inherit; color: inherit; padding: 0;
}
#schedule .cls:hover { border-color: rgba(126,255,110,0.5); background: rgba(126,255,110,0.04); }
#schedule .cls:active { transform: scale(0.995); }
#schedule .cls .stripe { background: var(--accent); }
#schedule .cls .cls-body { padding: 14px 16px 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 700px) { #schedule .cls .cls-body { padding: 16px 20px; gap: 12px; } }

#schedule .cls .cls-head {
  display: flex; align-items: baseline; gap: 14px; min-width: 0;
}
#schedule .cls .cls-time {
  flex-shrink: 0; display: flex; align-items: center; gap: 6px;
}
#schedule .cls .cls-time .hhmm {
  font-family: 'Benzin', sans-serif; font-weight: 800; font-size: 22px;
  line-height: 1; font-variant-numeric: tabular-nums; color: #fff;
}
#schedule .cls .cls-time .cls-cat {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--fg-muted);
  transform: translateY(-2px);
}
#schedule .cls .cls-cat[data-cat="strength"] { color: #ff8a8a; }
#schedule .cls .cls-cat[data-cat="cardio"]   { color: #ffe066; }
#schedule .cls .cls-cat[data-cat="stretch"]  { color: #8fe89c; }
#schedule .cls .cls-cat[data-cat="mind"]     { color: #7adde8; }
#schedule .cls .cls-cat[data-cat="kids"]     { color: #b0bcff; }
#schedule .cls .cls-title {
  font-family: 'Benzin', sans-serif; font-weight: 700; font-size: 16px;
  line-height: 1.2; color: #fff; margin: 0; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
@media (max-width: 520px) {
  #schedule .cls .cls-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  #schedule .cls .cls-head .cls-time { flex-wrap: wrap; row-gap: 4px; }
  #schedule .cls .cls-title { white-space: normal; font-size: 15px; }
}

#schedule .cls .cls-desc {
  font-size: 13px; color: #b8b8b8; line-height: 1.5; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-clamp: 2; overflow: hidden;
}
@media (min-width: 700px) { #schedule .cls .cls-desc { -webkit-line-clamp: 2; line-clamp: 2; font-size: 13.5px; } }
#schedule .cls .cls-desc:empty { display: none; }

#schedule .cls .cls-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--border); margin-top: 2px;
}
#schedule .cls .cls-trainer {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
#schedule .cls .cls-trainer img {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: center top;
  background: var(--bg-2); flex-shrink: 0;
}
#schedule .cls .cls-trainer .name {
  font-size: 13px; color: #fff; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#schedule .cls .cls-info {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-size: 12px; color: var(--fg-muted);
}
#schedule .cls .cls-info .pill {
  padding: 4px 10px; border-radius: 999px; background: var(--bg-2);
  border: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  #schedule .cls .cls-foot { flex-wrap: wrap; }
  #schedule .cls .cls-info .pill.places-pill { display: none; }
}
#schedule .cls .cls-more {
  font-size: 11px; letter-spacing: 0.05em; color: var(--accent); text-transform: uppercase;
  font-weight: 500; flex-shrink: 0;
}
@media (max-width: 480px) { #schedule .cls .cls-more { display: none; } }

/* Footer */
#schedule .sched-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--fg-muted);
}
#schedule .sched-fallback { color: var(--accent); }

#schedule .schedule-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }

/* Class detail modal */
.cls-dlg {
  padding: 0; border: 0; border-radius: 18px; max-width: 520px; width: 92vw;
  background: var(--bg-2); color: #fff; box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}
.cls-dlg::backdrop { background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); }
.cls-dlg-inner { position: relative; }
.cls-dlg-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,0.1); color: #fff;
  font-size: 22px; cursor: pointer; z-index: 2; display: grid; place-items: center;
}
.cls-dlg-close:hover { background: rgba(255,255,255,0.2); }
.cls-dlg-stripe { height: 6px; background: var(--accent); }
.cls-dlg-body { padding: 28px 26px 26px; }
.cls-dlg-time {
  font-size: 12px; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 500; margin-bottom: 10px;
}
.cls-dlg-body h3 {
  font-family: 'Benzin', sans-serif; font-weight: 800; font-size: 24px;
  line-height: 1.15; margin: 0 0 12px;
}
.cls-dlg-trainer {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.cls-dlg-trainer img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center top;
  background: var(--bg-3);
}
.cls-dlg-trainer .name { font-weight: 500; font-size: 14px; }
.cls-dlg-trainer .role { font-size: 12px; color: var(--fg-muted); }
.cls-dlg-meta {
  display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--fg-muted);
  margin-bottom: 16px;
}
.cls-dlg-meta strong { color: #fff; font-weight: 500; }
.cls-dlg-desc {
  font-size: 14px; color: #d5d5d5; line-height: 1.6; margin: 0 0 22px;
  max-height: 240px; overflow-y: auto;
}
/* Clickable trainer in schedule card / class detail modal */
#schedule .cls .cls-trainer[data-trainer-slug] { cursor: pointer; transition: opacity .15s ease; }
#schedule .cls .cls-trainer[data-trainer-slug]:hover { opacity: 0.85; }
#schedule .cls .cls-trainer[data-trainer-slug]:hover .name { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cls-dlg-trainer[data-trainer-slug] { cursor: pointer; transition: background .15s ease; padding: 6px 8px; margin: -6px -8px 8px; border-radius: 8px; }
.cls-dlg-trainer[data-trainer-slug]:hover { background: rgba(126,255,110,0.06); }
.cls-dlg-trainer[data-trainer-slug]:hover .name { color: var(--accent); }

/* DESKTOP overrides — must come AFTER base .cls rules to win source-order */
@media (min-width: 1024px) {
  #schedule .cls .cls-head {
    flex-direction: column; align-items: stretch; gap: 6px; flex-wrap: nowrap;
  }
  #schedule .cls .cls-time {
    gap: 6px; align-items: center;
  }
  #schedule .cls .cls-title {
    white-space: normal; text-overflow: clip; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    font-size: 14.5px; line-height: 1.3; flex: 1 1 auto;
    min-width: 0; min-height: 2.6em;
  }
  #schedule .cls .cls-desc { display: none; }
}

/* Booking form inside class detail modal — duplicated from index.html .tdlg-form
   block; trainer modal on home keeps its own copy of these rules. */
.tdlg-form { border-top: 1px solid var(--border); padding-top: 18px; }
.tdlg-form h4 { font-family: 'Benzin', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.tdlg-form .row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .tdlg-form .row { grid-template-columns: 1fr 1fr auto; align-items: stretch; } }
.tdlg-form input {
  width: 100%; padding: 12px 14px; background: var(--bg-3); color: #fff;
  border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: 15px; font-family: inherit; -webkit-appearance: none;
}
.tdlg-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.tdlg-form input::placeholder { color: var(--fg-subtle); }
.tdlg-form button {
  padding: 12px 20px; border-radius: 10px; background: var(--accent); color: #000;
  font-weight: 500; font-size: 14px; border: 0; cursor: pointer; white-space: nowrap;
}
.tdlg-form button:hover { background: var(--accent-2); }
.tdlg-form .hint { font-size: 11.5px; color: var(--fg-subtle); margin-top: 10px; }
.tdlg-form .ok {
  display: none; margin-top: 12px; padding: 12px 14px;
  background: rgba(126,255,110,0.12); color: var(--accent);
  border: 1px solid rgba(126,255,110,0.3); border-radius: 10px; font-size: 14px;
}
.tdlg-form .err {
  display: none; margin-top: 12px; padding: 12px 14px;
  background: rgba(255,120,120,0.1); color: #ff9a9a;
  border: 1px solid rgba(255,120,120,0.3); border-radius: 10px; font-size: 14px;
}
.tdlg-form.sent .row, .tdlg-form.sent h4, .tdlg-form.sent .hint { display: none; }
.tdlg-form.sent .ok { display: block; }
