/* ==========================================================================
   SYNEX INFRA - AI BUILDING DESIGNER STYLESHEET
   Comprehensive architectural and engineering design suite styles
   ========================================================================== */

:root {
  --bd-navy: #101e2c;
  --bd-navy-light: #1b3042;
  --bd-gold: #d6ad65;
  --bd-gold-dark: #b88a38;
  --bd-gold-light: #f5e8cc;
  --bd-bg: #f8fafc;
  --bd-card-bg: #ffffff;
  --bd-border: #e2e8f0;
  --bd-text: #1e293b;
  --bd-text-muted: #64748b;
  --bd-success: #10b981;
  --bd-warning: #f59e0b;
  --bd-danger: #ef4444;
  --bd-info: #0ea5e9;
  --bd-cad-bg: #0b1520;
  --bd-cad-grid: #1e293b;
}

/* Designer Hub Layout */
.designer-hero {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: white;
  padding: 50px 0 40px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--bd-gold);
}

.designer-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(214, 173, 101, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 173, 101, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.designer-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.designer-hero-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.designer-hero-subtitle {
  font-size: 15px;
  color: #cbd5e1;
  max-width: 720px;
  line-height: 1.6;
}

.designer-hero-stats {
  display: flex;
  gap: 20px;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.designer-stat-item {
  text-align: center;
}

.designer-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--bd-gold);
  line-height: 1.2;
}

.designer-stat-lbl {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Submodule Switcher Ribbon */
.submodule-ribbon-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--bd-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.submodule-ribbon {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 0;
  scrollbar-width: thin;
}

.submodule-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bd-text);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.submodule-nav-btn:hover {
  background: #f1f5f9;
  color: var(--bd-navy);
}

.submodule-nav-btn.active {
  background: var(--bd-navy);
  color: #ffffff;
  border-color: var(--bd-navy);
  box-shadow: 0 2px 8px rgba(16, 30, 44, 0.15);
}

.submodule-nav-btn.active .ribbon-icon {
  filter: drop-shadow(0 0 2px var(--bd-gold));
}

.submodule-nav-btn.hub-link {
  background: var(--gold-subtle);
  color: var(--bd-gold-dark);
  border-color: var(--bd-gold-light);
  margin-right: 8px;
}

/* Hub Grid of 6 Submodules */
.submodules-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin: 36px 0;
}

.submodule-card {
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.submodule-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--bd-gold);
}

.submodule-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.submodule-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--gold-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  border: 1px solid rgba(214, 173, 101, 0.4);
}

.submodule-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}

.submodule-badge.active {
  background: #ecfdf5;
  color: #065f46;
}

.submodule-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--bd-navy);
  margin-bottom: 6px;
}

.submodule-card-desc {
  font-size: 13.5px;
  color: var(--bd-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.submodule-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.submodule-features-list li {
  font-size: 12.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.submodule-features-list li::before {
  content: "✓";
  color: var(--bd-gold-dark);
  font-weight: 800;
}

.submodule-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Active Project Header Bar */
.project-active-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--bd-border);
  padding: 12px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.project-active-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.project-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-name-edit {
  font-size: 18px;
  font-weight: 700;
  color: var(--bd-navy);
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
}

.project-name-edit:focus {
  border-color: var(--bd-gold);
  background: #ffffff;
  outline: none;
}

.project-meta-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Workspace Layout (Sidebar + Main Workspace) */
.bd-workspace-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  min-height: calc(100vh - 220px);
  padding: 24px 0;
}

@media (max-width: 992px) {
  .bd-workspace-layout {
    grid-template-columns: 1fr;
  }
}

.bd-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: fit-content;
}

.bd-sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--bd-navy);
  border-bottom: 1px solid var(--bd-border);
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bd-workspace-main {
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  min-height: 600px;
}

.bd-workspace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bd-border);
}

.bd-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CAD & 2D Drawing Canvas */
.fp-canvas-wrap {
  width: 100%;
  height: 540px;
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.cad-canvas-wrap {
  width: 100%;
  height: 540px;
  background: var(--bd-cad-bg);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.fp-canvas-wrap svg,
.cad-canvas-wrap svg,
.elevation-canvas-wrap svg,
.room-planner-canvas-wrap svg,
.structural-grid-wrap svg {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  display: block;
  margin: auto;
  box-sizing: border-box;
}

.cad-canvas-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cad-grid-pattern {
  fill: none;
  stroke: var(--bd-cad-grid);
  stroke-width: 0.5;
}

.cad-overlay-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.cad-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(16, 30, 44, 0.85);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.cad-icon-btn:hover {
  background: var(--bd-gold);
  color: var(--bd-navy);
}

.cad-coord-display {
  position: absolute;
  bottom: 10px;
  left: 14px;
  background: rgba(0,0,0,0.65);
  color: #94a3b8;
  font-family: monospace;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* 3D WebGL Canvas Viewport */
.webgl-3d-wrap {
  width: 100%;
  height: 540px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  background: #1e293b;
  border: 1px solid #334155;
  display: flex;
  justify-content: center;
  align-items: center;
}

#threeJsContainer {
  width: 100%;
  height: 100%;
  display: block;
}

.viewer3d-overlay-top {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.viewer3d-pill-btn {
  background: rgba(16, 30, 44, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.viewer3d-pill-btn:hover, .viewer3d-pill-btn.active {
  background: var(--bd-gold);
  color: var(--bd-navy);
  border-color: var(--bd-gold);
}

.viewer3d-cutaway-box {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(16, 30, 44, 0.9);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  z-index: 10;
  width: 220px;
  backdrop-filter: blur(4px);
}

.viewer3d-cutaway-slider {
  width: 100%;
  margin-top: 6px;
}

/* Elevation View Styles */
.elevation-canvas-wrap {
  width: 100%;
  height: 540px;
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.elevation-facade-svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.elevation-level-marker {
  font-family: monospace;
  font-size: 11px;
  fill: #64748b;
}

.elevation-dim-line {
  stroke: var(--bd-gold-dark);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

/* Room Layout Planner & Furniture Palette */
.furniture-palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.furniture-item-chip {
  background: #f8fafc;
  border: 1px solid var(--bd-border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bd-text);
  transition: all 0.2s ease;
  user-select: none;
}

.furniture-item-chip:hover {
  background: var(--gold-subtle);
  border-color: var(--bd-gold);
  transform: translateY(-2px);
}

.furniture-item-chip .f-icon {
  font-size: 16px;
}

.room-planner-canvas-wrap {
  width: 100%;
  height: 540px;
  background: #fdfcf9;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

/* Structural Design Workspace */
.structural-grid-wrap {
  width: 100%;
  height: 540px;
  background: #0b1520;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.structural-callout-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.5;
  margin-bottom: 16px;
}

.structural-callout-banner strong {
  color: #78350f;
}

.structural-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 14px;
}

.structural-table th {
  background: #f1f5f9;
  color: var(--bd-navy);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--bd-border);
  font-weight: 700;
}

.structural-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bd-border);
  color: var(--bd-text);
}

.structural-table tr:hover td {
  background: #f8fafc;
}

/* Validation Breakdown Panel */
.validation-card {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.validation-card.passed {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.validation-card.warning {
  background: #fffbeb;
  border: 1px solid #fef08a;
  color: #854d0e;
}

.validation-card.failed {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Export Modal & Sheet */
.bd-export-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 1000;
  padding: 8px 0;
  display: none;
}

.bd-export-dropdown-menu.show {
  display: block;
}

.bd-export-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--bd-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.bd-export-item:hover {
  background: #f1f5f9;
  color: var(--bd-navy);
}

/* Interactive Sliders & Inputs */
.form-range-group {
  margin-bottom: 14px;
}

.form-range-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bd-text);
  margin-bottom: 6px;
}

.form-range-label span.val {
  color: var(--bd-gold-dark);
  font-weight: 700;
}

/* Templates Carousel / Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.template-card {
  background: #ffffff;
  border: 1px solid var(--bd-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-card:hover {
  border-color: var(--bd-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.template-card-thumb {
  height: 120px;
  background: linear-gradient(135deg, #101e2c 0%, #1e293b 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--bd-gold);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.template-card-thumb::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: linear-gradient(rgba(214,173,101,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(214,173,101,0.1) 1px, transparent 1px);
  background-size: 16px 16px;
}
