/* ── Global ── */
* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Barlow', sans-serif;
  background: #1C1C1C;
}

[x-cloak] {
  display: none !important;
}

/* ── Initial loading screen ── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: #fff;
  background: #1C1C1C;
  opacity: 1;
  touch-action: none;
}

.loading-screen__content {
  width: min(360px, 82vw);
  text-align: center;
}

.loading-screen__logo {
  width: auto;
  height: 42px;
  margin: 0 auto 30px;
  object-fit: contain;
}

.loading-screen__text {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.loading-screen__progress {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.loading-screen__progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #E8651A;
  box-shadow: 0 0 14px rgba(232, 101, 26, 0.5);
  transition: width 180ms ease-out;
}

.loading-screen__percentage {
  display: block;
  margin-top: 12px;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.app-shell {
  height: 100%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.app-shell--ready {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .loading-screen__progress-fill,
  .app-shell {
    transition: none;
  }
}

/* ── Scrollbar ── */
.sidebar-scroll {
  overflow-y: auto;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: #d1ccc4;
  border-radius: 2px;
}

/* ── Status badge ── */
.status-slobodan {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-rezervisan {
  background: #FFF8E1;
  color: #F57F17;
}

.status-prodato {
  background: #FFEBEE;
  color: #C62828;
}

/* ── Dual range slider ── */
.dual-range {
  position: relative;
  height: 20px;
  touch-action: none;
}

.dual-range__track,
.dual-range__active {
  position: absolute;
  top: 50%;
  height: 4px;
  border-radius: 2px;
  transform: translateY(-50%);
}

.dual-range__track {
  inset-inline: 0;
  background: #e5e7eb;
}

.dual-range__active {
  background: #E8651A;
}

.dual-range__input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 20px;
  background: transparent;
  outline: none;
  pointer-events: none;
}

.dual-range__input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.dual-range__input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.dual-range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #E8651A;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #E8651A;
  cursor: grab;
  pointer-events: auto;
}

.dual-range__input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E8651A;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #E8651A;
  cursor: grab;
  pointer-events: auto;
}

.dual-range__input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px #E8651A, 0 0 0 4px rgb(232 101 26 / 25%);
}

.dual-range__input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px #E8651A, 0 0 0 4px rgb(232 101 26 / 25%);
}

/* ── Checkbox custom ── */
.custom-check {
  accent-color: #E8651A;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Pill toggle buttons ── */
.pill-btn {
  border: 1.5px solid #E8651A;
  color: #E8651A;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
}

.pill-btn.active,
.pill-btn:hover {
  background: #E8651A;
  color: #fff;
}

/* ── Floor tab ── */
.floor-tab {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  border: 1.5px solid transparent;
  color: #888;
  transition: all 0.15s;
}

.floor-tab.active {
  background: #1C1C1C;
  color: #fff;
}

.floor-tab:not(.active):hover {
  border-color: #ccc;
  color: #444;
}

/* ── Render canvas ── */
.render-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #111;
  cursor: grab;

  object-fit: contain;
  image-rendering: auto;
  -webkit-optimize-contrast: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.render-canvas:active {
  cursor: grabbing;
}

/* ── Mobile rotate overlay ── */
.rotate-overlay {
  position: fixed;
  inset: 0;
  background: #1C1C1C;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: white;
}

.rotate-phone {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(90deg);
  }
}

@media (max-width: 1024px) and (orientation: portrait) {
  .rotate-overlay {
    display: flex;
  }

  .footer-copyright {
    display: none;
  }
}

/* Filter layout switches to desktop only above 1024px. */
.desktop-filter-sidebar,
.apartment-status-legend {
  display: none;
}

@media (min-width: 1025px) {
  .desktop-filter-sidebar,
  .apartment-status-legend {
    display: flex;
  }

  .mobile-filter-backdrop,
  .mobile-filter-drawer,
  .mobile-filter-fab {
    display: none !important;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  #footer-block {
    display: none;
  }
}

/* Mobile - pomeri kontrole rotacije gore levo */
@media (max-width: 1024px) and (orientation: landscape) {
  .rotation-controls {
    top: 1rem;
    left: 1rem;

    bottom: auto !important;
    right: auto !important;

    width: auto;
    height: auto;
  }
}
