/* Pricing Engine Styles - Clean, User-Friendly Design */

/* ================================
   PRICING ENGINE LAYOUT
   ================================ */

.pricing-engine-wrapper {
  max-width: 1200px;
}

/* Quick Start Guide */
.pricing-guide {
  background: linear-gradient(135deg, rgba(242, 11, 15, 0.1) 0%, rgba(242, 11, 15, 0.05) 100%);
  border: 1px solid rgba(242, 11, 15, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.pricing-guide-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pricing-guide-header svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.pricing-guide-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.pricing-guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.guide-step-num {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.guide-step-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

/* Pricing Navigation */
.pricing-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.pricing-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.pricing-nav-item:hover {
  background: var(--surface-light);
  color: var(--text);
}

.pricing-nav-item.active {
  background: var(--primary);
  color: white;
}

.pricing-nav-item svg {
  width: 18px;
  height: 18px;
}

/* Panel */
.pricing-panel {
  display: none;
}

.pricing-panel.active {
  display: block;
}

/* Section Card */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.section-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.section-card-header .header-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: normal;
}

.section-card-body {
  padding: 1.5rem;
}

/* Info Box */
.info-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(242, 11, 15, 0.08);
  border: 1px solid rgba(242, 11, 15, 0.2);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.info-box svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.info-box p {
  font-size: 0.875rem;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

/* ================================
   PRICING TABLE
   ================================ */

.pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.pricing-table th {
  text-align: left;
  padding: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--background);
  border-bottom: 2px solid var(--border);
}

.pricing-table th:first-child {
  padding-left: 0;
}

.pricing-table td {
  padding: 0.625rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.pricing-table td:first-child {
  padding-left: 0;
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table .item-name {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}

.pricing-input {
  width: 85px;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  text-align: right;
}

.pricing-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(242, 11, 15, 0.1);
}

.pricing-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.pricing-input.text-left {
  text-align: left;
}

.pricing-input.wider {
  width: 110px;
}

.input-with-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.input-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Column styling */
.col-material { }
.col-margin { background: rgba(0,0,0,0.02); }
.col-labor { }
.col-labor-margin { background: rgba(0,0,0,0.02); }
.col-color { background: rgba(242, 11, 15, 0.03); }
.col-color-margin { background: rgba(242, 11, 15, 0.05); }

/* ================================
   TIER BUILDER
   ================================ */

.tier-section {
  margin-bottom: 2rem;
}

.tier-section:last-child {
  margin-bottom: 0;
}

.tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tier-header h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.unit-toggle {
  display: inline-flex;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.unit-toggle-option {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.unit-toggle-option:hover {
  color: var(--text);
}

.unit-toggle-option.active {
  background: var(--primary);
  color: white;
}

.tier-labels {
  display: grid;
  grid-template-columns: 170px repeat(4, 1fr) 36px;
  gap: 0.5rem;
  padding: 0 0.75rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.tier-row {
  display: grid;
  grid-template-columns: 170px repeat(4, 1fr) 36px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}

.tier-row:hover {
  border-color: var(--text-muted);
}

.tier-range {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.tier-range input {
  width: 60px;
}

.tier-range .sep {
  color: var(--text-muted);
  font-weight: 500;
}

.tier-range .unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tier-cell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.tier-cell-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  display: none;
}

.tier-delete {
  display: flex;
  justify-content: center;
}

.tier-delete button {
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.4;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.tier-delete button:hover {
  opacity: 1;
  background: var(--error);
  color: white;
}

.add-tier-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.add-tier-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.add-tier-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.add-tier-btn svg {
  width: 16px;
  height: 16px;
}

/* ================================
   INSULATION SLOTS
   ================================ */

.insulation-slot {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.insulation-slot:last-child {
  margin-bottom: 0;
}

.insulation-slot-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.insulation-fields {
  display: grid;
  grid-template-columns: 90px 130px repeat(4, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.insulation-field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.insulation-field input {
  width: 100%;
}

/* ================================
   CHECKBOX OPTIONS
   ================================ */

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checkbox-option span {
  font-size: 0.9rem;
}

/* ================================
   FOOTINGS DIMENSIONS
   ================================ */

.dimension-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dimension-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.dimension-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dimension-input input {
  width: 80px;
}

.dimension-input .unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ================================
   ACTION BAR
   ================================ */

.pricing-action-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.unsaved-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(250, 204, 21, 0.15);
  border-radius: 6px;
  color: #facc15;
  font-size: 0.85rem;
  font-weight: 500;
}

.unsaved-badge.hidden {
  display: none;
}

.unsaved-badge svg {
  width: 14px;
  height: 14px;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--border);
}

.btn-copy svg {
  width: 16px;
  height: 16px;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {
  .tier-labels {
    display: none;
  }
  
  .tier-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .tier-range {
    grid-column: span 2;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }
  
  .tier-cell-label {
    display: block;
  }
  
  .tier-delete {
    grid-column: span 2;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
  
  .insulation-fields {
    grid-template-columns: 1fr 1fr;
  }
  
  .pricing-guide-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pricing-nav {
    flex-wrap: nowrap;
    padding: 0.375rem;
  }
  
  .pricing-nav-item {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
  
  .pricing-nav-item svg {
    display: none;
  }
  
  .pricing-action-bar {
    flex-direction: column;
    gap: 1rem;
  }
  
  .action-bar-left {
    width: 100%;
    justify-content: center;
  }
  
  .action-bar-right {
    width: 100%;
    flex-direction: column;
  }
  
  .action-bar-right button {
    width: 100%;
    justify-content: center;
  }
  
  .pricing-table {
    font-size: 0.85rem;
  }
  
  .pricing-input {
    width: 70px;
    padding: 0.375rem 0.5rem;
  }
}

@media (max-width: 640px) {
  .section-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .dimension-row {
    flex-direction: column;
    gap: 1rem;
  }
}
