/**
 * Inside Interio — Whole-Home 3D Configurator Stylesheet
 */

/* Main Container Layout */
.configurator-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* accounts for mobile browser URL bar */
  overflow: hidden;
  background: #061121;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}

/* TOP ACTION HEADER */
.config-top-bar {
  height: 60px;
  background: rgba(6, 38, 90, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
}

.config-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.config-back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.config-back-link:hover {
  color: #ffffff;
  background: rgba(18, 100, 217, 0.3);
}

.config-brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
}

.config-title-group {
  display: flex;
  flex-direction: column;
}

.config-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: #ffffff;
}

.config-subtitle {
  font-size: 0.68rem;
  color: #1264d9;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* 3D VIEW MODE SWITCHER */
.config-mode-switcher {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 4px;
}

.view-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.view-mode-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.view-mode-btn.active {
  background: #1264d9;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(18, 100, 217, 0.4);
}

/* TOP RIGHT ACTIONS */
.config-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.consistency-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 100, 217, 0.15);
  border: 1px solid rgba(18, 100, 217, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.consistency-widget:hover {
  background: rgba(18, 100, 217, 0.3);
  transform: translateY(-1px);
}

.consistency-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.consistency-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #10b981;
}

.config-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ROOM SELECTOR NAVIGATION BAR */
.config-room-selector-bar {
  height: 48px;
  background: #0a182f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
  flex-shrink: 0;
}

.room-nav-arrow {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-nav-arrow:hover {
  background: #1264d9;
  border-color: #1264d9;
}

.room-selector-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-selector-scroll::-webkit-scrollbar {
  display: none;
}

.room-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.room-select-btn .room-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.2s ease;
}

.room-select-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.room-select-btn.active {
  background: rgba(18, 100, 217, 0.2);
  border-color: #1264d9;
  color: #ffffff;
}

.room-select-btn.active .room-dot {
  background: #1264d9;
  box-shadow: 0 0 8px #1264d9;
}

/* WORKSPACE LAYOUT */
.config-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* 3D VIEWPORT CANVAS */
.config-viewport {
  flex: 1;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at center, #1e3a8a 0%, #030d1e 100%);
}

.config-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none; /* prevent browser scroll/zoom gestures fighting OrbitControls on touch */
}

/* SELECTION HUD */
.selection-hud {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(6, 38, 90, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(18, 100, 217, 0.5);
  padding: 10px 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.selection-hud.active {
  display: flex;
}

.selection-hud-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-delete-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #ff6b6b;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.hud-delete-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.obj-badge {
  font-size: 0.6rem;
  font-weight: 800;
  color: #1264d9;
  letter-spacing: 0.08em;
}

.obj-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.obj-coords {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* VIEWPORT CONTROLS HUD */
.viewport-controls-hud {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 6px;
  background: rgba(6, 38, 90, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.cam-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cam-btn:hover {
  background: #1264d9;
  color: #ffffff;
}

/* SIDEBAR DOCK */
.config-sidebar {
  width: 360px;
  height: 100%;
  background: #08162d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 80;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.config-sidebar.collapsed {
  transform: translateX(-360px);
}

.sidebar-toggle-tab {
  position: absolute;
  top: 50%;
  right: -28px;
  transform: translateY(-50%);
  width: 28px;
  height: 48px;
  background: #08162d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: none;
  border-radius: 0 6px 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  z-index: 85;
}

.sidebar-toggle-tab:hover {
  color: #ffffff;
  background: #1264d9;
}

.dock-tabs {
  display: flex;
  background: #040c1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.dock-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dock-tab-btn:hover {
  color: #cbd5e1;
}

.dock-tab-btn.active {
  color: #1264d9;
  border-bottom-color: #1264d9;
  background: rgba(18, 100, 217, 0.05);
}

.dock-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.dock-panel {
  display: none;
}

.dock-panel.active {
  display: block;
}

.panel-section-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.panel-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0 0 18px 0;
  line-height: 1.4;
}

/* CATALOG GRID */
.furniture-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.catalog-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catalog-item:hover {
  background: rgba(18, 100, 217, 0.15);
  border-color: #1264d9;
  color: #ffffff;
  transform: translateY(-2px);
}

.catalog-icon {
  font-size: 1.6rem;
}

.catalog-name {
  font-size: 0.75rem;
  font-weight: 700;
}

/* SWATCHES & CONTROLS */
.swatches-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.swatch-btn:hover {
  transform: scale(1.15);
}

.swatch-btn.active {
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.floor-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floor-texture-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.floor-texture-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.floor-texture-btn.active {
  border-color: #1264d9;
  background: rgba(18, 100, 217, 0.15);
  color: #ffffff;
}

.floor-preview-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.control-group {
  margin-bottom: 16px;
}

.control-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-group-full {
  display: flex;
  gap: 6px;
}

.transform-mode-btn, .kitchen-counter-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transform-mode-btn.active, .kitchen-counter-btn.active {
  background: #1264d9;
  color: #ffffff;
  border-color: #1264d9;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.slider-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1264d9;
}

.config-slider {
  width: 100%;
  accent-color: #1264d9;
  cursor: pointer;
}

.selected-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-item-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.btn-delete-item {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-delete-item:hover {
  background: #ef4444;
  color: #ffffff;
}

.empty-notice {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 24px 16px;
  border-radius: 8px;
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* LIGHTING CARDS */
.lighting-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lighting-mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lighting-mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lighting-mode-card.active {
  border-color: #1264d9;
  background: rgba(18, 100, 217, 0.15);
}

.lighting-icon {
  font-size: 1.6rem;
}

.lighting-info h4 {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: #ffffff;
}

.lighting-info p {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0;
}

/* SCENE OBJECTS LIST */
.scene-objects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scene-object-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scene-object-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.scene-object-item.selected {
  border-color: #1264d9;
  background: rgba(18, 100, 217, 0.2);
}

.scene-object-item .obj-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
}

/* MOBILE BOTTOM NAV */
.config-mobile-bottom-nav {
  display: none;
  height: 56px;
  background: #040c1a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  flex-shrink: 0;
}

.mobile-bottom-tab {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.mobile-bottom-tab.active {
  color: #1264d9;
}

/* MODAL OVERLAYS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #0a182f;
  border: 1px solid rgba(18, 100, 217, 0.4);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

#consistency-detail-modal {
  display: none;
}

#consistency-detail-modal.open {
  display: flex;
}

/* Mobile sidebar drawer handle (hidden on desktop) */
.mobile-sidebar-handle {
  display: none;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
  .config-sidebar {
    width: 320px;
  }

  .config-action-buttons .btn span {
    display: none;
  }

  #btn-get-quote span {
    display: inline;
  }
}

@media (max-width: 768px) {
  /* ---- TOP ACTION HEADER: wrap into rows instead of overflowing ---- */
  .config-top-bar {
    height: auto;
    min-height: 54px;
    padding: 8px 10px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .config-top-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .config-back-link {
    padding: 6px 8px;
  }

  .config-subtitle, .config-back-link span {
    display: none;
  }

  .config-brand-divider {
    display: none;
  }

  .config-title-group {
    min-width: 0;
  }

  .config-title {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
  }

  /* Mode switcher becomes its own full-width scrollable row */
  .config-mode-switcher {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }

  .config-mode-switcher::-webkit-scrollbar {
    display: none;
  }

  .view-mode-btn {
    flex-shrink: 0;
    padding: 7px 10px;
  }

  .view-mode-btn span {
    display: none; /* icon-only on mobile, full label still in title tooltip */
  }

  /* Top-right actions: compact, icon-first, horizontally scrollable if needed */
  .config-top-right {
    order: 2;
    gap: 8px;
    flex-shrink: 0;
  }

  .consistency-widget {
    padding: 5px 8px;
  }

  .consistency-label {
    display: none;
  }

  .config-action-buttons {
    gap: 6px;
  }

  .config-action-buttons .btn.btn-sm {
    padding: 7px 8px;
  }

  .config-action-buttons .btn span {
    display: none; /* icon-only for Save / Snapshot buttons */
  }

  #btn-get-quote span {
    display: inline; /* keep label on the primary CTA (it has no icon) */
    font-size: 0.68rem;
  }

  /* ---- ROOM SELECTOR BAR ---- */
  .config-room-selector-bar {
    padding: 0 8px;
    gap: 8px;
  }

  .room-nav-arrow {
    display: none; /* swipe/scroll instead on touch */
  }

  .room-select-btn {
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  /* ---- SIDEBAR AS BOTTOM DRAWER ---- */
  .config-sidebar {
    position: absolute;
    bottom: 56px;
    left: 0;
    width: 100%;
    height: 70vh;
    max-height: 420px;
    transform: translateY(100%);
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
  }

  .config-sidebar.mobile-open {
    transform: translateY(0);
  }

  .sidebar-toggle-tab {
    display: none;
  }

  /* Drag-handle / close button for the mobile drawer */
  .mobile-sidebar-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px 0 4px;
    flex-shrink: 0;
  }

  .mobile-sidebar-handle .handle-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
  }

  .mobile-sidebar-close-btn {
    position: absolute;
    right: 10px;
    top: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
  }

  .config-mobile-bottom-nav {
    display: flex;
  }

  /* ---- 3D VIEWPORT HUDs: keep inside safe bounds on narrow screens ---- */
  .selection-hud {
    left: 10px;
    right: 10px;
    top: 10px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .selection-hud-info {
    min-width: 0;
    flex: 1 1 auto;
  }

  .obj-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
    display: inline-block;
  }

  .viewport-controls-hud {
    bottom: 14px;
    right: 10px;
    padding: 5px;
    gap: 4px;
  }

  .cam-btn {
    padding: 6px 8px;
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .config-title {
    max-width: 34vw;
    font-size: 0.72rem;
  }

  .config-top-right {
    gap: 6px;
  }

  #btn-get-quote span {
    font-size: 0.62rem;
  }

  .config-action-buttons .btn.btn-sm {
    padding: 6px 7px;
  }

  .obj-coords {
    display: none; /* not enough room for coords on very small screens */
  }

  .cam-btn span {
    display: none;
  }

  .cam-btn {
    padding: 6px;
  }

  .mobile-bottom-tab {
    font-size: 0.66rem;
    padding: 8px 6px;
  }
}
