/* Poppins, self-hosted like on the website. */
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("/fonts/poppins-700-latin.woff2") format("woff2"); }

:root {
  /* Website palette (website-frontend/src/css/application.css + Tailwind slate). */
  --blue: #12417E;
  --blue-dark: #0d2f5c;
  --orange: #D97500;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-900: #0f172a;
  --free: #15803d;
  --soon: var(--orange);
  --occupied: #dc2626;

  /* NOTE: 1rem = 1/120 of the screen width (16px in 1080p, 32px in 4K), so the layout
     and the Yodeck zone coordinates scale exactly with the resolution. */
  font-size: calc(100vw / 120);

  --header-h: 5rem;
  --footer-h: 4rem;
  --gap: 1rem;
  --rooms-w: 58.5rem;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: "Poppins", sans-serif;
  font-weight: 500;
}

h2, p { margin: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: white;
  border-bottom: 1px solid var(--slate-200);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.brand { display: flex; align-items: center; gap: 1rem; }
.brand-logo { width: 3rem; height: 3rem; }
.brand-divider { width: 1px; height: 2rem; background: var(--slate-200); }
.brand-text {
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.brand-accent { color: var(--orange); }

.header-info { display: flex; align-items: center; gap: 2rem; }

.weather {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 2rem;
  border-right: 1px solid var(--slate-200);
  color: var(--blue);
}
.weather-icon {
  width: 3rem;
  height: 3rem;
  fill: none;
  stroke: var(--orange);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.weather-temperature { display: block; font-size: 2.25rem; font-weight: 700; line-height: 1; }
.weather-detail { display: block; margin-top: 0.25rem; color: var(--slate-600); font-size: 1.125rem; line-height: 1.2; }

.datetime { text-align: right; color: var(--blue); }
.clock { display: block; font-size: 2.25rem; font-weight: 700; line-height: 1; }
.digit { display: inline-block; width: 0.68em; text-align: center; }
.clock-seconds { color: var(--slate-500); font-size: 1.5rem; font-weight: 600; }
.date { display: block; margin-top: 0.25rem; color: var(--slate-600); font-size: 1.125rem; line-height: 1.2; }
.date::first-letter { text-transform: uppercase; }

.content {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rooms-w) 1fr;
  gap: var(--gap);
  padding: var(--gap);
}

.rooms { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; }

.room-list {
  min-height: 0;
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: 1rem;
}

/* Cards follow the website .card-surface. */
.room,
.agenda,
.announcements {
  background: white;
  border: 1px solid rgb(226 232 240 / 0.85);
  border-radius: 0.75rem;
  box-shadow:
    0 18px 45px -28px rgb(15 23 42 / 0.3),
    0 10px 24px -18px rgb(15 23 42 / 0.18);
}

.room {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 1rem 1.5rem;
  border-left: 0.5rem solid var(--state-color);
  overflow: hidden;
}
.room[data-state="free"] { --state-color: var(--free); }
.room[data-state="soon"] { --state-color: var(--soon); }
.room[data-state="occupied"] { --state-color: var(--occupied); }

.room-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.75rem;
  background: var(--slate-100);
  color: var(--blue);
}
.room-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room-body { min-width: 0; }
.room-name {
  color: var(--blue);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-status {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.25rem;
  color: var(--state-color);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
}
.room-status::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: currentColor;
}
.room-status-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* NOTE: indented by the status dot width and gap, to line up with the title. */
.room-details { margin-top: 0.125rem; padding-left: 1.625rem; overflow: hidden; color: var(--slate-600); font-size: 1.25rem; white-space: nowrap; text-overflow: ellipsis; }
.room-details-time { color: var(--state-color); font-weight: 600; }

.timeline {
  position: relative;
  height: 1.5rem;
  border-radius: 0.375rem;
  background: var(--slate-100);
  overflow: hidden;
}
.timeline-busy { position: absolute; top: 0; bottom: 0; background: var(--blue); box-shadow: inset -0.125rem 0 white; }
.timeline-past { position: absolute; inset: 0 auto 0 0; z-index: 1; background: rgb(255 255 255 / 0.6); }
.timeline-now {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 0.1875rem;
  margin-left: -0.09375rem;
  background: var(--orange);
}
.hour-axis { position: relative; height: 1.375rem; color: var(--slate-600); font-size: 0.875rem; }
.hour-axis span { position: absolute; top: 0.125rem; transform: translateX(-50%); }

.room-timeline { grid-column: 1 / -1; }

/* Upcoming bookings, next to today's cards. */
.agenda { min-height: 0; padding: 1.25rem 1.5rem; overflow: hidden; }
.agenda h2 { margin: 0; color: var(--blue); font-size: 1.5rem; font-weight: 700; }
.agenda h3 { margin: 1rem 0 0.25rem; color: var(--slate-600); font-size: 1rem; font-weight: 600; }
.agenda h3::first-letter { text-transform: uppercase; }
.agenda ul { margin: 0; padding: 0; list-style: none; }
.agenda li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  column-gap: 0.5rem;
  padding: 0.375rem 0;
  border-top: 1px solid var(--slate-100);
}
.agenda-time { color: var(--blue); font-size: 1.125rem; font-weight: 700; }
.agenda-time.all-day { padding-top: 0.125rem; font-size: 0.875rem; }
.agenda-detail { min-width: 0; }
.agenda-title { display: block; overflow: hidden; font-size: 1.125rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.agenda-room { display: block; color: var(--slate-500); font-size: 0.9375rem; }
.agenda-empty { margin-top: 0.75rem; color: var(--slate-500); font-size: 1.125rem; }

.announcements { position: relative; overflow: hidden; }
.announcements-debug {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  border: 0.25rem dashed var(--orange);
  color: var(--orange);
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
}
.debug .announcements-debug { display: grid; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: linear-gradient(to bottom right, var(--blue), var(--blue-dark));
  color: white;
}
.welcome { font-size: 1.375rem; font-weight: 600; }

/* NOTE: flush with the footer edges, it replaces the welcome message while an alert is active. */
.vigilance {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: -2rem;
  padding: 0 2rem;
  background: var(--alert-color);
  font-size: 1.25rem;
}
.vigilance[data-level="orange"] { --alert-color: var(--orange); }
.vigilance[data-level="red"] { --alert-color: var(--occupied); }
.vigilance p { margin: 0; }
.vigilance strong { font-weight: 700; }
.vigilance svg {
  flex: none;
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emergency { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.emergency li { display: flex; align-items: center; gap: 0.5rem; color: rgb(255 255 255 / 0.9); font-size: 1rem; }
.emergency strong {
  padding: 0.125rem 0.5rem;
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.15);
  color: white;
  font-size: 1.375rem;
  font-weight: 700;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgb(255 255 255 / 0.8);
  font-size: 0.875rem;
}
.sync-state::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--sync-color);
}
.sync-state[data-state="ok"] { --sync-color: #22c55e; }
.sync-state[data-state="stale"] { --sync-color: var(--orange); }
.sync-state[data-state="error"] { --sync-color: #ef4444; }
