/*
 * Reload Design System, applied to the meeting room display.
 * Tokens follow colors_and_type.css / tokens.css from the design system: beige surface,
 * black text, yellow as accent, secondaries for variety. No black or dark-grey
 * backgrounds, no gradients, no shadows.
 *
 * Sizes are in rem and the root font size scales with the viewport, so the page reads
 * from across the room on a 90" display.
 */

@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/SpaceGrotesk-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Mono';
  src: url('fonts/SpaceMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Primary */
  --c-reload-yellow: #ffe44e;
  --c-beige: #f6f5ef;
  --c-black: #000000;
  --c-white: #ffffff;

  /* Secondary */
  --c-post-it: #ffffb4;
  --c-suomisvej: #bbac76;
  --c-soerne: #4d2e38;
  --c-desert-sand: #2d472d;
  --c-pink-floyd: #f2cee6;
  --c-dirty-dieter: #fa5a0a;

  /* Semantic */
  --bg: var(--c-beige);
  --bg-alt: var(--c-white);
  --bg-brand: var(--c-reload-yellow);
  --fg: var(--c-black);
  --fg-muted: rgba(0, 0, 0, 0.6);
  --fg-on-dark: var(--c-beige); /* text on the dark secondaries */
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: var(--c-black);

  /* Radii */
  --r-chip: 12px;
  --r-card: 16px;
  --r-pill: 9999px;

  /* Type */
  --ff-display: 'Space Grotesk', system-ui, sans-serif;
  --ff-body: 'Space Grotesk', system-ui, sans-serif;
  --ff-mono: 'Space Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 2.5vw, 96px);

  color-scheme: light;
  font-size: clamp(16px, 1.45vw, 72px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: 'top' 'banner' 'main' 'bottom';
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-body);
  font-weight: 400;
  line-height: 1.25;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

html.cursor-hidden,
html.cursor-hidden * {
  cursor: none !important;
}

/* ------------------------------------------------------------ header */

.top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem var(--gutter) 1.2rem;
}

.time {
  font-family: var(--ff-display);
  font-size: 4.8rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 0.95;
}

.date {
  margin-top: 0.5rem;
  font-family: var(--ff-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.room {
  flex: 1;
  font-family: var(--ff-display);
  font-size: 1.8rem;
  font-weight: 500;
  text-align: center;
}

/* ------------------------------------------------------------ buttons */

.btn {
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1;
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease-out, background-color 0.15s ease-out;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
.fs-btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* Brand: yellow fill. Used for the main actions (Deltag, Log ind). */
.btn-join,
.btn-signin {
  background: var(--bg-brand);
  font-size: 1.7rem;
  min-height: 3.6rem;
  padding: 0.55em 1.6em;
}

.btn-join:hover,
.btn-signin:hover {
  filter: brightness(0.92);
}

/* Secondary: black outline on the surface. */
.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  font-size: 1.35rem;
  min-height: 3.2rem;
  padding: 0.55em 1.3em;
}

.btn-secondary:hover {
  background: var(--bg-alt);
}

/* ------------------------------------------------------------ banner */

.banner {
  grid-area: banner;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 var(--gutter) 1rem;
  padding: 0.9rem 1rem 0.9rem 1.5rem;
  border-radius: var(--r-card);
  background: var(--bg-brand);
  font-size: 1.4rem;
}

.banner[hidden] {
  display: none;
}

/* On yellow, the action is the outlined secondary button. */
.banner .btn-signin {
  background: transparent;
  border-color: var(--border-strong);
  font-size: 1.4rem;
  min-height: 3rem;
}

.banner .btn-signin:hover {
  filter: none;
  background: var(--bg-alt);
}

/* ------------------------------------------------------------ meetings */

.main {
  grid-area: main;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--gutter) 1rem;
  scrollbar-width: none;
}

.events {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  align-items: center;
  gap: 1.6rem;
  padding: 1.2rem 1.2rem 1.2rem 1.6rem;
  border-radius: var(--r-card);
  background: var(--bg-alt);
  transition: background-color 0.2s ease-out;
}

.event-time {
  font-family: var(--ff-display);
  font-size: 1.7rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event-body {
  min-width: 0;
}

.event-badge {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.3em 0.8em;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.event-title {
  font-family: var(--ff-display);
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-organizer {
  margin-top: 0.3rem;
  font-size: 1.3rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.platform {
  padding: 0.35em 0.8em;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Small mono-caps buttons in the footer: "Opdater liste" and the "more below" hint. */
.btn-quiet {
  background: var(--bg);
  border-color: var(--border-strong);
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-height: 2.6rem;
  padding: 0.5em 1.2em;
}

.btn-quiet:hover {
  background: var(--bg-alt);
}

.more[hidden] {
  display: none;
}

/* In progress: forest (dark secondary) with beige text — the one dark card on screen. */
.event.is-current {
  background: var(--c-desert-sand);
  color: var(--fg-on-dark);
  padding-block: 1.8rem;
}

.event.is-current .event-title {
  font-size: 2.7rem;
}

.event.is-current .event-organizer {
  color: var(--fg-on-dark);
  opacity: 0.8;
}

.event.is-current .event-badge {
  background: var(--bg-brand);
  border-color: var(--bg-brand);
  color: var(--fg);
}

.event.is-current .platform {
  border-color: var(--fg-on-dark);
}

.event.is-current .btn-join:focus-visible {
  outline-color: var(--fg-on-dark);
}

/* Starting within 10 minutes: Pink Floyd. */
.event.is-soon {
  background: var(--c-pink-floyd);
  padding-block: 1.5rem;
}

.event.is-past {
  opacity: 0.45;
  padding-block: 0.8rem;
}

.event.is-past .event-title {
  font-size: 1.6rem;
}

.event.is-past .event-time {
  font-size: 1.4rem;
}

.event.is-private .event-title {
  font-family: var(--ff-mono);
  font-size: 1.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------ messages */

.center-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  min-height: 100%;
  text-align: center;
}

.center-text {
  margin: 0;
  max-width: 36ch;
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
}

.is-loading .center-text {
  font-family: var(--ff-mono);
  font-size: 1.2rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.is-empty .center-text {
  font-size: 4rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.is-problem {
  justify-content: center;
}

.is-problem .center-text {
  padding: 2rem 2.4rem;
  border-radius: var(--r-card);
  background: var(--c-post-it);
}

.center-panel .btn-signin {
  font-size: 2.4rem;
  min-height: 5rem;
}

/* ------------------------------------------------------------ footer */

/* Every control in the footer shares one height, so they line up as a row. */
.bottom {
  --footer-h: 2.4rem;
  grid-area: bottom;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem var(--gutter) 0.9rem;
}

.bottom .btn-quiet {
  height: var(--footer-h);
  min-height: 0;
  padding: 0 1.1em;
  font-size: 0.85rem;
}

.bottom .status {
  display: flex;
  align-items: center;
  min-height: var(--footer-h);
}

.status-area {
  display: flex;
  align-items: center;
  min-width: 0;
}

#refresh[hidden] {
  display: none;
}

.status {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

/* Text stays black; only the dot carries the state. */
.status::before {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.6em;
  border-radius: var(--r-pill);
  background: var(--c-desert-sand);
  vertical-align: -0.05em;
}

.status:empty::before {
  display: none;
}

.status[data-level='warn']::before,
.status[data-level='error']::before {
  background: var(--c-dirty-dieter);
}

.status[data-level='warn'],
.status[data-level='error'] {
  color: var(--fg);
}

.bottom-right {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.wordmark {
  display: block;
  height: 1.05rem;
  width: auto;
}

.fs-btn {
  width: var(--footer-h);
  height: var(--footer-h);
  padding: 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.fs-btn:hover {
  background: var(--bg-alt);
}

/* Streamline Sharp Line look: thin single-weight stroke, square ends. */
.fs-btn svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.fs-btn[hidden] {
  display: none;
}

/* ------------------------------------------------------------ narrow screens (development) */

@media (max-width: 700px) {
  :root {
    font-size: 12px;
  }

  .top {
    flex-wrap: wrap;
  }

  .room {
    order: 3;
    flex-basis: 100%;
    text-align: left;
  }

  .event {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .banner {
    flex-direction: column;
    align-items: stretch;
  }
}
