/* Schedule page – bars, timeline, legend. Aligns with main-item hover language in styles_scripts.html. */
:root {
  --schedule-bg: #ffffff;
  --schedule-card: #ffffff;
  --schedule-muted: #6b7280;
  --schedule-line: #e5e7eb;

  --schedule-mp: #582A72;
  --schedule-lab: #386908;
  --schedule-exam: #c00;
  --schedule-misc: rgb(0, 33, 91);

  --schedule-today-tint: rgba(21, 98, 157, 0.08);
  --schedule-today-line: rgba(21, 98, 157, 0.55);

  --schedule-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  --schedule-radius: 14px;

  /* Hover: analogous to .main-item-body – stronger contrast, slight lift */
  --schedule-hover-lift: -2px;
  --schedule-hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  --schedule-transition: 0.2s ease;
}

.schedule-wrapper {
  padding: 0.5rem 0;
}

.schedule-card {
  background: var(--schedule-card);
  border: 1px solid var(--schedule-line);
  border-radius: var(--schedule-radius);
  box-shadow: var(--schedule-shadow);
  padding: 1rem;
  position: relative;
}

.schedule-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.schedule-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.schedule-subtitle {
  font-size: 0.85rem;
  color: var(--schedule-muted);
}

.schedule-timeline {
  position: relative;
}

#today-button {
  display: inline-flex;
  align-items: center;
  background: var(--schedule-today-tint);
  border: 1px solid var(--schedule-today-line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  color: rgba(21, 98, 157, 0.9);
  cursor: pointer;
  transition: background 0.15s ease;
}

#today-button:hover {
  background: rgba(21, 98, 157, 0.15);
}

#today-button strong {
  font-weight: 700;
}

.schedule-body {
  display: flex;
  /* border-top: 1px solid var(--schedule-line); */
  border-bottom: 1px solid var(--schedule-line);
}

.schedule-labels {
  flex: 0 0 5.5rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--schedule-line);
}

.schedule-label-spacer {
  height: 3.1rem;
  border-bottom: 1px solid var(--schedule-line);
  margin-bottom: 0.25rem;
}

.schedule-scroll {
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  position: relative;
}

/* Header */
.schedule-header {
  height: 3.1rem;
  border-bottom: 1px solid var(--schedule-line);
  margin-bottom: 0.25rem;
  min-width: max-content;
  z-index: 6;
}

.schedule-day-cells {
  display: flex;
  height: 100%;
}

.schedule-day-cell {
  flex: none;
  text-align: center;
  font-size: 0.78rem;
  padding-top: 0.4rem;
  border-right: 1px solid var(--schedule-line);
  color: #111827;
}

.schedule-day-cell small {
  display: block;
  color: var(--schedule-muted);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.schedule-day-cell.week-start {
  box-shadow: inset 2px 0 0 rgba(17, 24, 39, 0.125);
}

.schedule-day-cell.today {
  background: var(--schedule-today-tint);
  font-weight: 700;
}

/* Rows */
.schedule-row-label {
  display: flex;
  align-items: center;
  min-height: 4rem;
  padding: 0.55rem 0 0.55rem 0.75rem;
  border-bottom: 1px solid var(--schedule-line);
  font-weight: 700;
  font-size: 0.9rem;
  color: #111827;
}

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

.schedule-track-row {
  display: flex;
  align-items: center;
  min-height: 4rem;
  min-width: max-content;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--schedule-line);
}

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

.schedule-track {
  flex: none;
  position: relative;
  height: 2.4rem;
}

.schedule-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--schedule-today-line);
  pointer-events: none;
  z-index: 9;
}

/* Bars – minimal outline style */
.schedule-bar {
  position: absolute;
  top: 0.4rem;
  height: 1.6rem;
  border-radius: 999px;
  display: flex;
  border: 2px dashed currentColor;
  align-items: center;
  padding: 0 0.65rem;
  clip-path: inset(0 round 999px);
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  z-index: 5;
  transition: none;
}

a.schedule-bar {
  border: 2px solid currentColor;
}


.schedule-bar-text {
  position: sticky;
  left: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

/* Base colors */
.schedule-bar.mp { color: var(--schedule-mp); }
.schedule-bar.lab { color: var(--schedule-lab); }
.schedule-bar.exam { color: var(--schedule-exam); }
.schedule-bar.misc { color: var(--schedule-misc); }

/* Hover only if clickable – explicit per-type colors avoid currentColor/white conflict */

/* removes link underline*/
a.schedule-bar,
a.schedule-bar:link,
a.schedule-bar:visited,
a.schedule-bar:hover,
a.schedule-bar:active,
a.schedule-bar:focus {
  text-decoration: none !important;
  box-shadow: none !important;
}

a.schedule-bar:hover,
a.schedule-bar:focus-visible {
  color: #ffffff;
  cursor: pointer;
}
a.schedule-bar.mp:hover,
a.schedule-bar.mp:focus-visible {
  background: var(--schedule-mp);
  border-color: var(--schedule-mp);
}
a.schedule-bar.lab:hover,
a.schedule-bar.lab:focus-visible {
  background: var(--schedule-lab);
  border-color: var(--schedule-lab);
}
a.schedule-bar.exam:hover,
a.schedule-bar.exam:focus-visible {
  background: var(--schedule-exam);
  border-color: var(--schedule-exam);
}

a.schedule-bar.misc:hover,
a.schedule-bar.misc:focus-visible {
  background: var(--schedule-misc);
  border-color: var(--schedule-misc);
}

/* No hover change for non-links */
.schedule-bar.no-link {
  cursor: default;
}

/* Legend – grouped chips/cards */
.schedule-legend {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #f9fafb;
  border: 1px solid var(--schedule-line);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 1rem;
}
