/* ==========================================================================
   Builder Interface Styles
   ========================================================================== */

/* ==========================================================================
   Layout
   ========================================================================== */
.builder-layout {
  display: grid;
  grid-template-columns: 270px 1fr 420px;
  min-height: 100vh;
  padding-top: 72px;
  background: var(--eneco-light-bg);
}

/* ==========================================================================
   Sidebar (Steps)
   ========================================================================== */
.builder-sidebar {
  background: var(--eneco-white);
  border-right: 1px solid #E0DCD7;
  padding: var(--space-2xl) var(--space-xl);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--eneco-text-secondary);
  margin-bottom: var(--space-2xl);
}

.steps-nav {
  position: relative;
}

.steps-nav::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: #E0DCD7;
}

.step-nav-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.step-nav-item:hover .step-nav-label {
  color: var(--eneco-text-primary);
}

.step-nav-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E0DCD7;
  color: var(--eneco-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.step-nav-item.active .step-nav-number {
  background: var(--eneco-gradient);
  color: var(--eneco-text-light);
  box-shadow: 0 4px 12px rgba(227, 0, 15, 0.3);
}

.step-nav-item.completed .step-nav-number {
  background: var(--eneco-green);
  color: var(--eneco-text-light);
}

.step-nav-content {
  padding-top: 6px;
}

.step-nav-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--eneco-text-secondary);
  transition: color var(--transition-fast);
}

.step-nav-item.active .step-nav-label {
  color: var(--eneco-text-primary);
}

.step-nav-item.completed .step-nav-label {
  color: var(--eneco-green);
}

.step-nav-desc {
  font-size: 0.8rem;
  color: var(--eneco-text-secondary);
  margin-top: 2px;
  opacity: 0.7;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.builder-main {
  padding: var(--space-2xl) var(--space-3xl);
  overflow-y: auto;
  max-height: calc(100vh - 72px);
}

.builder-step {
  display: none;
  animation: stepFadeIn 0.4s ease;
}

.builder-step.active {
  display: block;
}

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

.builder-step-header {
  margin-bottom: var(--space-2xl);
}

.builder-step-header h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.builder-step-header p {
  font-size: 0.95rem;
}

/* ==========================================================================
   Step 1: Project Type Cards
   ========================================================================== */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.type-card {
  background: var(--eneco-white);
  border: 2px solid #E0DCD7;
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--eneco-gradient);
  z-index: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.type-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius-lg) - 2px);
  background: var(--eneco-white);
  z-index: 0;
}

.type-card > * {
  position: relative;
  z-index: 1;
}

.type-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.type-card:hover::before {
  opacity: 1;
}

.type-card.selected {
  border-color: transparent;
}

.type-card.selected::before {
  opacity: 1;
}

.type-card.selected::after {
  background: linear-gradient(135deg, rgba(227,0,15,0.03) 0%, rgba(255,107,0,0.03) 100%);
}

.type-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--eneco-light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  transition: all var(--transition-base);
}

.type-card.selected .type-card-icon {
  background: var(--eneco-gradient);
}

.type-card-icon svg {
  width: 32px;
  height: 32px;
  transition: all var(--transition-base);
}

.type-card.selected .type-card-icon svg {
  stroke: white;
  fill: none;
}

.type-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.type-card p {
  font-size: 0.85rem;
  color: var(--eneco-text-secondary);
  margin: 0 auto;
}

.type-card-check {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--eneco-green);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-spring);
}

.type-card.selected .type-card-check {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Step 2: Form
   ========================================================================== */
.builder-form {
  max-width: 600px;
}

.builder-form .form-group {
  margin-bottom: var(--space-xl);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* ==========================================================================
   Step 3: Sections Checkboxes
   ========================================================================== */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.section-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--eneco-white);
  border: 1px solid #E0DCD7;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.section-toggle:hover {
  border-color: var(--eneco-red);
  background: rgba(227, 0, 15, 0.02);
}

.section-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--eneco-red);
  cursor: pointer;
  flex-shrink: 0;
}

.section-toggle-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.section-toggle-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--eneco-warm-gray);
  color: var(--eneco-text-secondary);
}

.section-toggle-badge--special {
  background: rgba(255, 107, 0, 0.1);
  color: var(--eneco-orange);
}

/* ==========================================================================
   Step 4: Generate
   ========================================================================== */
.generate-preview {
  background: var(--eneco-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.generate-preview h3 {
  margin-bottom: var(--space-md);
}

.generate-preview p {
  margin: 0 auto var(--space-xl);
}

.generate-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  text-align: left;
}

.summary-item {
  padding: var(--space-md);
  background: var(--eneco-light-bg);
  border-radius: var(--radius-md);
}

.summary-item-label {
  font-size: 0.8rem;
  color: var(--eneco-text-secondary);
  font-weight: 500;
}

.summary-item-value {
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 2px;
}

/* ==========================================================================
   Step Navigation Buttons
   ========================================================================== */
.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid #E0DCD7;
}

.step-actions .btn--ghost {
  color: var(--eneco-text-secondary);
}

/* ==========================================================================
   Preview Panel
   ========================================================================== */
.builder-preview {
  background: var(--eneco-charcoal);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding: var(--space-lg);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

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

.preview-header h4 {
  color: var(--eneco-text-light);
  font-size: 0.85rem;
  font-weight: 600;
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.preview-dot--red { background: #FF5F57; }
.preview-dot--yellow { background: #FFBD2E; }
.preview-dot--green { background: #28CA42; }

.preview-frame {
  flex: 1;
  background: var(--eneco-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.preview-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 0;
  transform-origin: top left;
}

/* Mini preview elements */
.mini-hero {
  position: relative;
  padding: var(--space-2xl) var(--space-lg);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.mini-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.mini-hero > * {
  position: relative;
  z-index: 1;
}

.mini-hero--wind .mini-hero-bg {
  background: linear-gradient(135deg, #1a2a3e 0%, #0a1a2e 100%);
}

.mini-hero--zon .mini-hero-bg {
  background: linear-gradient(135deg, #2e1a0a 0%, #1a1a2e 100%);
}

.mini-hero--warmte .mini-hero-bg {
  background: linear-gradient(135deg, #2e0a0a 0%, #1a1a2e 100%);
}

.mini-hero--laad .mini-hero-bg {
  background: linear-gradient(135deg, #0a1a2e 0%, #0a2e1a 100%);
}

.mini-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
}

.mini-logo {
  font-size: 0.6rem;
  font-weight: 800;
  color: white;
}

.mini-hero h5 {
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.mini-hero p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.6rem;
  margin: 0;
}

.mini-section {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid #E0DCD7;
}

.mini-section h6 {
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--eneco-text-primary);
}

.mini-section p {
  font-size: 0.55rem;
  color: var(--eneco-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.mini-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: var(--space-md);
  background: var(--eneco-gradient);
  text-align: center;
}

.mini-fact {
  padding: var(--space-sm);
}

.mini-fact-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
}

.mini-fact-label {
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
}

.mini-timeline {
  padding: var(--space-md);
}

.mini-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.55rem;
}

.mini-timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E0DCD7;
  flex-shrink: 0;
  margin-top: 3px;
}

.mini-timeline-dot--active {
  background: var(--eneco-red);
}

.mini-timeline-dot--completed {
  background: var(--eneco-green);
}

.mini-footer {
  background: var(--eneco-dark);
  padding: var(--space-md);
}

.mini-footer p {
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  text-align: center;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--eneco-text-secondary);
  text-align: center;
  padding: var(--space-xl);
}

.preview-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-md);
}

.preview-empty p {
  font-size: 0.85rem;
  margin: 0;
}

/* ==========================================================================
   Builder Header
   ========================================================================== */
.builder-header .header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.builder-header .header-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--eneco-text-secondary);
}

.builder-header .header-title span {
  color: var(--eneco-text-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .builder-layout {
    grid-template-columns: 240px 1fr 360px;
  }
}

@media (max-width: 1024px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #E0DCD7;
    padding: var(--space-lg);
  }

  .steps-nav {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
  }

  .steps-nav::before {
    display: none;
  }

  .step-nav-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
    padding: var(--space-sm);
  }

  .step-nav-desc {
    display: none;
  }

  .builder-main {
    max-height: none;
    padding: var(--space-xl);
  }

  .builder-preview {
    position: static;
    height: 500px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
}

@media (max-width: 768px) {
  .type-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .generate-summary {
    grid-template-columns: 1fr;
  }

  .builder-preview {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .builder-main {
    padding: var(--space-md);
  }

  .step-actions {
    flex-direction: column;
    gap: var(--space-md);
  }

  .step-actions .btn {
    width: 100%;
  }
}
