/*
  Styles for the math-office wall display (math/index.html + math-office.js).
  This page is light-only (it lives on a TV in a lit room, so there's no
  dark theme to swap) and never scrolls — the whole layout is sized to fit
  exactly one 16:9 screen via flex/grid `fr` units and `min-height: 0`.
  The one media query at the bottom is only so the page is still readable
  if opened on a laptop while editing.
  All class names are prefixed `mo-` to keep them clearly separate from the
  main site's stylesheet.
*/

:root {
  --accent: #005588; /* SLUH Blue */
  --accent-rgb: 0, 85, 136;
  --navy: #003366; /* SLUH Navy */
  --bg: #ffffff;
  --panel: #f7f7f5;
  --border: #dcdcd6;
  --track: #eeeeee;
  --text: #003366;
  --text-dim: #777777;
  --done: #ccccbb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; /* this is a kiosk display, not a scrolling page */
}

.mo-dashboard {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.3rem 1.9rem;
  gap: 1.3rem;
}

.mo-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8rem;
}
.mo-header h1 { margin: 0; font-size: 1.85rem; }
.mo-header-link {
  font-size: 1.05rem;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.mo-header-link:hover { color: var(--text); }
.mo-header-time { text-align: right; }
#mo-date { display: block; font-size: 1.2rem; color: var(--text-dim); }
#mo-clock { display: block; font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.mo-columns {
  flex: 3;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 1.5rem;
}

.mo-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}

.mo-col h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mo-col-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}
.mo-col-header-row h2 { margin: 0 0 0.9rem; }

.mo-col-body { flex: 1; min-height: 0; overflow-y: auto; }

/* --- daily bars column --- */

.mo-countdown { text-align: center; margin-bottom: 1rem; }
.mo-countdown-label { font-size: 1.2rem; color: var(--text-dim); }
.mo-countdown-clock {
  font-size: 5.4rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.mo-countdown-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.mo-status {
  text-align: center;
  font-size: 1.4rem;
  color: var(--text-dim);
  margin: 1rem 0;
}

.mo-bar-row { margin-bottom: 1.5rem; }
.mo-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}
.mo-bar-track {
  height: 16px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.mo-bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 999px;
}
.mo-bar-row.is-live .mo-bar-fill {
  background: linear-gradient(90deg, #2e8bc0, #63b3e0, #8ecae6, #63b3e0, #2e8bc0);
  background-size: 300% 100%;
  animation: mo-live-shift 4s ease infinite;
}
.mo-bar-row.is-live .mo-bar-top { color: var(--accent); font-weight: 700; }

@keyframes mo-live-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- confetti (a period/lunch-wave bar just finished) --- */

.mo-confetti-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 200;
}

.mo-confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation-name: mo-confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes mo-confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift), 105vh) rotate(var(--rot)); opacity: 0.7; }
}

/* --- squares column --- */

#mo-squares {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2px;
}

.mo-square {
  position: relative;
  width: var(--mo-square-size, 14px);
  height: var(--mo-square-size, 14px);
  border-radius: 2px;
  background: var(--track);
  border: 1px solid var(--border);
  overflow: hidden;
  flex: 0 0 auto;
}
.mo-square-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: rgba(var(--accent-rgb), 0.4);
}
.mo-square.is-live { border-color: var(--accent); }
.mo-square.is-live .mo-square-fill { background: var(--accent); }

.mo-semester-divider {
  flex-basis: 100%;
  height: 0;
  border-top: 1px dashed var(--border);
  margin: 0.4rem 0;
}

/* --- breaks column --- */

.mo-break-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.15rem;
}
.mo-break-row:last-child { border-bottom: none; }
.mo-break-row.is-active { color: var(--accent); font-weight: 700; }
.mo-break-days { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.mo-break-row.is-active .mo-break-days { color: var(--accent); }

/* --- rotating box (breaks / birthdays / free food) --- */

.mo-rotator-content { transition: opacity 0.25s ease; }
#mo-rotator-title { transition: opacity 0.25s ease; }
.mo-rotator-content.is-fading,
#mo-rotator-title.is-fading { opacity: 0; }

/* --- bottom row: people + weather --- */

.mo-bottom {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.mo-people-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem 1.3rem;
}
.mo-person {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.mo-person-room { color: var(--text-dim); }
.mo-people-list .mo-status {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 1.15rem;
  margin: 0.4rem 0;
}

.mo-teachers-period {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.mo-weather {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.mo-weather-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  padding-right: 1.5rem;
  border-right: 1px solid var(--border);
}
.mo-weather-current-icon { font-size: 3.2rem; line-height: 1; }
.mo-weather-current-temp { font-size: 2.2rem; font-weight: 700; }
.mo-weather-current-label { font-size: 1.05rem; color: var(--text-dim); }

.mo-weather-forecast {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.mo-weather-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.mo-weather-card-label { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.mo-weather-card-icon { font-size: 1.8rem; line-height: 1; }
.mo-weather-card-temp { font-size: 1.1rem; font-weight: 600; }

.mo-weather-error { color: var(--text-dim); font-size: 1.1rem; }

@media (max-width: 1100px) {
  .mo-columns { grid-template-columns: 1fr; }
  .mo-bottom { grid-template-columns: 1fr; }
  html, body { overflow: auto; height: auto; }
  .mo-dashboard { height: auto; min-height: 100vh; }
}

/* --- shared alvear.cl feedback footer (markup injected by feedback.js) --- */
/* The kiosk layout clips this off-screen; it only shows in the responsive
   fallback above. Lay it out as a single line there: the "idea or bug?"
   prompt floated left, the copyright + link floated right, with the lazily-
   added form clearing both onto its own line below.
   feedback.js injects its own <style> after this file, so these selectors
   carry the `footer` element name to out-weigh its bare `.xa-fb` rules. */
footer.xa-fb {
  display: flow-root; /* contain the floats so the border-top wraps them */
}
footer.xa-fb .xa-fb-open {
  float: left;
}
footer.xa-fb .xa-fb-copy {
  float: right;
  margin-top: 0;
}
footer.xa-fb form {
  clear: both;
}
