/* ============================================================
   SUMMARY COMPONENTS - CSS STYLES
   Styles for materials list, labor breakdown, and investment summary
   ============================================================ */

/* ========================================
   SUMMARY CARDS
   ======================================== */

.summary-card {
  background: var(--nh-body-bg);
  border: 1px solid var(--nh-border-subtle);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.summary-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--nh-border-subtle);
  background: var(--nh-tier-card-bg);
}

.summary-card .card-title {
  font-size: 18px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.summary-card .card-subtitle {
  font-size: 13px;
  color: #9ca3af;
  margin: 4px 0 0 0;
}

.summary-card .card-header-actions {
  display: flex;
  gap: 8px;
}

/* ========================================
   MATERIALS TABLE
   ======================================== */

.materials-system-section {
  border-bottom: 1px solid var(--nh-border-subtle);
}

.materials-system-section:last-child {
  border-bottom: none;
}

.materials-system-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--nh-tier-card-bg);
  border-bottom: 1px solid var(--nh-border-subtle);
}

.materials-system-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.materials-system-header .system-total {
  font-size: 16px;
  font-weight: 600;
  color: #0ea5e9;
}

.materials-table {
  padding: 0;
}

.materials-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 0.5fr 1fr 1fr;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--nh-border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.materials-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 0.5fr 1fr 1fr;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--nh-border-subtle);
  font-size: 13px;
  color: #e5e7eb;
  align-items: center;
}

.materials-table-row:last-child {
  border-bottom: none;
}

.materials-table-row:hover {
  background: var(--nh-table-row-hover-bg);
}

/* Material Table Columns */
.mat-col-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mat-col-item .item-name {
  font-weight: 500;
  color: #f9fafb;
}

.mat-col-item .item-notes {
  font-size: 11px;
  color: #9ca3af;
  font-style: italic;
}

.mat-col-sku {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #9ca3af;
}

.mat-col-qty {
  text-align: center;
  font-weight: 600;
}

.mat-col-unit,
.mat-col-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mat-col-total {
  font-weight: 600;
  color: #f9fafb;
}

/* ========================================
   MATERIALS TOTALS
   ======================================== */

.materials-totals {
  padding: 20px 24px;
  background: var(--nh-tier-card-bg);
  border-top: 2px solid #374151;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.totals-row.subtotal {
  color: #9ca3af;
  border-bottom: 1px solid var(--nh-border-subtle);
}

.totals-row.subtotal:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #4b5563;
}

.totals-row.total {
  font-size: 18px;
  font-weight: 700;
  color: #f9fafb;
  padding-top: 12px;
}

.totals-row.total span:last-child {
  color: #0ea5e9;
}

/* ========================================
   INVESTMENT SUMMARY
   ======================================== */

.investment-summary {
}

.investment-breakdown {
  padding: 0;
}

.investment-section {
  border-bottom: 1px solid var(--nh-border-subtle);
  padding: 20px 24px;
}

.investment-section:last-child {
  border-bottom: none;
}

.investment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #e5e7eb;
}

.investment-row.section-header {
  font-size: 15px;
  font-weight: 600;
  color: #f9fafb;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nh-border-subtle);
  margin-bottom: 8px;
}

.investment-row.section-header .subscription-note {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
}

.investment-row.detail {
  font-size: 13px;
  color: #9ca3af;
  padding: 6px 0;
}

.investment-row.grand-total {
  font-size: 24px;
  font-weight: 700;
  color: #f9fafb;
  padding: 16px 0;
  margin: 8px 0;
}

.investment-row.grand-total span:last-child {
  color: #0ea5e9;
}

/* ========================================
   SUBSCRIPTION OPTIONS
   ======================================== */

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.subscription-card {
  background: #1f2937;
  border: 1px solid var(--nh-border-subtle);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  position: relative;
  transition: all 0.2s;
}

.subscription-card:hover {
  border-color: #0ea5e9;
  transform: translateY(-2px);
}

.subscription-card.recommended {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #1e3a8a 0%, #1f2937 100%);
}

.subscription-card.best-value {
  border-color: #10b981;
  background: linear-gradient(135deg, #064e3b 0%, #1f2937 100%);
}

.sub-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #0ea5e9;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-card.best-value .sub-badge {
  background: #10b981;
}

.sub-period {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sub-price {
  font-size: 24px;
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 4px;
}

.sub-unit {
  font-size: 14px;
  font-weight: 400;
  color: #9ca3af;
}

.sub-total {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.sub-savings {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--nh-border-subtle);
}

/* ========================================
   PAYMENT OPTIONS
   ======================================== */

.payment-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.payment-option {
  border: 1px solid var(--nh-border-subtle);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.payment-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.payment-amount {
  font-size: 28px;
  font-weight: 700;
  color: #0ea5e9;
  margin-bottom: 8px;
}

.payment-note {
  font-size: 11px;
  color: #9ca3af;
}

/* ========================================
   PROJECT DETAILS
   ======================================== */

.project-details {
  background: var(--nh-tier-card-bg);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--nh-border-subtle);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #9ca3af;
  font-weight: 500;
}

.detail-value {
  color: #f9fafb;
  font-weight: 600;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .summary-card {
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  .materials-system-section {
    page-break-inside: avoid;
  }

  .investment-summary {
    background: #fff;
    color: #000;
  }

  .no-print {
    display: none !important;
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .materials-table-header,
  .materials-table-row {
    grid-template-columns: 2fr 0.8fr 0.5fr 0.8fr 0.8fr;
    gap: 8px;
    padding: 12px 16px;
    font-size: 11px;
  }

  .mat-col-sku {
    font-size: 10px;
  }

  .subscription-grid {
    grid-template-columns: 1fr;
  }

  .payment-options {
    grid-template-columns: 1fr;
  }

  .payment-amount {
    font-size: 24px;
  }

  .investment-row.grand-total {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .materials-table-header {
    display: none;
  }

  .materials-table-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
  }

  .mat-col-item,
  .mat-col-sku,
  .mat-col-qty,
  .mat-col-unit,
  .mat-col-total {
    text-align: left;
  }

  .mat-col-sku::before {
    content: 'SKU: ';
    font-weight: 600;
  }

  .mat-col-qty::before {
    content: 'Qty: ';
    font-weight: 600;
  }

  .mat-col-unit::before {
    content: 'Unit: ';
    font-weight: 600;
  }

  .mat-col-total {
    font-size: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--nh-border-subtle);
  }

  .mat-col-total::before {
    content: 'Total: ';
    font-weight: 400;
    color: #9ca3af;
  }
}
