:root {
  --fp-teal: #00b4b6;
  --fp-teal-dark: #008f91;
  --fp-teal-light: #e0f7f8;
  --fp-teal-glow: rgba(0, 180, 182, 0.45);
  --fp-navy: #0f172a;
  --fp-text: #334155;
  --fp-muted: #64748b;
  --fp-border: #e2e8f0;
  --fp-bg-light: #f8fafc;
  --fp-sidebar-w: 420px;
  --fp-header-h: 70px;
  --fp-radius-sm: 6px;
  --fp-radius-md: 12px;
  --fp-radius-lg: 18px;
  --fp-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --fp-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --fp-shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --fp-font-heading: 'Playfair Display', Georgia, serif;
  --fp-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Base resets inside floorplan wrapper */
.floorplan-app-wrapper {
  font-family: var(--fp-font-body);
  color: var(--fp-text);
  background-color: #f1f5f9;
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

.floorplan-app-wrapper *,
.floorplan-app-wrapper *::before,
.floorplan-app-wrapper *::after {
  box-sizing: border-box;
}

/* Standalone Page full height */
body.single-floorplan-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--fp-font-body);
}

body.single-floorplan-page .floorplan-app-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Header */
.fp-header {
  height: var(--fp-header-h);
  background: #ffffff;
  border-bottom: 1px solid var(--fp-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
  box-shadow: var(--fp-shadow-sm);
}

.fp-brand-title {
  font-family: var(--fp-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fp-navy);
  letter-spacing: -0.02em;
  margin: 0;
}

.fp-plan-badge {
  background-color: var(--fp-teal-light);
  color: var(--fp-teal-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.75rem;
}

/* Main Container Layout */
.fp-container {
  display: flex;
  height: calc(100% - var(--fp-header-h));
  min-height: 750px;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  position: relative;
}

/* Left Sidebar */
.fp-sidebar {
  width: var(--fp-sidebar-w);
  min-width: 350px;
  max-width: 460px;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid var(--fp-border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow: hidden;
}

.fp-sidebar-header {
  padding: 1.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.fp-sidebar-title {
  font-family: var(--fp-font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.fp-sidebar-subtitle {
  color: var(--fp-muted);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.fp-search-box {
  position: relative;
  margin-bottom: 0.65rem;
}

.fp-search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s;
  background: #f8fafc;
}

.fp-search-box input:focus {
  outline: none;
  border-color: var(--fp-teal);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 180, 182, 0.15);
}

.fp-search-box .fp-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

.fp-category-pills {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}

.fp-category-pills::-webkit-scrollbar {
  display: none;
}

.fp-category-pill {
  border: 1px solid var(--fp-border);
  background: #ffffff;
  color: var(--fp-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.fp-category-pill:hover,
.fp-category-pill.active {
  background: var(--fp-navy);
  color: #ffffff;
  border-color: var(--fp-navy);
}

/* Sidebar Options List */
.fp-options-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Custom Option Item Card (Clean Minimalist Architectural Style matching Image 2 & 3) */
.fp-option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 0.5rem;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid #f0f2f5;
  border-radius: 0;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  position: relative;
}

.fp-option-item:hover {
  background: #f8fafc;
}

.fp-option-item.active {
  background: #f0fdfa;
}

/* Disabled Combination State */
.fp-option-item.disabled-option {
  background: #f8fafc;
  opacity: 0.6;
  cursor: not-allowed;
}

.fp-option-item.disabled-option:hover {
  background: #f8fafc;
}

.fp-disabled-badge {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Custom Checkbox */
.fp-checkbox-wrapper {
  position: relative;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  flex-shrink: 0;
}

.fp-checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
  z-index: 2;
}

.fp-checkbox-box {
  width: 19px;
  height: 19px;
  border: 1.5px solid #94a3b8;
  border-radius: 2px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
}

.fp-checkbox-wrapper input:checked + .fp-checkbox-box {
  background: #0f172a;
  border-color: #0f172a;
}

.fp-checkbox-box svg {
  width: 12px;
  height: 12px;
  stroke: #ffffff;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s ease-in-out;
}

.fp-checkbox-wrapper input:checked + .fp-checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.fp-option-content {
  flex: 1;
}

.fp-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.15rem;
}

.fp-option-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: #1e293b;
  margin: 0;
  line-height: 1.35;
}

.fp-floor-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  text-transform: uppercase;
}

.fp-floor-tag.gf { background: #dbeafe; color: #1e40af; }
.fp-floor-tag.ff { background: #fce7f3; color: #9d174d; }
.fp-floor-tag.both { background: #e0e7ff; color: #3730a3; }

.fp-option-desc {
  font-size: 0.8rem;
  color: var(--fp-muted);
  line-height: 1.4;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.fp-option-price {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--fp-teal-dark);
  margin-top: 0.2rem;
}

/* Sidebar Footer & Disclaimer */
.fp-sidebar-footer {
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--fp-border);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.02);
}

.fp-pricing-card {
  background: #f8fafc;
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius-md);
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.fp-pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--fp-muted);
  margin-bottom: 0.4rem;
}

.fp-pricing-row.total {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--fp-border);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fp-navy);
  margin-bottom: 0;
}

.fp-disclaimer-wrap {
  margin-top: 0.5rem;
}

.fp-disclaimer-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.fp-disclaimer-body {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.fp-disclaimer {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}

/* Right Canvas Panel */
.fp-canvas-panel {
  flex: 1;
  height: 100%;
  position: relative;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Floor Switcher */
.fp-floor-switcher {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.25rem;
  display: flex;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.fp-floor-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.fp-floor-btn:hover {
  color: #0f172a;
}

.fp-floor-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

/* Canvas Toolbar (Image 2 style) */
.fp-canvas-toolbar {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 30;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.25rem;
  display: flex;
  gap: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.fp-toolbar-btn {
  border: 1px solid transparent;
  background: #ffffff;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.42rem 0.8rem;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.fp-toolbar-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.fp-toolbar-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Centered Bottom Actions Bar (Image 3 style) */
.fp-bottom-actions {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: transparent;
}

/* Pan & Zoom Viewport */
.fp-viewport {
  width: 100%;
  height: 100%;
  cursor: grab;
  position: relative;
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-viewport:active {
  cursor: grabbing;
}

.fp-svg-container {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  transition: transform 0.05s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 55px 40px 85px 40px;
  box-sizing: border-box;
  margin: auto;
}

.fp-svg-container svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: auto;
}

/* Glowing Highlight Effect for SVG Rooms */
.interactive-group {
  cursor: pointer;
  transition: all 0.3s ease;
}

.interactive-group path,
.interactive-group polygon,
.interactive-group rect {
  transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
}

@keyframes fpGlowPulse {
  0% { filter: drop-shadow(0 0 2px rgba(0, 180, 182, 0.4)); opacity: 0.75; }
  50% { filter: drop-shadow(0 0 12px rgba(0, 180, 182, 0.9)); opacity: 1; }
  100% { filter: drop-shadow(0 0 2px rgba(0, 180, 182, 0.4)); opacity: 0.75; }
}

.highlight-pulse {
  animation: fpGlowPulse 1.8s ease-in-out infinite alternate;
}

/* Custom Drawn Polygon Zones */
.custom-drawn-zone {
  animation: fpGlowPulse 2.5s ease-in-out infinite alternate;
}

/* Tooltip */
.floorplan-tooltip {
  position: absolute;
  z-index: 9999;
  background: #0f172a;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  white-space: nowrap;
  display: none;
}

/* Floor Legends */
.fp-floor-legends {
  position: absolute;
  bottom: 1.25rem;
  left: 1.5rem;
  z-index: 30;
  display: flex;
  gap: 0.5rem;
}

.fp-legend-badge {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--fp-border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fp-text);
  box-shadow: var(--fp-shadow-sm);
}

/* Action Buttons in Customer View (Flip floorplan & Download floorplan) */
.fp-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.52rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  font-family: var(--fp-font-body);
  white-space: nowrap;
  user-select: none;
}

.fp-btn-outline {
  background-color: #ffffff;
  color: #111827;
  border: 1.5px solid #111827;
}

.fp-btn-outline:hover {
  background-color: #f8fafc;
  color: #000000;
  border-color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.fp-btn-outline.active,
.fp-btn-outline.is-flipped {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.fp-btn-outline.active .fp-btn-icon,
.fp-btn-outline.is-flipped .fp-btn-icon {
  stroke: #ffffff;
}

.fp-btn-solid {
  background-color: #000000;
  color: #ffffff;
  border: 1.5px solid #000000;
}

.fp-btn-solid:hover {
  background-color: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.fp-btn-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
  display: block;
}

.fp-btn-icon-sm {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  flex-shrink: 0;
  display: block;
}

.fp-toolbar-btn.active,
.fp-toolbar-btn.is-flipped {
  background-color: #0f172a;
  color: #ffffff;
}

/* Download Floorplan Modal Styles */
.fp-dl-svg-btn,
.fp-dl-png-btn,
.fp-dl-print-btn {
  transition: all 0.2s ease;
  border-width: 1.5px;
}

.fp-dl-svg-btn:hover,
.fp-dl-png-btn:hover {
  border-color: var(--fp-teal);
  background-color: #f0fdfa;
  color: #0f172a;
}

.fp-dl-svg-btn:hover i,
.fp-dl-png-btn:hover i {
  color: var(--fp-teal) !important;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .fp-container {
    flex-direction: column;
    height: auto;
    min-height: 900px;
  }
  .fp-sidebar {
    width: 100%;
    max-width: 100%;
    height: 480px;
    border-right: none;
    border-bottom: 1px solid var(--fp-border);
  }
  .fp-canvas-panel {
    height: 550px;
  }
  .fp-action-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .fp-header {
    padding: 0 0.85rem;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .fp-action-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
  }
  .fp-action-btn .fp-btn-icon {
    width: 15px;
    height: 15px;
  }
}

/* Professional Print / PDF Export Layout */
@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .fp-header,
  .fp-sidebar,
  .fp-floor-switcher,
  .fp-canvas-toolbar,
  .modal,
  .modal-backdrop,
  #wpadminbar {
    display: none !important;
  }

  .floorplan-app-wrapper {
    height: auto !important;
    background: #ffffff !important;
  }

  .fp-container {
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
  }

  .fp-canvas-panel {
    height: 85vh !important;
    background: #ffffff !important;
  }

  .fp-viewport {
    width: 100% !important;
    height: 100% !important;
  }

  .fp-svg-container {
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
  }

  .fp-svg-container svg {
    max-width: 100% !important;
    max-height: 85vh !important;
  }
}
