/* Overlay messaggio a schermo intero */
.takeover {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(at 50% 30%, #0b3b66 0, #05070d 70%);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 8vw;
}
.takeover[hidden] { display: none; }
.takeover-inner {
  width: min(90vw, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.takeover-logo { height: 9vh; width: auto; display: block; margin: 0 0 5vh; }
#takeover-title { font-size: 7vh; font-weight: 800; color: #fff; line-height: 1.1; }
#takeover-message { font-size: 3.4vh; color: #cfe0f2; margin-top: 3vh; line-height: 1.4; }

/* Font self-hosted: Plus Jakarta Sans (variable) — nessuna richiesta a internet */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans.woff2') format('woff2');
}

:root {
  --bg-color: #07090e;
  --panel-bg: rgba(20, 30, 55, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-color: #f1f6fd;
  --text-muted: #8ea0b8;
  --accent-color: #00d2ff;
  --accent-glow: rgba(0, 210, 255, 0.35);
  --blue: #0088ff;
  --blue-glow: rgba(0, 136, 255, 0.25);
  --glass-highlight: rgba(255, 255, 255, 0.03);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 136, 255, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 210, 255, 0.1) 0px, transparent 50%);
  color: var(--text-color);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

body.show-cursor,
body.show-cursor * {
  cursor: default;
}

/* Layout verticale – ottimizzato per portrait 1080×1920 */
#totem {
  height: 100vh;
  display: grid;
  /* header · video · piani · bacheca · riga stat · footer */
  grid-template-rows: 8vh 29vh auto 13vh 4vh 7vh;
  gap: 1vh;
  padding: 1.2vh 1.8vw;
  box-sizing: border-box;
}
/* Riga stat spenta (nessuna chiave/sorgente): il video riprende lo spazio */
#totem.stats-off {
  grid-template-rows: 8vh 32vh auto 13vh 7vh;
}
#totem.stats-off .stats-row { display: none; }

/* ---------- RIGA STATISTICHE GIORNATA ---------- */
.stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 0;
  min-width: 0;   /* resta nella colonna: gli item si restringono, niente overflow */
  overflow: hidden;
  background: linear-gradient(100deg, rgba(16, 29, 52, 0.78), rgba(13, 24, 44, 0.58));
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.stat-item[hidden] { display: none; }
.stat-item {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55vw;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1vw;
}
.stat-ico {
  display: flex;
  align-items: center;
  color: var(--accent-color);
}
.stat-ico svg { width: 2.25vh; height: 2.25vh; }
.stat-num {
  font-size: 2.05vh;
  font-weight: 800;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-label {
  font-size: 1.4vh;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
/* Titolo integrato nella barra, con richiamo al colore SmartMe */
.stats-caption {
  align-self: stretch;
  flex: 0 0 22%;
  display: flex;
  align-items: center;
  font-size: 1.05vh;
  color: #b7c6da;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding: 0 1.25vw;
  border-left: 4px solid var(--accent-color);
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.09), transparent 85%);
}

/* ---------- HEADER ---------- */
.top-header {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr) minmax(150px, 190px);
  column-gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.6vh;
  min-width: 0;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.brand-logo {
  height: 3.3vh;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
}

.brand-block h1 {
  font-size: 2.1vh;
  font-weight: 800;
  margin: 0 0 0 calc(3.3vh + 12px);
  color: #dce8f7;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.25;
  transform: scaleX(1.18);
  transform-origin: left center;
}

.weather-widget {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.55vh 0.9vw;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.wx-city-block {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}
.wx-city-block + .wx-city-block {
  border-left: 1px solid var(--panel-border);
  margin-left: 1vw;
  padding-left: 1vw;
}
.wx-current {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6vw;
  min-width: 0;
  padding-right: 1.1vw;
}

.wx-ico {
  font-size: 2.4vh;
  line-height: 1;
  display: flex;
  align-items: center;
  color: var(--accent-color);
}
.wx-ico svg { width: 3vh; height: 3vh; }

.wx-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wx-temp {
  font-size: 1.65vh;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.1;
}

.wx-meta {
  font-size: 1vh;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.wx-rain {
  padding-left: 0.35vw;
  font-size: 0.82vh;
  font-weight: 700;
  color: #72d8ff;
  white-space: nowrap;
}

.wx-outlook {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  align-self: stretch;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.wx-view {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.wx-periods {
  display: flex;
  align-items: center;
  padding-left: 0.75vw;
}

.wx-period {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 0.22vw;
  color: var(--text-color);
  font-size: 1.05vh;
  line-height: 1;
}
.wx-period + .wx-period {
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.wx-period-label {
  grid-column: 1 / -1;
  margin-bottom: 0.18vh;
  color: var(--text-muted);
  font-size: 0.82vh;
  font-weight: 600;
}

.wx-period-ico {
  display: flex;
  color: var(--accent-color);
}

.wx-period-ico svg {
  width: 1.35vh;
  height: 1.35vh;
}

.wx-days {
  display: flex;
  align-items: center;
  padding-left: 0.55vw;
}

.wx-day {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 0.2vw;
  line-height: 1;
}
.wx-day + .wx-day { border-left: 1px solid rgba(255, 255, 255, 0.07); }
.wx-day-label {
  grid-column: 1 / -1;
  margin-bottom: 0.2vh;
  color: var(--text-muted);
  font-size: 0.92vh;
  font-weight: 700;
  text-transform: capitalize;
}
.wx-day-ico { display: flex; color: var(--accent-color); }
.wx-day-ico svg { width: 1.45vh; height: 1.45vh; }
.wx-day-temps {
  display: flex;
  align-items: baseline;
  gap: 0.15vw;
  font-size: 1.08vh;
}
.wx-day-temps small { color: var(--text-muted); font-size: 0.82vh; }

.wx-view.is-active {
  opacity: 1;
  transform: translateY(0);
}

.clock-widget {
  text-align: right;
  justify-self: end;
  min-width: 0;
}

#time {
  font-size: 2.8vh;
  font-weight: 800;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.date-label {
  font-size: 1.05vh;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: capitalize;
  margin-top: 1px;
  white-space: nowrap;
}

/* ---------- SEZIONE VIDEO ---------- */
.video-section {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--panel-border);
  background: #000;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 1.8vh;
  font-weight: 500;
}

/* ---------- SEZIONE PIANI ---------- */
.floors-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.section-title {
  font-size: 1.4vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-color);
  margin-bottom: 0.8vh;
}

.floors-container {
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
  flex: 1;
  overflow: hidden;
}

.floor-card {
  background: rgba(20, 30, 55, 0.66);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1vh 1.35vw;
  transition: background 0.2s linear, border-color 0.2s linear, transform 0.2s linear;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.floor-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: transparent;
  transition: background 0.2s linear;
}

.floor-card-header {
  display: flex;
  align-items: center;
  gap: 1.2vw;
}

.floor-number {
  font-size: 2.15vh;
  font-weight: 800;
  color: #b8c8da;
  transition: color 0.2s linear;
  min-width: 13vw;
  letter-spacing: -0.02em;
}

.floor-title {
  font-size: 2.05vh;
  font-weight: 700;
  color: #d9e4f1;
  transition: color 0.2s linear;
}

.floor-card-body {
  max-height: none;
  overflow: visible;
  opacity: 1;
}

.floor-items {
  list-style: none;
  padding: 0;
  margin: 0.55vh 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45vw;
}

.floor-items li {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.055);
  padding: 0.38vh 0.8vw;
  border-radius: 20px;
  font-size: 1.32vh;
  color: var(--text-color);
  font-weight: 500;
  opacity: 1;
}

/* Il Piano 2 ha cinque voci: margini appena più compatti per mantenerle su una riga. */
#floor-card-2 .floor-items {
  gap: 0.35vw;
}

#floor-card-2 .floor-items li {
  padding-left: 0.62vw;
  padding-right: 0.62vw;
}

.accessibility-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45vh;
  height: 1.45vh;
  margin-right: 0.35vw;
  color: var(--accent-color);
  font-size: 1.45vh;
  font-family: Arial, sans-serif;
  font-weight: 700;
  vertical-align: -0.15em;
}

.entry-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.2vw;
  margin-right: 0.35vw;
  color: var(--accent-color);
  vertical-align: -0.2em;
}

.entry-icons svg {
  width: 1.4vh;
  height: 1.4vh;
}

.coworking-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1vw;
  margin-top: 0.55vh;
  min-height: 3vh;
}

.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.9vh;
  min-width: 0;
  max-width: 16vw;
  flex: 0 1 auto;
  padding: 0.2vh 0;
  border: 0;
  background: transparent;
}

.logo-tile.dark {
  background: transparent;
}

.logo-tile.dark img {
  filter: grayscale(1) brightness(0) invert(1);
}

.logo-tile.light {
  background: transparent;
}

/* I loghi vengono uniformati in bianco sul fondo scuro del totem. */
.logo-tile.invert {
  background: transparent;
}
.logo-tile.invert img {
  filter: grayscale(1) brightness(0) invert(1);
}

.logo-tile img {
  display: block;
  width: auto;
  max-width: 16vw;
  max-height: 2.25vh;
  object-fit: contain;
  filter: grayscale(1) brightness(0) invert(1);
}

.logo-tile.compact img {
  max-height: 2.35vh;
}

.logo-tile.dark.compact img {
  mix-blend-mode: normal;
}

.logo-tile.wide img {
  max-height: 2.1vh;
}

/* Active Floor Card Styling */
.floor-card.active {
  background: linear-gradient(90deg, rgba(0, 136, 255, 0.28), rgba(0, 94, 185, 0.14));
  border-color: rgba(0, 179, 255, 0.58);
  box-shadow: 0 5px 16px rgba(0, 71, 142, 0.22);
  transform: none;
}

.floor-card.active::before {
  background: var(--blue);
}

.floor-card.active .floor-number {
  color: var(--accent-color);
}

.floor-card.active .floor-title {
  color: #ffffff;
  font-weight: 700;
}

/* ---------- BACHECA AVVISI ---------- */
.announcements-section {
  min-height: 0;
}

.announcements-card {
  background: rgba(20, 30, 55, 0.82);
  border: 1px solid rgba(0, 210, 255, 0.18);
  border-top: 3px solid var(--accent-color);
  border-radius: 12px;
  padding: 0.95vh 1.35vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.announcements-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1vw;
  margin-bottom: 0.45vh;
}

.announcements-title {
  font-size: 1.8vh;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent-color);
  margin: 0;
}

.announcements-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.announcement-progress {
  width: 1.1vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45vh;
  flex-shrink: 0;
}

.announcement-dot {
  width: 0.3vw;
  min-width: 4px;
  height: 0.55vh;
  min-height: 5px;
  border-radius: 999px;
  background: #61758e;
  opacity: 0.65;
  transition: height 0.45s ease, background-color 0.45s ease, opacity 0.45s ease;
}

.announcement-dot.is-active {
  height: 1.45vh;
  background: var(--accent-color);
  opacity: 1;
}

.announcement-dot.is-next {
  background: #4c9bc0;
  opacity: 0.9;
}

.announcements-content {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  overflow: hidden;
}

.announcement-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.announcement {
  width: 100%;
  padding-top: 0.35vh;
  padding-bottom: 1.9vh;
  animation: announcementIn 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.announcement-heading {
  display: flex;
  align-items: baseline;
  gap: 0.7vw;
  margin-bottom: 0.3vh;
}

.announcement-date {
  font-size: 1.18vh;
  color: #91a7bf;
  font-variant-numeric: tabular-nums;
}

.announcement-title {
  font-size: 1.48vh;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.announcement-message {
  font-size: 1.45vh;
  line-height: 1.35;
  color: #dce8f5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.announcement-preview {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15vh;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #91a7bf;
  font-size: 1.18vh;
  font-weight: 600;
  opacity: 0.38;
}

.announcements-empty {
  color: #91a7bf;
  font-size: 1.3vh;
}

@keyframes announcementIn {
  from { opacity: 0; transform: translateY(1.3vh); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- FOOTER ---------- */
.amenities-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65vw;
  background: rgba(20, 30, 55, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.75vh 1.1vw;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.2);
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.am-icon {
  width: 2.2vh;
  height: 2.2vh;
  color: var(--accent-color);
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.am-icon svg {
  width: 100%;
  height: 100%;
}

.am-label {
  font-size: 1.2vh;
  font-weight: 600;
  color: var(--text-color);
}

.site-qr {
  display: flex;
  align-items: center;
  padding-left: 0.75vw;
  border-left: 1px solid var(--panel-border);
  flex: 0 0 auto;
}

.site-qr span {
  display: none;
}

.site-qr img {
  width: 5.4vh;
  height: 5.4vh;
  background: transparent;
  padding: 0;
}

/* ---------- KIOSK EXIT ---------- */
.exit-zone {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 220px;
  height: 180px;
  z-index: 50;
}

#exit-kiosk {
  position: absolute;
  right: 18px;
  bottom: 18px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(8, 13, 24, 0.94);
  color: #f1f6fd;
  padding: 12px 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  transition: opacity 0.15s linear;
}

body.show-cursor #exit-kiosk,
.exit-zone:hover #exit-kiosk {
  opacity: 1;
  pointer-events: auto;
}
