/**
 * Glenrowan Estate Masterplan Desktop Styles
 * Optimized for performance - extracted from inline styles
 */

/* ============================================
   BASE LAYOUT
   ============================================ */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "fustat", sans-serif;
}

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

body.dragging,
#sidebar,
#map-container,
#map-inner {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
#sidebar {
  width: 565px;
  background-color: #EEEDE7;
  background-image: url('/wp-content/uploads/2025/10/Background-Shape.svg');
  background-size: cover;
  background-position: 50% 25vh;
  background-repeat: no-repeat;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  padding: 1.5em 2.5em 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  overflow: hidden;
}

/* Hide filter until we know if both categories exist */
#lot-filter {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  display: none;
}

#lot-filter.show {
  opacity: 1;
  visibility: visible;
  display: flex;
  animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#sidebar-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#default-step.sidebar-step.active {
  position: relative;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#default-step .lot-filter {
  flex-shrink: 0;
}

#lot-list {
  flex-grow: 1;
}

/* ============================================
   SIDEBAR STEPS
   ============================================ */
.sidebar-step {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  display: none;
}

.sidebar-step.active {
  opacity: 1;
  visibility: visible;
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#lot-details-step {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#lot-details-step #lot-details {
  position: sticky;
  top: 0;
  z-index: 5;
}

#lot-list-scrollable {
  flex: 1;
  overflow-y: auto;
  height: 100%;
  padding-right: 1em;
}

#lot-details {
  margin-top: 1em;
}

#lot-details hr {
  border: 0.5px solid #9F9F58;
}

#enquire-step {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

#default-step {
  position: relative;
  overflow-y: auto;
  height: 100%;
  padding-right: 0.5em;
}

#default-step::-webkit-scrollbar {
  width: 8px;
}

#default-step::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}

#default-step:hover::-webkit-scrollbar-thumb {
  background: #888;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-back {
  background: none;
  border: none !important;
  color: #f47d20;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 15px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-back:hover {
  text-decoration: underline;
}

.btn-back svg {
  margin-top: -2px;
}

.btn-enquire {
  background: #f47d20;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 10px;
}

.btn-enquire:hover {
  background: #b34514;
}

/* ============================================
   LINKS
   ============================================ */
.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: #1D1D1D;
  text-decoration: none;
  font-size: 14px;
  transition: opacity 1s ease;
  margin: 0 !important;
}

.link svg path {
  transition: stroke 1s ease;
}

.link:hover svg path {
  stroke: #c45130 !important;
}

.link:hover {
  color: #1D1D1D;
  opacity: 1 !important;
}

/* ============================================
   MAP CONTAINER
   ============================================ */
#map-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #fff;
}

#map-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  cursor: grab;
  transition: transform 0.35s ease;
}

#map-inner.dragging {
  cursor: grabbing;
}

svg {
  display: block;
  user-select: none;
  pointer-events: all;
}

/* ============================================
   LOT STYLES
   ============================================ */
[data-name^="lot-"] {
  cursor: pointer;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

[data-name^="lot-"]:hover {
  fill: #a64226 !important;
}

.active-lot {
  fill: #a64226 !important;
}

.lot-disabled {
  cursor: not-allowed !important;
}

/* Lots without published CPTs - no hover or click */
.lot-unpublished {
  cursor: default !important;
  pointer-events: none !important;
}

.lot-unpublished:hover {
  fill: inherit !important;
}

/* ============================================
   ZOOM CONTROLS
   ============================================ */
.zoom-controls {
  position: absolute;
  bottom: 35px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 50;
}

.zoom-controls button {
  background: #f47d20;
  color: white;
  border: none;
  border-radius: 4px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.3s;
}

.zoom-controls button:hover {
  background: #b34514;
}

.page-id-1421 #zoom-in {
  background: #FFF !important;
  width: 2em !important;
  height: 2em !important;
  padding: 0 !important;
  display: grid;
  justify-content: center;
  align-content: center;
  border-radius: 4px 4px 0 0 !important;
  border-bottom: 1px solid #D5D2C3 !important;
  color: #5F6638 !important;
}

.page-id-1421 #zoom-out {
  background: #FFF !important;
  width: 2em !important;
  height: 2em !important;
  padding: 0 !important;
  display: grid;
  justify-content: center;
  align-content: center;
  border-radius: 0 0 4px 4px !important;
  border-top: 0 !important;
  color: #5F6638 !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1em 0;
}

.text-center {
  text-align: center;
}

/* ============================================
   ADDITIONAL STYLES
   ============================================ */
hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #ddd;
}

.house-stats {
  display: flex;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 0.5em;
}

.house-stats p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 1.5vh;
}

.builder-logo {
  height: auto;
  max-width: 120px;
  max-height: 50px;
  margin-top: 10px;
}

.house-land-img img {
  max-width: 100%;
  margin-top: -8px;
}

#masterplan {
  display: flex;
  flex: 1;
  margin-top: 110px;
  height: calc(100vh - 80px);
}

/* Safari-only styles */
@supports (-webkit-touch-callout: none) {
  #masterplan {
    margin-top: 140px;
  }
}

[data-name^="lot-"].lot-disabled {
  fill: #728b8c !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 1;
}

.status-label text {
  paint-order: stroke;
  stroke: rgba(0,0,0,0.35);
  stroke-width: 0.3px;
  shape-rendering: crispEdges;
  pointer-events: none;
}

#lot-list .img,
#lot-list-scrollable .img {
  aspect-ratio: 5 / 5;
  background-size: cover;
  background-position: center;
}

#lot-list .halves .col:last-child,
#lot-list-scrollable .halves .col:last-child {
  display: flex;
  flex-direction: column;
}

#lot-list .halves .col:last-child > p.stage,
#lot-list-scrollable .halves .col:last-child > p.stage {
  width: 100%;
  margin-bottom: 0.5em;
}

#lot-list .halves .col:last-child .col-inner-halves,
#lot-list-scrollable .halves .col:last-child .col-inner-halves {
  display: flex;
  align-items: center;
  width: 100%;
}

#lot-list .halves .col:last-child .col-inner-halves > div,
#lot-list-scrollable .halves .col:last-child .col-inner-halves > div {
  width: 50%;
  float: left;
}

.logo-container {
  display: grid;
  justify-items: end;
  margin-right: 2em;
}

#lot-filter {
  justify-content: space-between;
}

#lot-filter p {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0;
}

.lot-filter {
  margin-bottom: 20px;
  display: flex;
  align-items: center !important;
}

.lot-filter p {
  margin: 0;
  margin-right: 1em;
}

button.filter-btn {
  margin-right: 10px;
  padding: 6px 13px 3px !important;
  cursor: pointer;
  font-size: 12px !important;
  margin: 0 !important;
}

.filter.btn:hover,
.filter-btn.active {
  background: #5F6638 !important;
  color: #FFF !important;
  border: 1px solid #5F6638 !important;
}

.lot-land,
.lot-house-and-land {
  transition: background 0.6s ease;
  margin-bottom: 1em;
}

.lot-land:hover,
.lot-house-and-land:hover {
  background: #e0dfd5;
}

.lot-land.active,
.lot-house-and-land.active {
  background: #e0dfd5;
  border: 1px solid #5F6638;
}

.lot-land img,
.lot-house-and-land img {
  width: 100%;
  height: auto;
  margin-bottom: 15px;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.lot-land h4,
.lot-house-and-land h4 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 700;
  color: #1D1D1D;
}

.lot-land p,
.lot-house-and-land p {
  margin: 6px 0;
  font-size: 14px;
  color: #1D1D1D;
  line-height: 1.5;
}

.lot-land p strong,
.lot-house-and-land p strong {
  font-weight: 700;
}

.lot-land .price,
.lot-house-and-land .price {
  font-size: 18px;
  font-weight: 700;
  color: #f47d20;
  margin-top: 12px;
}

span.beds {
  display: inline-block;
  width: 15px;
  height: 12px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='14.954' height='11.749' viewBox='0 0 14.954 11.749'><path id='Icon_ion-bed-sharp' d='M15.6,10.432V6.159a.534.534,0,0,0-.534-.534H4.386a.534.534,0,0,0-.534.534v4.273a1.6,1.6,0,0,0-1.6,1.6v5.341h1.2V16.306H16v1.068h1.2V12.034A1.6,1.6,0,0,0,15.6,10.432Zm-6.409,0H5.187V9.363a.534.534,0,0,1,.534-.534H8.659a.534.534,0,0,1,.534.534Zm1.068-1.068a.534.534,0,0,1,.534-.534h2.937a.534.534,0,0,1,.534.534v1.068H10.261Z' transform='translate(-2.25 -5.625)' fill='%231d1d1d'/></svg>") no-repeat center;
  background-size: contain;
  margin-top: -3px;
}

span.baths {
  display: inline-block;
  width: 15px;
  height: 12px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' id='Icon_material-sharp-bathtub' data-name='Icon material-sharp-bathtub' width='13.18' height='13.18' viewBox='0 0 13.18 13.18'><path id='Path_16' data-name='Path 16' d='M10.136,8.818A1.318,1.318,0,1,1,8.818,7.5a1.318,1.318,0,0,1,1.318,1.318Z' transform='translate(-5.523 -5.523)' fill='%231d1d1d'/><path id='Path_17' data-name='Path 17' d='M14.862,10.249V4.865a1.864,1.864,0,0,0-3.183-1.318l-.824.824a1.121,1.121,0,0,0-.336-.053,1.309,1.309,0,0,0-.712.211l1.819,1.819a1.309,1.309,0,0,0,.211-.712,1.425,1.425,0,0,0-.046-.336l.824-.824a.546.546,0,0,1,.929.389v5.384H9.03a3.36,3.36,0,0,1-.54-.474L7.567,8.753a1.414,1.414,0,0,0-.455-.33A1.483,1.483,0,0,0,4.977,9.755v.494H3v5.272H4.318v.659H14.862v-.659H16.18V10.249Z' transform='translate(-3 -3)' fill='%231d1d1d'/></svg>") no-repeat center;
  background-size: contain;
  margin-top: -4px;
}

span.cars {
  display: inline-block;
  width: 17px;
  height: 12px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='17.422' height='11.615' viewBox='0 0 17.422 11.615'><path id='Icon_ion-car-sport-sharp' d='M18.257,11.4a5.617,5.617,0,0,0-1.184-.646c.187-.1.315-.117.315-.516,0-.436,0-.581-.293-.581H16.11L16.1,9.627c-.636-1.389-.721-1.74-1.67-2.212A12.471,12.471,0,0,0,9.836,6.75a12.462,12.462,0,0,0-4.591.665c-.949.472-.926.715-1.67,2.212a.139.139,0,0,1-.015.027H2.575c-.288,0-.29.145-.29.581,0,.4.128.419.315.516a10.346,10.346,0,0,0-1.184.646,7.9,7.9,0,0,0-.29,2.9c0,1.742.145,3.484.145,3.484H1.7c0,.508.075.581.293.581H4.9c.218,0,.29-.073.29-.581h9.292c0,.508.073.581.29.581h2.976c.145,0,.218-.109.218-.581H18.4s.145-1.778.145-3.484A9.346,9.346,0,0,0,18.257,11.4ZM5.091,13.027a18.763,18.763,0,0,1-1.99.111c-.741,0-.767.048-.819-.415a2.619,2.619,0,0,1,.019-.636l.023-.111h.109a5.005,5.005,0,0,1,1.617.246,3.557,3.557,0,0,1,1.092.547.523.523,0,0,1,.195.224Zm8.971,2.613-.16.4H5.771s.014-.022-.181-.406c-.145-.284.036-.465.323-.568A12.077,12.077,0,0,1,9.836,14.3a10.277,10.277,0,0,1,3.938.768c.2.1.448.176.287.575ZM4.734,10.685a3.493,3.493,0,0,1-.352,0c.095-.168.147-.356.24-.552a3.2,3.2,0,0,1,1.214-1.61,10.947,10.947,0,0,1,4-.617,10.917,10.917,0,0,1,4,.617,3.207,3.207,0,0,1,1.214,1.61c.093.2.145.387.242.556-.073,0-.156,0-.355-.007Zm12.621,2.037c-.078.453-.005.417-.783.417a18.762,18.762,0,0,1-1.99-.111.156.156,0,0,1-.05-.258,3.406,3.406,0,0,1,1.092-.547,4.7,4.7,0,0,1,1.637-.243.117.117,0,0,1,.112.109,2.547,2.547,0,0,1-.018.634Z' transform='translate(-1.125 -6.75)' fill='%231d1d1d'/></svg>") no-repeat center;
  background-size: contain;
  margin-top: -4px;
}

#back-to-default,
#back-to-lot-details {
  padding: 0 !important;
  border: none !important;
  margin: 0 !important;
  gap: 1em;
}

#back-to-default:hover,
#back-to-lot-details:hover {
  background: none !important;
  color: #000 !important;
  text-decoration: none !important;
}

#enquire-step h3 {
  margin-top: 2em;
}

#lot-list-scrollable,
#default-step {
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
}

/* Fade in lots in scrollable list */
#lot-list-scrollable .lot-land {
  animation: fadeInUp 0.3s ease-out forwards;
}

#lot-list-scrollable .lot-land:nth-child(1) { animation-delay: 0.05s; }
#lot-list-scrollable .lot-land:nth-child(2) { animation-delay: 0.1s; }
#lot-list-scrollable .lot-land:nth-child(3) { animation-delay: 0.15s; }
#lot-list-scrollable .lot-land:nth-child(4) { animation-delay: 0.2s; }
#lot-list-scrollable .lot-land:nth-child(n+5) { animation-delay: 0.25s; }

#lot-list-scrollable::-webkit-scrollbar,
#default-step::-webkit-scrollbar {
  width: 8px;
}

#lot-list-scrollable::-webkit-scrollbar-track,
#default-step::-webkit-scrollbar-track {
  background: #FFF;
}

#lot-list-scrollable::-webkit-scrollbar-thumb,
#default-step::-webkit-scrollbar-thumb {
  background-color: #5F6638;
  border-radius: 5px;
}

#lot-list-scrollable::-webkit-scrollbar-thumb:hover,
#default-step::-webkit-scrollbar-thumb:hover {
  background-color: #5f6638;
}

.link {
  font-size: 12px;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1D1D1D;
  display: block;
  margin: 1.5em 0;
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: opacity 0.6s ease;
}

.link:hover, .link:hover svg {
  opacity: 0.8;
}

.link:hover svg path {
  stroke: #000;
}

.link svg {
  margin-top: -2px;
}

.north-point {
  position: absolute;
  bottom: 96px;
  right: 13px;
}

.north-point img {
  width: 2.5em;
}

#sidebar {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
}

#sidebar-steps {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#default-step.sidebar-step.active {
  position: relative;
  flex: 1;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  pointer-events: auto !important;
}

.st5, .st6 {
  fill: none !important;
}

/* ============================================
   SKELETON LOADING STATE
   ============================================ */
.lot-skeleton {
  background: #fff;
  padding: 1em;
  margin-bottom: 1em;
  border-radius: 4px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Fade out skeletons when removing */
.lot-skeleton.fade-out {
  opacity: 0;
}

.lot-skeleton .skeleton-image {
  width: 100%;
  height: 150px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1s infinite;
  border-radius: 4px;
  margin-bottom: 0.5em;
}

.lot-skeleton .skeleton-text {
  height: 20px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1s infinite;
  border-radius: 4px;
  margin-bottom: 0.5em;
}

.lot-skeleton .skeleton-text.short {
  width: 60%;
}

/* Fade in real lot cards with stagger effect */
.lot-land {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

/* Stagger each lot's appearance */
.lot-land:nth-child(1) { animation-delay: 0.05s; }
.lot-land:nth-child(2) { animation-delay: 0.1s; }
.lot-land:nth-child(3) { animation-delay: 0.15s; }
.lot-land:nth-child(4) { animation-delay: 0.2s; }
.lot-land:nth-child(5) { animation-delay: 0.25s; }
.lot-land:nth-child(6) { animation-delay: 0.3s; }
.lot-land:nth-child(7) { animation-delay: 0.35s; }
.lot-land:nth-child(8) { animation-delay: 0.4s; }
.lot-land:nth-child(n+9) { animation-delay: 0.45s; }

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

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ============================================
   LOT DETAILS PRICE STYLING
   ============================================ */
#lot-details p.price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#lot-details p.price .price-label,
#lot-details p.price .price-value {
  display: block;
}

/* ============================================
   LOT NUMBERS - ALWAYS VISIBLE
   ============================================ */
/* Force lot numbers to always be visible regardless of status */
[id="Lot_Number"],
[id^="Lot_Number"],
g[id="Lot_Number"] text,
g[id^="Lot_Number"] text,
[id="Lot_Number"] *,
[id^="Lot_Number"] * {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  fill: #FFFFFF !important;  /* White text for visibility */
}

/* Additional specificity for text elements within lot number groups */
g[id^="Lot_"] g[id="Lot_Number"] text,
g[id^="Lot_"] g[id^="Lot_Number"] text,
g[id^="Lot_"] [id="Lot_Number"] tspan,
g[id^="Lot_"] [id^="Lot_Number"] tspan {
  fill: #FFFFFF !important;
}

/* Prevent inheritance from parent lot groups */
g[id^="Lot_"][data-status] [id="Lot_Number"],
g[id^="Lot_"][data-status] [id^="Lot_Number"],
g[id^="Lot_"][data-status] [id="Lot_Number"] *,
g[id^="Lot_"][data-status] [id^="Lot_Number"] * {
  fill: #FFFFFF !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  #sidebar {
    width: 100%;
    height: auto;
  }
}
