/* SSG Timetable – public styles */
.ssg-timetable,
.ssg-modal {
  --ssg-green: #4db374;
  --ssg-red: #f26a6c;
  --ssg-dark-blue: #14283d;
  --ssg-teal: #124c51;
  --ssg-light-gray: #d3dce4;
  --ssg-muted: #5a6b7d;
  --ssg-bg: #f8f9fb;
}

.ssg-timetable, .ssg-timetable *, .ssg-modal, .ssg-modal * { box-sizing: border-box; }

.ssg-timetable {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1em;
  color: var(--ssg-dark-blue);
}

/* ---------- View switcher & navigation ---------- */
.ssg-view-switcher {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1.5em;
  flex-wrap: wrap;
  align-items: center;
}

.ssg-timetable .ssg-view-switcher button,
.ssg-timetable .ssg-nav button {
  background: #fff;
  border: 2px solid var(--ssg-light-gray);
  color: var(--ssg-dark-blue);
  padding: 0.6em 1.5em;
  border-radius: 25px;
  font-weight: 500;
  font-size: 0.95em;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.ssg-timetable .ssg-view-switcher button:hover,
.ssg-timetable .ssg-nav button:hover {
  border-color: var(--ssg-green);
  color: var(--ssg-green);
  background: #fff;
  transform: translateY(-2px);
}

.ssg-timetable .ssg-view-switcher button.active {
  background: var(--ssg-green);
  border-color: var(--ssg-green);
  color: #fff;
  font-weight: 600;
}

.ssg-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
  margin-bottom: 1.5em;
}

.ssg-timetable .ssg-nav-title {
  font-size: 1.3em;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: var(--ssg-dark-blue);
}

.ssg-nav-buttons { display: flex; gap: 0.5em; }
.ssg-timetable .ssg-nav button { padding: 0.45em 1.1em; font-weight: 600; }
.ssg-timetable [hidden] { display: none !important; }

/* ---------- Staff-only warning ---------- */
.ssg-config-warning {
  background: #fff6d6;
  border: 2px solid #e5b700;
  border-radius: 6px;
  padding: 1em 1.5em;
  margin-bottom: 1.5em;
  font-size: 0.95em;
}
.ssg-config-warning ul { margin: 0.5em 0 0; padding-left: 1.2em; }

/* ---------- Day cards ---------- */
.ssg-timetable-content { margin-bottom: 2em; }

.ssg-day {
  background: #fff;
  margin-bottom: 1em;
  border-left: 6px solid var(--ssg-green);
  padding: 1em 1.5em;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(20, 40, 61, 0.06);
  transition: all 0.3s ease;
  animation: ssgSlideIn 0.4s ease;
}
.ssg-day.is-today { border-left-color: var(--ssg-teal); box-shadow: 0 2px 12px rgba(18, 76, 81, 0.15); }
.ssg-day.is-past { opacity: 0.55; }
.ssg-day:hover { box-shadow: 0 4px 16px rgba(20, 40, 61, 0.1); transform: translateY(-2px); }

@keyframes ssgSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ssg-timetable .ssg-day h3 {
  margin: 0 0 0.8em 0;
  padding: 0;
  font-size: 1.3em;
  color: var(--ssg-dark-blue);
  font-weight: 700;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5em;
}

.ssg-date { font-weight: 500; font-size: 0.75em; color: var(--ssg-teal); }

.ssg-today-badge {
  background: var(--ssg-teal);
  color: #fff;
  font-size: 0.55em;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  align-self: center;
}

.ssg-timetable .ssg-day ul { list-style: none; padding: 0; margin: 0; }

.ssg-timetable .ssg-day li {
  padding: 0.6em 0 0.6em 0.5em;
  margin: 0 0 0 -0.5em;
  border-bottom: 1px solid var(--ssg-light-gray);
  font-size: 0.95em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  list-style: none;
}
.ssg-timetable .ssg-day li:hover,
.ssg-timetable .ssg-day li:focus-visible {
  background: rgba(77, 179, 116, 0.05);
  padding-left: 0.8em;
  outline: none;
}
.ssg-timetable .ssg-day li:last-child { border-bottom: none; }

.ssg-activity-name { flex: 1; min-width: 200px; font-weight: 500; }

.ssg-timetable .ssg-empty { color: var(--ssg-muted); font-style: italic; margin: 0; }

.ssg-timetable .ssg-closed {
  background: rgba(242, 106, 108, 0.1);
  border-left: 4px solid var(--ssg-red);
  padding: 0.6em 1em;
  border-radius: 4px;
  margin: 0;
}

/* ---------- Tags ---------- */
.ssg-timetable .appointment-tag,
.ssg-timetable .anytime-tag {
  color: #fff;
  font-size: 0.75em;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 500;
}
.ssg-timetable .appointment-tag { background-color: var(--ssg-red); }
.ssg-timetable .anytime-tag { background-color: var(--ssg-green); }

.ssg-timetable .join-tag {
  color: var(--ssg-teal);
  font-size: 0.75em;
  padding: 2px 14px;
  border-radius: 20px;
  border: 2px solid var(--ssg-teal);
  white-space: nowrap;
  display: inline-block;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-weight: 500;
}
.ssg-timetable .join-tag:hover { background-color: var(--ssg-teal); color: #fff; }

/* ---------- All sessions view ---------- */
.ssg-activity-card {
  background: #fff;
  border-left: 6px solid var(--ssg-green);
  padding: 1.5em;
  border-radius: 6px;
  margin-bottom: 1em;
  box-shadow: 0 2px 8px rgba(20, 40, 61, 0.06);
  cursor: pointer;
  transition: all 0.3s ease;
  animation: ssgSlideIn 0.4s ease;
}
.ssg-activity-card:hover,
.ssg-activity-card:focus-visible {
  box-shadow: 0 4px 16px rgba(20, 40, 61, 0.1);
  transform: translateY(-2px);
  outline: none;
}
.ssg-timetable .ssg-activity-card h4 {
  margin: 0 0 0.5em 0;
  padding: 0;
  color: var(--ssg-dark-blue);
  font-size: 1.3em;
  font-weight: 700;
}
.ssg-activity-schedule { color: var(--ssg-teal); font-size: 0.95em; margin-bottom: 0.3em; font-weight: 500; }
.ssg-timetable .ssg-next { color: var(--ssg-muted); font-size: 0.9em; margin: 0.4em 0 0.8em; }

/* ---------- Pop-up ---------- */
.ssg-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 61, 0.8);
  z-index: 99999;
  backdrop-filter: blur(4px);
  animation: ssgFadeIn 0.3s ease;
  color: var(--ssg-dark-blue);
}
.ssg-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1em;
}
@keyframes ssgFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ssg-modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(20, 40, 61, 0.3);
  animation: ssgSlideUp 0.3s ease;
}
@keyframes ssgSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.ssg-modal-header {
  background: var(--ssg-green);
  color: #fff;
  padding: 1.5em 4em 1.5em 1.5em;
  border-radius: 12px 12px 0 0;
  position: relative;
}
.ssg-modal .ssg-modal-title { margin: 0; padding: 0; font-size: 1.6em; font-weight: 700; color: #fff; }

.ssg-modal .ssg-modal-close {
  position: absolute;
  top: 1em;
  right: 1em;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.8em;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}
.ssg-modal .ssg-modal-close:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }

.ssg-modal-body { padding: 2em; }
.ssg-modal-body p { line-height: 1.6; color: var(--ssg-dark-blue); margin: 0 0 1em; }

.ssg-modal-description { line-height: 1.7; margin-bottom: 1.5em; }
.ssg-modal .ssg-modal-description ul { list-style: none; padding-left: 0; margin: 1em 0; }
.ssg-modal .ssg-modal-description li { padding: 0.5em 0 0.5em 1.5em; position: relative; line-height: 1.6; list-style: none; }
.ssg-modal .ssg-modal-description li:before {
  content: "•";
  color: var(--ssg-green);
  font-weight: bold;
  font-size: 1.2em;
  position: absolute;
  left: 0;
}

.ssg-modal-schedule {
  background: rgba(77, 179, 116, 0.1);
  padding: 1em;
  border-radius: 6px;
  margin-bottom: 1.5em;
  border-left: 4px solid var(--ssg-green);
  line-height: 1.6;
}
.ssg-modal-schedule strong { display: block; margin-bottom: 0.3em; font-weight: 600; }
.ssg-modal-schedule .ssg-upcoming { margin-top: 0.8em; color: var(--ssg-teal); }

.ssg-modal-note { background: var(--ssg-bg); padding: 1em 1em 0.1em; border-radius: 6px; margin-bottom: 1.5em; }

.ssg-modal-requirement {
  background: rgba(242, 106, 108, 0.1);
  padding: 1em;
  border-radius: 6px;
  margin-bottom: 1.5em;
  border-left: 4px solid var(--ssg-red);
}
.ssg-modal-requirement p:last-child { margin-bottom: 0; }

.ssg-modal-cta { display: flex; gap: 1em; flex-wrap: wrap; }

.ssg-modal .ssg-btn {
  padding: 0.8em 1.8em;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  border: none;
}
.ssg-modal .ssg-btn-primary { background: var(--ssg-green); color: #fff; }
.ssg-modal .ssg-btn-primary:hover { background: #3d9860; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(77, 179, 116, 0.3); }
.ssg-modal .ssg-btn-secondary { background: #fff; color: var(--ssg-teal); border: 2px solid var(--ssg-teal); }
.ssg-modal .ssg-btn-secondary:hover { background: var(--ssg-teal); color: #fff; transform: translateY(-2px); }

/* ---------- Disclaimer & footer link ---------- */
.ssg-disclaimer,
.ssg-cta {
  background: #fff;
  padding: 1em 1.5em;
  border-radius: 6px;
  margin-top: 2em;
  font-size: 0.95em;
  box-shadow: 0 2px 8px rgba(20, 40, 61, 0.06);
}
.ssg-disclaimer { border-left: 4px solid var(--ssg-red); }
.ssg-cta { border-left: 4px solid var(--ssg-green); font-weight: 500; }
.ssg-cta a { color: var(--ssg-teal); font-weight: 700; text-decoration: none; transition: color 0.2s ease; }
.ssg-cta a:hover { color: var(--ssg-green); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .ssg-timetable .ssg-day h3 { font-size: 1.1em; }
  .ssg-timetable .ssg-day li { font-size: 0.9em; flex-direction: column; align-items: flex-start; }
  .ssg-activity-name { min-width: auto; }
  .ssg-timetable .appointment-tag,
  .ssg-timetable .anytime-tag { font-size: 0.7em; padding: 3px 8px; }
  .ssg-timetable .ssg-view-switcher button { padding: 0.5em 1em; font-size: 0.9em; }
  .ssg-timetable .ssg-nav-title { font-size: 1.1em; }
  .ssg-modal-body { padding: 1.5em; }
  .ssg-modal .ssg-modal-title { font-size: 1.3em; }
  .ssg-modal .ssg-btn { width: 100%; padding: 0.7em 1.5em; font-size: 0.95em; }
}

@media (max-width: 480px) {
  .ssg-timetable { padding: 0.5em; }
  .ssg-timetable .ssg-activity-card h4 { font-size: 1.1em; }
  .ssg-nav-buttons { width: 100%; }
  .ssg-timetable .ssg-nav-buttons button { flex: 1; padding: 0.45em 0.5em; }
}
