/* ===================================================== */
/*  NAV_RUNTIME.CSS — SKONSOLIDOWANY (bez dubli)          */
/* ===================================================== */

/* ========================= */
/* 1) GLOBAL / RESET         */
/* ========================= */

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

* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #222;
}

/* ========================= */
/* 2) BUTTONS / UI BASICS    */
/* ========================= */

button {
  min-width: 140px;
  min-height: 56px;

  padding: 14px 24px;
  font-size: 20px;
  font-weight: 600;

  border-radius: 14px;
  border: none;

  cursor: pointer;

  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease;

  outline: none;
}

.btn_tools {
  display: block;
  margin-bottom: 14px;
}

span.btn_label {
  font-size: 20px;
  font-weight: 600;
}

/* ========================= */
/* 3) APP LAYOUT (legacy)    */
/* ========================= */

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ───────── TOP BAR (legacy) ───────── */

#topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #ddd;
}

#brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

#searchbox {
  display: flex;
  gap: 8px;
  flex: 1;
}

#searchbox input {
  flex: 1;
  padding: 10px;
  font-size: 16px;
}

#searchbox button {
  padding: 10px 14px;
  font-size: 16px;
}

#modebox {
  white-space: nowrap;
}

/* ───────── MAIN (legacy) ───────── */

#main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ───────── RESULTS (legacy) ───────── */

#results {
  width: 320px;
  border-right: 1px solid #ddd;
  padding: 10px;
  overflow-y: auto;
}

.panel-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}

.item:hover {
  background: #f7f7f7;
}

/* ───────── MAP (legacy) ───────── */

#map {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#hint {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  z-index: 10;
}

#floorLabel {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  z-index: 10;
}

/* ========================= */
/* 4) HEADER (Twoje HTML)    */
/* ========================= */
/* Działa z HTML:
   .header-left (logo + tekst)
   .header-center (tytuł)
   .header-right (data/godzina)
*/

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 92px;
  padding: 0 24px;

  background: linear-gradient(90deg, #0b3c6f, #1554a1);
  color: #fff;
}

/* LEWA KOLUMNA */
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

/* LOGO */
.logo-gminy {
  height: 64px;       /* <-- stabilne, czytelne */
  width: auto;
  object-fit: contain;
  display: block;
}

/* Tekst nazwy budynku */
.header-building {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

/* ŚRODEK (napis zawsze pośrodku) */
.header-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;

  /* zapas na lewą i prawą stronę */
  padding: 0 220px;
  text-align: center;
}

.header-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

/* PRAWA (zegar) */
.header-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;

  font-weight: 600;
  min-width: 220px;
}

#clock-date {
  font-size: 18px;
}

#clock-time {
  font-size: 22px;
  font-weight: 700;
}

/* ========================= */
/* 5) MAIN / VIEWS           */
/* ========================= */

#app-main {
  padding: 24px;
}

.view { display: none; }
.view.active { display: block; }

/* mapa: layout flex tylko w widoku mapy */
.view.active#view-map { display: flex; }

/* ========================= */
/* 6) START: TOPICS / TILES  */
/* ========================= */

#topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.topic-tile {
  background: #ffffff;
  border-radius: 14px;
  padding: 26px 20px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-tile:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

/* alternatywne przyciski */
.alt-search {
  margin-top: 30px;
  display: flex;
  gap: 20px;
}

.alt-search button {
  font-size: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: #0b3c6f;
  color: #fff;
}

/* ========================= */
/* 7) LISTY / TARGETS        */
/* ========================= */

#targets-list button {
  display: block;
  width: 100%;
  padding: 18px;
  margin-bottom: 14px;
  font-size: 20px;
  border-radius: 10px;
  border: none;
  background: #e9eef3;
  cursor: pointer;
}

.target-btn { text-align: left; padding: 14px 16px; }
.target-room-title { font-size: 1.1rem; font-weight: 600; }
.target-room-floor { font-size: 0.9rem; opacity: 0.7; margin-top: 2px; }

.target-card{
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  background: #fff;
}

.target-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.target-main .target-title{
  font-weight: 700;
  font-size: 18px;
}

.target-main .target-meta{
  opacity: .75;
  margin-top: 2px;
}

.target-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-small{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #bbb;
  background: #f7f7f7;
  font-size: 16px;
}

.matters-box{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ddd;
}

.matter-item{ margin: 6px 0; }
.matter-desc{ opacity: .8; margin-left: 18px; }
.muted{ opacity: .7; }

/* ========================= */
/* 8) SEARCH VIEW            */
/* ========================= */

.search-box {
  display: flex;
  gap: 12px;
  max-width: 800px;
  margin: 40px auto;
}

.search-box input {
  flex: 1;
  font-size: 20px;
  padding: 12px;
}

.search-box button {
  font-size: 20px;
  padding: 12px 20px;
}

/* ========================= */
/* 9) MAP VIEW LAYOUT         */
/* ========================= */

#view-map {
  flex-direction: column;
  height: calc(100vh - 120px);
  overflow: hidden;
}

#room-info { margin-bottom: 16px; }
#room-title { font-size: 26px; }
#room-description { font-size: 18px; }

#maps-wrapper {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

#map-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#floorLabelMain {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  border: 1px solid #ddd;
  z-index: 20;
}

#svgHost {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#svgHost svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  transform-origin: 50% 50%;
  transition: transform 0.25s ease;
}

/* prawa kolumna */
#map-thumbs {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

#map-thumbs .btn_tools,
#map-thumbs button {
  width: 100%;
  white-space: nowrap;
}

/* miniatury pięter */
.floor-thumb {
  border: 2px solid transparent;
  opacity: 0.6;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  background: #fafafa;
}

.floor-thumb.active {
  border-color: #0077ff;
  opacity: 1;
}

.floor-thumb span {
  display: block;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.thumb-svg {
  width: 100%;
  height: 120px;
  overflow: hidden;
}

.thumb-svg svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ========================= */
/* 10) MAP CONTROLS ROW      */
/* ========================= */

#map-controls-row {
  display: flex;
  align-items: center;
  gap: 20px;

  padding: 10px 14px;
  margin-top: 10px;

  background: #f5f7fa;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
}

/* grupy */
#map-controls-row .ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* obrót */
#rotate-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#rotate-controls button {
  min-width: 56px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  cursor: pointer;
}

#rotate-controls button:hover {
  background: #eaeaea;
}

#rotate-slider {
  width: 160px;
  height: 34px;
}

#size-slider {
  width: 220px;
  height: 34px;
}

/* reset po prawej */
#map-controls-row .ctrl-reset {
  margin-left: auto;
  margin-right: 220px;
}

/* dotyk: większe suwaki */
#map-controls-row input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
}

/* responsywność */
@media (max-width: 900px) {
  #map-controls-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  #map-controls-row .ctrl-reset {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0px;
	margin-right: 220px;
  }

  #rotate-slider,
  #size-slider {
    width: 100%;
    max-width: 260px;
  }
}

/* ========================= */
/* 11) SVG LABELS / ROOMS    */
/* ========================= */

/* klik/selection (stare) */
#room-labels-layer text {
  user-select: none;
}

/* etykiety — jasne na VGA */
.svg-label text {
  font-family: system-ui, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  fill: #fff;                 /* <-- jasne */
  text-anchor: middle;
  pointer-events: none;
}

.svg-label rect {
  fill: rgba(0,0,0,0.55);     /* <-- półprzezroczyste tło */
  stroke: rgba(255,255,255,0.20);
  stroke-width: 1;
  opacity: 1;
  rx: 10;
  ry: 10;
}

/* kiosk label */
.svg-label.kiosk rect { fill: #000; }
.svg-label.kiosk text { fill: #fff; font-weight: 800; }

@keyframes pulse {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.25); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* highlight */
.room-highlight rect {
  stroke: #ff0000;
  stroke-width: 3;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ========================= */
/* 12) EXTRA TILES           */
/* ========================= */

.extra-grid {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.extra-tile {
  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 240px;
  padding: 22px 24px;

  border-radius: 14px;
  background: #ffffff;

  font-size: 20px;
  font-weight: 600;

  cursor: pointer;

  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.extra-tile:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.extra-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.extra-emoji {
  font-size: 30px;
}

/* ========================= */
/* 13) LOGO PROGRAMU (fixed) */
/* ========================= */

.logo-program {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;

  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 12px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-program img {
  display: block;
  height: 120px;
  width: auto;
  opacity: 0.95;
}