/* ==========================================================================
   VC Interactive Plot Selector
   Vision Court Estate - Interactive Site Plan Modal
   ========================================================================== */

/* ---------- Modal Container ---------- */
#vcPlotSelectorModal .modal-dialog {
  max-width: 640px;
  margin: 20px auto;
}
#vcPlotSelectorModal .modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  padding: 0;
}
#vcPlotSelectorModal .modal-header {
  background: linear-gradient(135deg, #1a3a6b 0%, #3b7dd8 100%);
  color: #fff;
  border-bottom: none;
  padding: 12px 20px;
  align-items: center;
}
#vcPlotSelectorModal .modal-header .modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
#vcPlotSelectorModal .modal-header .close {
  color: #fff;
  opacity: 0.8;
  text-shadow: none;
  font-size: 24px;
  padding: 0;
  margin: 0;
}
#vcPlotSelectorModal .modal-header .close:hover {
  opacity: 1;
}
#vcPlotSelectorModal .modal-body {
  padding: 0;
  min-height: auto;
  position: relative;
}

/* ---------- Breadcrumb / Steps ---------- */
.vc-ps-steps {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  gap: 6px;
  flex-wrap: wrap;
}
.vc-ps-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
}
.vc-ps-step.active {
  color: #1a3a6b;
  font-weight: 600;
}
.vc-ps-step.completed {
  color: #3b7dd8;
}
.vc-ps-step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.vc-ps-step.active .step-num {
  background: #1a3a6b;
}
.vc-ps-step.completed .step-num {
  background: #3b7dd8;
}
.vc-ps-step-divider {
  color: #ccc;
  font-size: 16px;
}

/* ---------- Content Area ---------- */
.vc-ps-content {
  padding: 16px 20px;
}
.vc-ps-panel {
  display: none;
  animation: vcPsFadeIn 0.3s ease;
}
.vc-ps-panel.active {
  display: block;
}
@keyframes vcPsFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Step 1: Site Plan / Zone Selection ---------- */
.vc-ps-site-plan {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}
.vc-ps-site-plan img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  display: block;
}
.vc-ps-site-plan svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.vc-ps-zone-overlay {
  cursor: pointer;
  transition: all 0.3s ease;
  stroke-width: 2;
}
.vc-ps-zone-overlay.coming-soon {
  cursor: not-allowed;
  opacity: 0.5;
}
.vc-ps-zone-overlay.zone-a {
  fill: rgba(0, 180, 80, 0.15);
  stroke: rgba(0, 180, 80, 0.5);
}
.vc-ps-zone-overlay.zone-b {
  fill: rgba(0, 100, 220, 0.15);
  stroke: rgba(0, 100, 220, 0.5);
}
.vc-ps-zone-overlay.zone-c {
  fill: rgba(220, 50, 50, 0.15);
  stroke: rgba(220, 50, 50, 0.5);
}
.vc-ps-zone-overlay:not(.coming-soon):hover {
  fill-opacity: 0.4;
  stroke-width: 3;
}
.vc-ps-zone-overlay.zone-a:not(.coming-soon):hover {
  fill: rgba(0, 180, 80, 0.35);
}
.vc-ps-zone-overlay.zone-b:not(.coming-soon):hover {
  fill: rgba(0, 100, 220, 0.35);
}
.vc-ps-zone-overlay.zone-c:not(.coming-soon):hover {
  fill: rgba(220, 50, 50, 0.35);
}
.vc-ps-zone-coming-soon {
  pointer-events: none;
  font-size: 14px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  fill: #666;
  font-style: italic;
}
.vc-ps-zone-label {
  pointer-events: none;
  font-size: 18px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.vc-ps-zone-label.label-a {
  fill: #006030;
  stroke: #fff;
}
.vc-ps-zone-label.label-b {
  fill: #003380;
  stroke: #fff;
}
.vc-ps-zone-label.label-c {
  fill: #801010;
  stroke: #fff;
}

/* Zone hint text */
.vc-ps-zone-hint {
  text-align: center;
  padding: 12px;
  color: #666;
  font-size: 14px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 16px;
}
.vc-ps-zone-hint i {
  margin-right: 6px;
  color: #3b7dd8;
}

/* ---------- Step 2: Plot Type Cards ---------- */
.vc-ps-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 8px 0;
}
.vc-ps-type-card {
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}
.vc-ps-type-card:hover {
  border-color: #3b7dd8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.vc-ps-type-card .type-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}
.vc-ps-type-card .type-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.vc-ps-type-card .type-count {
  font-size: 13px;
  color: #888;
}
.vc-ps-type-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Step 3: Plot Grid ---------- */
.vc-ps-plot-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.vc-ps-plot-grid-header h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #333;
}
.vc-ps-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  align-items: center;
}
.vc-ps-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vc-ps-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.vc-ps-legend-dot.available {
  background: #d4edda;
  border: 1px solid #28a745;
}
.vc-ps-legend-dot.sold {
  background: #f8d7da;
  border: 1px solid #dc3545;
}

.vc-ps-plot-search {
  margin-bottom: 12px;
}
.vc-ps-plot-search input {
  max-width: 300px;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 8px 12px;
  font-size: 14px;
}
.vc-ps-plot-search input:focus {
  border-color: #3b7dd8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 125, 216, 0.15);
}

.vc-ps-plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}
.vc-ps-plot-card {
  background: #d4edda;
  border: 1.5px solid #28a745;
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.vc-ps-plot-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}
.vc-ps-plot-card .plot-code {
  font-size: 12px;
  font-weight: 700;
  color: #155724;
  display: block;
}
.vc-ps-plot-card .plot-size {
  font-size: 10px;
  color: #155724;
  display: block;
  margin-top: 1px;
}
.vc-ps-plot-card .plot-price {
  font-size: 10px;
  font-weight: 600;
  color: #155724;
  display: block;
  margin-top: 2px;
}
.vc-ps-plot-card .plot-status {
  font-size: 9px;
  color: #155724;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.vc-ps-plot-card.sold {
  background: #f8d7da;
  border-color: #dc3545;
  cursor: not-allowed;
  opacity: 0.6;
}
.vc-ps-plot-card.sold:hover {
  transform: none;
  box-shadow: none;
}
.vc-ps-plot-card.sold .plot-code {
  color: #721c24;
  text-decoration: line-through;
}
.vc-ps-plot-card.sold .plot-status {
  color: #721c24;
}
.vc-ps-plot-card.sold .plot-size,
.vc-ps-plot-card.sold .plot-price {
  color: #721c24;
}
.vc-ps-plot-card.selected {
  background: #1a3a6b;
  border-color: #1a3a6b;
  box-shadow: 0 4px 12px rgba(26, 58, 107, 0.4);
}
.vc-ps-plot-card.selected .plot-code,
.vc-ps-plot-card.selected .plot-status,
.vc-ps-plot-card.selected .plot-size,
.vc-ps-plot-card.selected .plot-price {
  color: #fff;
}
.vc-ps-plots-empty {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-size: 15px;
}

/* ---------- Step 4: Land Size Selection ---------- */
.vc-ps-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.vc-ps-size-card {
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.vc-ps-size-card:hover {
  border-color: #3b7dd8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.vc-ps-size-card.selected {
  border-color: #1a3a6b;
  background: #f0faf4;
  box-shadow: 0 4px 16px rgba(26, 58, 107, 0.2);
}
.vc-ps-size-card .size-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a3a6b;
  display: block;
  margin-bottom: 8px;
}
.vc-ps-size-card .size-price {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  display: block;
  margin-bottom: 4px;
}
.vc-ps-size-card .size-label {
  font-size: 13px;
  color: #888;
}
.vc-ps-size-card.out-of-stock {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Step 5: Summary & Checkout ---------- */
.vc-ps-summary {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 4px;
}
.vc-ps-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a3a6b;
  margin-bottom: 14px;
  text-align: center;
}
.vc-ps-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 24px;
}
.vc-ps-summary-item {
  display: flex;
  flex-direction: column;
}
.vc-ps-summary-item .sum-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.vc-ps-summary-item .sum-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.vc-ps-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1a3a6b;
  border-radius: 8px;
  margin-bottom: 12px;
}
.vc-ps-summary-total .total-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}
.vc-ps-summary-total .total-value {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.vc-ps-quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.vc-ps-quantity-row label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin: 0;
}
.vc-ps-quantity-row input {
  width: 80px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 16px;
}

/* ---------- Navigation Footer ---------- */
.vc-ps-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #e9ecef;
  background: #fff;
}
.vc-ps-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.vc-ps-btn-back {
  background: #e9ecef;
  color: #333;
}
.vc-ps-btn-back:hover {
  background: #dee2e6;
}
.vc-ps-btn-checkout {
  background: linear-gradient(135deg, #1a3a6b 0%, #3b7dd8 100%);
  color: #fff;
  padding: 10px 24px;
  font-size: 14px;
}
.vc-ps-btn-checkout:hover {
  box-shadow: 0 4px 16px rgba(26, 58, 107, 0.4);
  transform: translateY(-1px);
}
.vc-ps-btn-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- Loading Spinner ---------- */
.vc-ps-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666;
}
.vc-ps-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e9ecef;
  border-top-color: #1a3a6b;
  border-radius: 50%;
  animation: vcPsSpin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes vcPsSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Selected Badge ---------- */
.vc-ps-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f5e9;
  color: #1a3a6b;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

/* ---------- Size Picker (Summary Panel) ---------- */
.vc-ps-size-picker {
  margin: 12px 0;
}
.vc-ps-size-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}
.vc-ps-size-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.vc-ps-size-option {
  flex: 1;
  min-width: 140px;
  cursor: pointer;
  margin: 0;
}
.vc-ps-size-option input[type="radio"] {
  display: none;
}
.vc-ps-size-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #fff;
}
.vc-ps-size-option input[type="radio"]:checked + .vc-ps-size-box {
  border-color: #1a3a6b;
  background: #f0faf4;
  box-shadow: 0 2px 8px rgba(26, 58, 107, 0.15);
}
.vc-ps-size-box:hover {
  border-color: #3b7dd8;
}
.vc-ps-size-box .size-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a6b;
  margin-bottom: 2px;
}
.vc-ps-size-box .size-price {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  #vcPlotSelectorModal .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  .vc-ps-content {
    padding: 16px;
  }
  .vc-ps-steps {
    padding: 12px 16px;
  }
  .vc-ps-step .step-text {
    display: none;
  }
  .vc-ps-type-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .vc-ps-plot-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .vc-ps-size-grid {
    grid-template-columns: 1fr;
  }
  .vc-ps-summary-grid {
    grid-template-columns: 1fr;
  }
  .vc-ps-footer {
    padding: 12px 16px;
  }
  .vc-ps-zone-label {
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  .vc-ps-plot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vc-ps-type-grid {
    grid-template-columns: 1fr;
  }
}
