@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

:root {
  --bcu-ink: #14212b;
  --bcu-steel: #1f4e6b;
  --bcu-steel-deep: #163a50;
  --bcu-accent: #c45c26;
  --bcu-accent-soft: #e8a178;
  --bcu-surface: #f6f3ee;
  --bcu-surface-2: #efeae2;
  --bcu-line: rgba(20, 33, 43, 0.12);
  --bcu-hotspot: 48px;
  --bcu-font: "Outfit", "Segoe UI", sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--bcu-font);
}

#panorama {
  width: 100%;
  height: 100%;
}

.load-error {
  color: #fff;
  padding: 2rem;
  max-width: 32rem;
  line-height: 1.5;
}

/* —— Ekran ładowania (po polsku + styl BCU) —— */
.pnlm-load-box {
  top: 50%;
  left: 50%;
  width: min(280px, 86vw);
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 1.5rem 1.35rem 1.25rem;
  transform: translate(-50%, -50%);
  background: linear-gradient(165deg, rgba(22, 58, 80, 0.94) 0%, rgba(20, 33, 43, 0.96) 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  font-family: var(--bcu-font);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
}

.pnlm-load-box p {
  margin: 0 0 1rem;
}

.pnlm-lbox {
  position: static;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pnlm-loading {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--bcu-accent);
  background: transparent;
  animation: bcu-spin 0.75s linear infinite;
}

.pnlm-lbar {
  width: 100%;
  max-width: 200px;
  height: 8px;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.pnlm-lbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bcu-accent) 0%, #e8a178 100%);
  transition: width 0.15s ease;
}

.pnlm-lmsg {
  margin: 0.65rem 0 0 !important;
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.02em;
}

.pnlm-load-button {
  width: min(260px, 86vw);
  height: auto;
  min-height: 7rem;
  margin: 0;
  padding: 1.25rem 1.5rem;
  transform: translate(-50%, -50%);
  background: linear-gradient(165deg, var(--bcu-steel) 0%, var(--bcu-steel-deep) 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 3px solid var(--bcu-accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  font-family: var(--bcu-font);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pnlm-load-button:hover {
  background: linear-gradient(165deg, #275f82 0%, var(--bcu-steel) 100%);
  transform: translate(-50%, -50%) scale(1.02);
}

.pnlm-load-button p {
  line-height: 1.35;
}

.pnlm-error-msg {
  font-family: var(--bcu-font);
  background: rgba(20, 33, 43, 0.92) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem !important;
}

@keyframes bcu-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Wyłącz domyślną animację kwadracika Pannellum */
@keyframes pnlm-mv {
  0%,
  100% {
    transform: none;
  }
}

/* —— Hotspoty (większe, bez starego sprite’a Pannellum) —— */
.pnlm-hotspot-base.pnlm-hotspot {
  width: var(--bcu-hotspot) !important;
  height: var(--bcu-hotspot) !important;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background-color: var(--bcu-steel) !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 54% !important;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 0 6px rgba(31, 78, 107, 0.28);
  cursor: pointer;
  /* NIE transition/transform — Pannellum ustawia transform przy panoramowaniu */
  transition: background-color 0.15s ease;
  animation: hotspot-pulse 2.4s ease-out infinite;
}

.pnlm-hotspot-base.pnlm-hotspot:hover {
  background-color: var(--bcu-steel-deep) !important;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.4),
    0 0 0 8px rgba(31, 78, 107, 0.35);
  animation: none;
}

.pnlm-hotspot.pnlm-scene {
  background-color: var(--bcu-accent) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 14l6-6 6 6' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 0 6px rgba(196, 92, 38, 0.28);
  animation-name: hotspot-pulse-accent;
}

.pnlm-hotspot.pnlm-scene:hover {
  background-color: #a3491c !important;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.4),
    0 0 0 8px rgba(196, 92, 38, 0.35);
  animation: none;
}

.pnlm-hotspot.pnlm-info {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='8' r='1.35' fill='%23fff'/%3E%3Cpath d='M12 11.2v6.2' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") !important;
}

.pnlm-hotspot.custom-info-hotspot,
.pnlm-hotspot-base.custom-info-hotspot {
  width: var(--bcu-hotspot) !important;
  height: var(--bcu-hotspot) !important;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background-color: var(--bcu-steel) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='8' r='1.35' fill='%23fff'/%3E%3Cpath d='M12 11.2v6.2' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 54% !important;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 0 6px rgba(31, 78, 107, 0.28);
  cursor: pointer;
  animation: hotspot-pulse 2.4s ease-out infinite;
}

@keyframes hotspot-pulse {
  0% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.35),
      0 0 0 0 rgba(255, 255, 255, 0.45);
  }
  70% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.35),
      0 0 0 14px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.35),
      0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes hotspot-pulse-accent {
  0% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.35),
      0 0 0 0 rgba(196, 92, 38, 0.45);
  }
  70% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.35),
      0 0 0 14px rgba(196, 92, 38, 0);
  }
  100% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.35),
      0 0 0 0 rgba(196, 92, 38, 0);
  }
}

/* Tooltip Pannellum (etykieta przy hover) */
div.pnlm-tooltip span {
  visibility: hidden;
  position: absolute;
  border-radius: 8px;
  background: rgba(20, 33, 43, 0.92);
  color: #fff;
  padding: 0.45rem 0.7rem;
  font-family: var(--bcu-font);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

div.pnlm-tooltip:hover span {
  visibility: visible;
}

/* —— Modal info —— */
body.modal-open {
  overflow: hidden;
}

.info-modal[hidden] {
  display: none !important;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  font-family: var(--bcu-font);
}

.info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 24, 0.72);
  backdrop-filter: blur(3px);
  animation: modal-fade 0.22s ease;
}

.info-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(40rem, 100%);
  max-height: min(88vh, 46rem);
  overflow: auto;
  background: var(--bcu-surface);
  color: var(--bcu-ink);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: modal-rise 0.28s ease;
}

.info-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 1rem 1.25rem;
  background: linear-gradient(180deg, var(--bcu-steel-deep) 0%, var(--bcu-steel) 100%);
  color: #fff;
  border-bottom: 3px solid var(--bcu-accent);
}

.info-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.info-modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.info-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.info-modal-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: var(--bcu-surface-2);
}

.info-modal-body {
  padding: 1.25rem 1.35rem 1.5rem;
  line-height: 1.6;
  font-size: 1rem;
  color: var(--bcu-ink);
}

.info-modal-body p {
  margin: 0 0 0.85rem;
}

.info-modal-body p:last-child {
  margin-bottom: 0;
}

.info-modal-body ul,
.info-modal-body ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

.info-modal-body a {
  color: var(--bcu-steel);
  font-weight: 500;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* —— Pasek info sceny (tytuł / autor) —— */
.pnlm-panorama-info {
  top: 0.85rem;
  left: 50%;
  right: auto;
  bottom: auto;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.7rem 1.1rem 0.75rem;
  background: linear-gradient(165deg, rgba(22, 58, 80, 0.94) 0%, rgba(20, 33, 43, 0.96) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 3px solid var(--bcu-accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: var(--bcu-font);
  text-align: center;
  z-index: 5;
  transform: translateX(-50%) translateZ(9999px);
  -webkit-transform: translateX(-50%) translateZ(9999px);
}

.pnlm-title-box {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  padding-left: 0;
  margin-bottom: 0.2rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.pnlm-author-box {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.78;
  padding-left: 0;
  display: block;
  letter-spacing: 0.01em;
  margin-left: auto;
  margin-right: auto;
}

.pnlm-author-box a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Menu lokalizacji —— */
.locations-ui[hidden] {
  display: none !important;
}

.locations-fab {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.05rem 0.75rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(165deg, var(--bcu-steel) 0%, var(--bcu-steel-deep) 100%);
  color: #fff;
  font-family: var(--bcu-font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  border-bottom: 3px solid var(--bcu-accent);
  transition: background 0.15s ease, transform 0.15s ease;
}

.locations-fab:hover {
  background: linear-gradient(165deg, #275f82 0%, var(--bcu-steel) 100%);
  transform: translateX(-50%) translateY(-1px);
}

.locations-fab-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 21s7-4.5 7-10a7 7 0 10-14 0c0 5.5 7 10 7 10z' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='12' cy='11' r='2.2' fill='%23fff'/%3E%3C/svg%3E")
    center / 70% no-repeat;
}

.locations-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9001;
  background: rgba(12, 18, 24, 0.55);
  backdrop-filter: blur(2px);
}

.locations-backdrop[hidden] {
  display: none !important;
}

.locations-panel {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  transform: translateX(-50%);
  z-index: 9002;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(70vh, 28rem);
  display: flex;
  flex-direction: column;
  background: var(--bcu-surface);
  color: var(--bcu-ink);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--bcu-font);
  animation: locations-panel-in 0.22s ease;
}

@keyframes locations-panel-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.locations-panel[hidden] {
  display: none !important;
}

.locations-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.95rem 1.15rem;
  background: linear-gradient(180deg, var(--bcu-steel-deep) 0%, var(--bcu-steel) 100%);
  color: #fff;
  border-bottom: 3px solid var(--bcu-accent);
}

.locations-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.locations-close {
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.locations-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.locations-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
}

.locations-list li {
  margin: 0 0 0.35rem;
}

.locations-list li:last-child {
  margin-bottom: 0;
}

.locations-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bcu-surface-2);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.locations-item:hover {
  border-color: rgba(31, 78, 107, 0.35);
  background: #fff;
}

.locations-list li.is-active .locations-item {
  border-color: var(--bcu-accent);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--bcu-accent);
}

.locations-item-label {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  font-size: 1rem;
}

.locations-item-sub {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.82rem;
  color: rgba(20, 33, 43, 0.65);
  margin-top: 0.15rem;
}

.locations-item-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--bcu-accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 6l6 6-6 6' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 55% no-repeat;
}

@media (max-width: 600px) {
  :root {
    --bcu-hotspot: 44px;
  }

  .info-modal {
    padding: 0.75rem;
  }

  .info-modal-header {
    padding: 0.9rem 1rem;
  }

  .info-modal-header h2 {
    font-size: 1.05rem;
  }

  .info-modal-body {
    padding: 1rem 1.1rem 1.25rem;
    font-size: 0.95rem;
  }

  .locations-fab {
    left: 50%;
    bottom: 0.75rem;
    transform: translateX(-50%);
  }

  .locations-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(78vh, 32rem);
    border-radius: 18px 18px 0 0;
    transform: none;
    animation: modal-rise 0.22s ease;
  }
}
