/* ============================================================
   User / TV Dashboard
   ============================================================ */

body { overflow-x: hidden; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px 40px;
  background: var(--ink-900);
  border-bottom: 1px solid var(--ink-600);
}
.topbar-brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 48px; width: auto; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.2px;
}
.brand-subtitle {
  font-size: 15px;
  color: var(--gold-300);
  font-weight: 500;
  margin-top: 2px;
}

.topbar-clock {
  text-align: center;
  justify-self: center;
}
.clock-time {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.clock-date {
  font-size: 16px;
  color: var(--text-300);
  margin-top: 6px;
}

.topbar-weather {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
  background: var(--ink-700);
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-md);
  padding: 10px 20px;
}
.weather-icon { font-size: 34px; }
.weather-temp { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.weather-loc { font-size: 12px; color: var(--text-500); }

.block-tabs {
  display: flex;
  gap: 10px;
  padding: 18px 40px 0;
  flex-wrap: wrap;
}
.block-tab {
  background: var(--ink-700);
  border: 1px solid var(--ink-600);
  color: var(--text-300);
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
}
.block-tab.active {
  background: var(--gold-500);
  color: var(--ink-900);
  border-color: var(--gold-500);
}

.room-grid-wrap {
  flex: 1;
  padding: 24px 40px 8px;
  overflow-y: auto;
}

.block-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--gold-300);
  margin: 24px 0 12px;
}
.block-section-title:first-child { margin-top: 0; }

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.room-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
  position: relative;
  overflow: hidden;
}
.room-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.08), transparent 55%);
  pointer-events: none;
}

.room-card.vacant { background: linear-gradient(135deg, var(--vacant-500), var(--vacant-700)); }
.room-card.occupied { background: linear-gradient(135deg, var(--occupied-500), var(--occupied-700)); }

.room-id {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.room-status-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}

.room-details {
  color: #fff;
  margin-top: 12px;
}
.room-subject {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}
.room-meta {
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
}
.room-meta strong { font-weight: 700; }

.room-card.just-updated { animation: pulse-update 1s ease; }
@keyframes pulse-update {
  0% { box-shadow: 0 0 0 0 rgba(205,173,86,0.7); }
  100% { box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
}

.event-ticker {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--ink-800);
  border-top: 1px solid var(--ink-600);
  padding: 14px 40px;
  overflow: hidden;
}
.ticker-label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-500);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.ticker-track {
  flex: 1;
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
}
.ticker-track.no-scroll { animation: none; transform: none; }
.ticker-empty { color: var(--text-500); font-size: 15px; }
.ticker-item { font-size: 15px; color: var(--text-100); }
.ticker-item b { color: var(--gold-300); }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; text-align: center; gap: 12px; }
  .topbar-weather, .topbar-clock { justify-self: center; }
  .room-grid { grid-template-columns: 1fr 1fr; }
}

/* ----------------------------------------------------------
   Event popup overlay — cycles on/off per event's configured
   popup_duration_seconds, with a 3s gap between showings.
   ---------------------------------------------------------- */
.event-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 52, 89, 0.55);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.event-popup-overlay.visible { opacity: 1; pointer-events: auto; }
.event-popup-card {
  background: var(--ink-700);
  border: 2px solid var(--gold-500);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  max-width: 720px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  text-align: center;
}
.event-popup-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-top: 16px;
}
.event-popup-desc {
  font-size: 16px;
  color: var(--text-300);
  margin-top: 8px;
}
#event-popup-media img, #event-popup-media video {
  max-width: 100%;
  max-height: 45vh;
  border-radius: var(--radius-md);
  display: block;
  margin: 0 auto;
}
