/* ==========================================================================
   Rozmiestnenie učební a kabinetov (js/rozmiestnenie.js, admin/rozmiestnenie.html)
   Window frame from requires/obsadzovnik.css; this file adds the floor plan and the 8G page.
   Room styles are self-contained so the admin preview looks exactly like the kiosk.
   ========================================================================== */

.rz-body {
  flex: 1;
  min-height: 0;
  padding: 18px 22px;
  box-sizing: border-box;
  background: #f8fafc;
  overflow: hidden;
}

/* Floor plan: rooms are absolutely positioned by RozmiestnenieCore.renderPlan */
.rz-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.rz-room {
  position: absolute;
  box-sizing: border-box;
  padding: 3px;
}

.rz-room-inner {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 5px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  /* Words stay whole; renderPlan shrinks the text of a room until it fits */
  overflow-wrap: normal;
  word-break: normal;
}

.rz-room-inner b {
  font-weight: 800;
}

.rz-room-inner .rz-big,
.rz-text-card .rz-big {
  font-size: 1.3em;
}

/* Unnamed spaces from the spreadsheet (corridors, stairs): outline only */
.rz-room.is-empty .rz-room-inner {
  background: transparent;
  border-style: dashed;
  border-color: #dbe3ec;
  box-shadow: none;
}

/* ---- Live map (kiosk): free / occupied for the current lesson ---- */
.rz-room-live {
  font-size: 0.72em;
  font-weight: 800;
  line-height: 1.3;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.rz-live .rz-room.is-free,
.rz-live .rz-room.is-busy {
  cursor: pointer;
}

.rz-live .rz-room.is-free .rz-room-inner {
  background: #ecfdf3;
  border-color: #3da870;
}

.rz-live .rz-room.is-free .rz-room-live {
  background: #3da870;
  color: #ffffff;
}

.rz-live .rz-room.is-busy .rz-room-inner {
  background: #fff1f2;
  border-color: #fda4af;
}

.rz-live .rz-room.is-busy .rz-room-live {
  background: #ffe4e6;
  color: #be123c;
}

/* Kabinety, labs, gym...: not in the Obsadzovník */
.rz-live .rz-room.is-untracked .rz-room-inner {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
  box-shadow: none;
}

.rz-live .rz-room.is-empty .rz-room-inner {
  background: transparent;
  border-color: #dbe3ec;
}

/* Header legend */
.rz-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.rz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rz-legend-item i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid;
}

.rz-legend-item.is-free i { background: #ecfdf3; border-color: #3da870; }
.rz-legend-item.is-busy i { background: #fff1f2; border-color: #fda4af; }
.rz-legend-item.is-untracked i { background: #f1f5f9; border-color: #e2e8f0; }

/* Room schedule popup (above the window) */
.rz-sched-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.rz-sched-backdrop.active {
  display: flex;
}

.rz-sched-backdrop * {
  text-align: left;
}

.rz-sched-card {
  width: min(520px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  animation: obsSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rz-sched-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.rz-sched-title {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.rz-sched-day {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-top: 2px;
}

.rz-sched-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #dc2626;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rz-sched-list {
  list-style: none;
  margin: 0;
  padding: 8px 14px;
  overflow-y: auto;
}

.rz-sched-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px;
  border-radius: 12px;
}

.rz-sched-row + .rz-sched-row {
  border-top: 1px solid #f1f5f9;
}

.rz-sched-row.is-now {
  background: #eef8f2;
  border-top-color: transparent;
}

.rz-sched-period {
  flex-shrink: 0;
  width: 92px;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.rz-sched-period small,
.rz-sched-who small {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.rz-sched-who {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #0f172a;
}

.rz-sched-who b {
  font-weight: 800;
}

.rz-sched-free {
  font-weight: 800;
  color: #3da870;
}

.rz-sched-now {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: #3da870;
  padding: 3px 9px;
  border-radius: 999px;
}

.rz-sched-foot {
  padding: 12px 20px 16px;
  border-top: 1px solid #e2e8f0;
}

.rz-sched-obs {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1.5px solid #c3ebd5;
  border-radius: 14px;
  background: #eef8f2;
  color: #1d6e46;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* Admin editor: the room being edited */
.rz-room.is-selected .rz-room-inner {
  border-color: #3da870;
  box-shadow: 0 0 0 3px rgba(61, 168, 112, 0.35);
}

.rz-editable .rz-room {
  cursor: pointer;
}

.rz-editable .rz-room:hover .rz-room-inner {
  border-color: #3da870;
}

/* Budova 8G: text page */
.rz-text-page {
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.rz-text-card {
  min-width: min(560px, 100%);
  max-width: 900px;
  padding: 24px 32px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
}

.rz-text-card b {
  font-weight: 800;
}

/* Floor plan with the "tap a room" hint under it (kiosk only) */
.rz-plan-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rz-plan-wrap .rz-stage {
  flex: 1;
  min-height: 0;
  height: auto;
}

.rz-hint {
  align-self: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--obs-border, #e2e8f0);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
}

.rz-body .rz-hint * {
  text-align: left;
}

.rz-hint-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef8f2;
  color: #3da870;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* "Tu stojíte": where the kiosk hangs. The dot sits on the wall, the label hangs under it.
   It never takes taps, so the rooms around it stay clickable. */
.rz-here {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.rz-here-dot {
  position: relative;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35), 0 2px 6px rgba(37, 99, 235, 0.4);
}

.rz-here-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #60a5fa;
  animation: rzHerePulse 3.4s ease-out infinite;
}

@keyframes rzHerePulse {
  0% { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

.rz-here-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.rz-here-label i {
  font-size: 12px;
}

/* The floor the kiosk is on, in the floor buttons */
.rz-here-tab {
  margin-right: 7px;
  font-size: 0.9em;
}
