/* ──────────────────────────────────────────────
   Montana Real Estate — Report Styles
   Print-optimized + PDF-ready styling
   ────────────────────────────────────────────── */

/* ── Report Container ── */
.report {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1A1A1A;
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
}

/* ── Cover / Header ── */
.report-header {
  background: linear-gradient(135deg, #5B7B5E 0%, #3B6B8A 100%);
  color: #fff;
  padding: 2rem 2.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.report-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.01em;
}

.report-header .subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0 0 1rem 0;
}

.report-header .header-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.report-header .stat {
  display: flex;
  flex-direction: column;
}

.report-header .stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.report-header .stat-value {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── Section Titles ── */
.report-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #3B6B8A;
  border-bottom: 2px solid #E0DCD5;
  padding-bottom: 0.4rem;
  margin: 1.75rem 0 1rem 0;
  letter-spacing: -0.01em;
}

.report-section-title .section-icon {
  margin-right: 0.5rem;
}

/* ── Key-Value Rows ── */
.report-kv {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #F3F0EB;
  font-size: 0.85rem;
}

.report-kv:last-child {
  border-bottom: none;
}

.report-kv .kv-label {
  color: #4A4A4A;
  font-weight: 500;
}

.report-kv .kv-value {
  color: #1A1A1A;
  font-weight: 600;
  text-align: right;
  max-width: 55%;
}

/* ── Data Tables ── */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 0.75rem 0;
}

.report-table th {
  background: #F3F0EB;
  color: #4A4A4A;
  font-weight: 600;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid #E0DCD5;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.report-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #F3F0EB;
  vertical-align: top;
}

.report-table tr:nth-child(even) {
  background: #FAFAF8;
}

.report-table tr:hover {
  background: #F3F0EB;
}

.report-table .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
}

.report-table a {
  color: #3B6B8A;
  text-decoration: none;
}

.report-table a:hover {
  text-decoration: underline;
}

/* ── Risk Flags ── */
.report-risk-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 4px solid;
}

.report-risk-card.severity-high {
  background: #FEF2F2;
  border-left-color: #DC2626;
}

.report-risk-card.severity-medium {
  background: #FFFBEB;
  border-left-color: #F59E0B;
}

.report-risk-card.severity-low {
  background: #EFF6FF;
  border-left-color: #3B82F6;
}

.report-risk-card .risk-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.report-risk-card .risk-body {
  flex: 1;
}

.report-risk-card .risk-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.report-risk-card .risk-severity {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
}

.severity-high .risk-severity { background: #DC2626; color: #fff; }
.severity-medium .risk-severity { background: #F59E0B; color: #fff; }
.severity-low .risk-severity { background: #3B82F6; color: #fff; }

.report-risk-card .risk-desc {
  font-size: 0.8rem;
  color: #4A4A4A;
  margin-top: 0.25rem;
}

.report-risk-card .risk-impact {
  font-size: 0.75rem;
  color: #6B7280;
  margin-top: 0.2rem;
  font-style: italic;
}

.risk-clear-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.risk-clear-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #22C55E;
  background: #F0FDF4;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

/* ── Charts ── */
.report-chart-container {
  margin: 1rem 0;
  text-align: center;
}

.report-chart-container svg {
  max-width: 100%;
  height: auto;
}

/* ── Water Rights Summary ── */
.wr-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.wr-summary-card {
  background: #FAF8F5;
  padding: 0.75rem;
  border-radius: 6px;
  text-align: center;
}

.wr-summary-card .wr-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #3B6B8A;
}

.wr-summary-card .wr-label {
  font-size: 0.65rem;
  color: #9A9A9A;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* ── Flood Zone ── */
.flood-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 6px;
  margin: 0.5rem 0;
}

.flood-status.in-floodplain {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.flood-status.not-in-floodplain {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.flood-status .flood-icon {
  font-size: 1.5rem;
}

.flood-status .flood-text {
  font-size: 0.85rem;
}

.flood-status .flood-text strong {
  display: block;
  margin-bottom: 0.15rem;
}

/* ── Talking Points (Seller Report) ── */
.talking-points {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.talking-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #F3F0EB;
  font-size: 0.85rem;
}

.talking-points li:last-child {
  border-bottom: none;
}

.talking-points .tp-icon {
  color: #5B7B5E;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ── Due Diligence Checklist (Agent Report) ── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #F3F0EB;
  font-size: 0.8rem;
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist .check-box {
  width: 14px;
  height: 14px;
  border: 2px solid #E0DCD5;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* ── Agent Branding ── */
.agent-branding {
  background: #FAF8F5;
  border: 1px solid #E0DCD5;
  border-radius: 6px;
  padding: 1rem 1.5rem;
  text-align: center;
  margin: 1rem 0;
}

.agent-branding .agent-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3B6B8A;
}

.agent-branding .agent-brokerage {
  font-size: 0.8rem;
  color: #9A9A9A;
  margin-top: 0.15rem;
}

/* ── Report Footer ── */
.report-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid #E0DCD5;
  font-size: 0.65rem;
  color: #9A9A9A;
  text-align: center;
}

.report-footer .disclaimer {
  margin-top: 0.5rem;
  font-style: italic;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Print / PDF Optimizations ── */
.page-break {
  page-break-before: always;
  break-before: page;
}

@media print {
  .report {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .report-header {
    border-radius: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-risk-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .flood-status {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table tr:nth-child(even) {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wr-summary-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .risk-clear-item {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Avoid breaking inside elements */
  .report-risk-card,
  .report-kv,
  .wr-summary-card,
  .flood-status,
  .checklist li {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Ensure tables don't orphan headers */
  .report-table thead {
    display: table-header-group;
  }

  .report-table tr {
    page-break-inside: avoid;
  }
}

/* ── Payment Modal Styles ── */
.payment-info {
  text-align: center;
}

.payment-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.payment-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--mre-sage);
  margin: 0.5rem 0;
}

.payment-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto 1.25rem auto;
}

.payment-features {
  text-align: left;
  max-width: 300px;
  margin: 0 auto 1.5rem auto;
}

.payment-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
}

.payment-feature .icon {
  color: var(--mre-sage);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.paypal-buttons {
  max-width: 350px;
  margin: 0 auto;
}

.paypal-placeholder {
  border: 2px dashed var(--bg-3);
  border-radius: 8px;
  margin: 0.5rem 0;
}

.payment-notice {
  margin-top: 1rem;
}

.payment-notice p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Spin Animation ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.icon.spin {
  animation: spin 1s linear infinite;
}

/* ── Responsive Report ── */
@media (max-width: 600px) {
  .report-header {
    padding: 1.25rem;
  }

  .report-header h1 {
    font-size: 1.2rem;
  }

  .report-header .header-stats {
    gap: 1rem;
  }

  .wr-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-kv {
    flex-direction: column;
    gap: 0.15rem;
  }

  .report-kv .kv-value {
    text-align: left;
    max-width: 100%;
  }

  .report-table {
    font-size: 0.65rem;
  }

  .report-table th,
  .report-table td {
    padding: 0.35rem 0.4rem;
  }
}
