/* ==========================================================================
   Real Estate Calculator Stylesheet - Exact Pixel Matching
   Clone of Reference Image with Real Estate Financing & Fraction Engine
   ========================================================================== */

.rec-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 15px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

/* Top Breadcrumbs & Utility Bar */
.rec-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.rec-breadcrumbs {
  color: #0844a4;
}

.rec-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

.rec-breadcrumbs a:hover {
  text-decoration: underline;
}

.rec-breadcrumbs .sep {
  color: #777777;
  margin: 0 4px;
}

.rec-breadcrumbs .current {
  color: #333333;
}

.rec-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rec-top-btn {
  background: none;
  border: none;
  color: #0844a4;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}

.rec-top-btn:hover {
  color: #002277;
}

/* Page Titles */
.rec-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 6px 0;
}

.rec-sec-heading {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 8px 0;
}

.rec-intro-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #333333;
  margin: 0 0 16px 0;
}

/* Main Grid Layout */
.rec-main-grid {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 24px;
  align-items: start;
  margin-bottom: 30px;
}

/* ==========================================================================
   REFERENCE IMAGE EXACT CLONE: Real Estate Calculator Modal / Card Box
   ========================================================================== */
.rec-clone-card {
  background: #ffffff;
  border: 1px solid #7ba2cf;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.rec-clone-header {
  background: #205486;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rec-clone-title {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.2px;
}

.rec-clone-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.rec-clone-close:hover {
  opacity: 1;
}

.rec-clone-body {
  padding: 16px 20px 22px;
}

.rec-clone-subtext {
  font-size: 13.5px;
  color: #555555;
  margin-bottom: 16px;
  line-height: 1.4;
}

.rec-field-group {
  margin-bottom: 16px;
}

.rec-field-label {
  display: block;
  font-size: 13.5px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 6px;
}

.rec-field-input {
  width: 100%;
  height: 35px;
  border: 1px solid #7ba2cf;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 14px;
  color: #222222;
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rec-field-input:focus {
  border-color: #205486;
  box-shadow: 0 0 0 2px rgba(32, 84, 134, 0.2);
}

.rec-btn-compute {
  background: #205486;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #163f66;
  border-radius: 4px;
  padding: 9px 20px;
  cursor: pointer;
  display: inline-block;
  margin-top: 6px;
  transition: background-color 0.15s ease;
}

.rec-btn-compute:hover {
  background: #18436c;
}

.rec-btn-compute:active {
  background: #113454;
}

/* Collapsible Advanced Options */
.rec-adv-toggle-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d5e0ee;
}

.rec-adv-toggle-btn {
  background: none;
  border: none;
  color: #0844a4;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rec-adv-toggle-btn:hover {
  text-decoration: underline;
}

.rec-adv-panel {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-top: 14px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.rec-adv-panel.open {
  display: grid;
}

/* ==========================================================================
   RESULTS ANALYSIS SECTION
   ========================================================================== */
.rec-results-box {
  background: #f1f6fa;
  border: 1px solid #bdd2e6;
  border-radius: 4px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.rec-results-header {
  margin-bottom: 14px;
  border-bottom: 1px solid #d5e4f2;
  padding-bottom: 10px;
}

.rec-results-title {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 4px;
}

.rec-results-subtitle {
  font-size: 12.5px;
  color: #555555;
}

.rec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.rec-kpi-card {
  background: #ffffff;
  border: 1px solid #c9dbee;
  border-radius: 4px;
  padding: 12px 14px;
  text-align: left;
}

.rec-kpi-card.primary {
  background: #eef6ff;
  border-color: #93c5fd;
}

.rec-kpi-label {
  font-size: 12px;
  font-weight: bold;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.rec-kpi-val {
  font-size: 22px;
  font-weight: bold;
  color: #003366;
  line-height: 1.2;
}

.rec-kpi-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
}

/* Detailed Metrics Table */
.rec-metrics-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #d5e0ee;
  border-radius: 4px;
  margin-bottom: 18px;
  font-size: 13px;
}

.rec-metrics-table tr:nth-child(even) {
  background: #f8fafc;
}

.rec-metrics-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.rec-metrics-table td:first-child {
  color: #475569;
  font-weight: 500;
}

.rec-metrics-table td:last-child {
  text-align: right;
  font-weight: bold;
  color: #1e293b;
}

/* Action buttons below results */
.rec-results-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.rec-btn-action {
  background: #0844a4;
  color: #ffffff;
  border: 1px solid #063582;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease;
}

.rec-btn-action:hover {
  background: #002277;
}

/* ==========================================================================
   CHARTS & VISUALIZATIONS
   ========================================================================== */
.rec-charts-section {
  background: #ffffff;
  border: 1px solid #d5e0ee;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
}

.rec-chart-box {
  margin-bottom: 22px;
}

.rec-chart-box:last-child {
  margin-bottom: 0;
}

.rec-chart-title {
  font-size: 14px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-svg-wrap {
  width: 100%;
  overflow-x: auto;
  text-align: center;
}

/* Amortization Schedule Table */
.rec-amort-box {
  background: #ffffff;
  border: 1px solid #d5e0ee;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
}

.rec-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 14px;
}

.rec-tab-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: bold;
  color: #475569;
  cursor: pointer;
}

.rec-tab-btn.active {
  background: #ffffff;
  border-color: #003366;
  border-bottom: 2px solid #ffffff;
  color: #003366;
  margin-bottom: -2px;
}

.rec-table-wrap {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
}

.rec-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.rec-schedule-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: bold;
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 1;
}

.rec-schedule-table th:first-child {
  text-align: center;
}

.rec-schedule-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: right;
}

.rec-schedule-table td:first-child {
  text-align: center;
  font-weight: bold;
  color: #475569;
}

.rec-schedule-table tr:hover {
  background: #f8fafc;
}

/* ==========================================================================
   CORE REQUIREMENT 1 & 5: FRACTION ARITHMETIC TOOL FOR REAL ESTATE EQUITY
   ========================================================================== */
.rec-fraction-card {
  background: #ffffff;
  border: 1px solid #9bb5cf;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.rec-frac-title {
  font-size: 17px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 4px;
}

.rec-frac-desc {
  font-size: 12.5px;
  color: #555555;
  margin-bottom: 14px;
  line-height: 1.45;
}

.rec-frac-inputs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.rec-frac-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
}

.rec-frac-input {
  width: 75px;
  height: 32px;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  border: 1px solid #7ba2cf;
  border-radius: 3px;
  color: #003366;
}

.rec-frac-line {
  width: 75px;
  height: 2px;
  background: #334155;
  margin: 4px 0;
}

.rec-frac-op-select {
  height: 36px;
  font-size: 18px;
  font-weight: bold;
  padding: 2px 8px;
  border: 1px solid #7ba2cf;
  border-radius: 3px;
  color: #003366;
  background: #ffffff;
  cursor: pointer;
}

.rec-frac-equal {
  font-size: 22px;
  font-weight: bold;
  color: #334155;
}

.rec-frac-results {
  background: #eef6ff;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.rec-frac-res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  text-align: center;
}

.rec-frac-res-item {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 8px 10px;
  border-radius: 4px;
}

.rec-frac-res-label {
  font-size: 11px;
  font-weight: bold;
  color: #475569;
  margin-bottom: 3px;
}

.rec-frac-res-val {
  font-size: 17px;
  font-weight: bold;
  color: #0844a4;
}

.rec-frac-step-box {
  margin-top: 10px;
  font-size: 12.5px;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  border-radius: 4px;
  line-height: 1.4;
}

/* Fraction Charts Grid */
.rec-frac-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  text-align: center;
}

.rec-frac-chart-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 8px;
}

.rec-frac-chart-label {
  font-size: 11.5px;
  font-weight: bold;
  color: #475569;
  margin-bottom: 6px;
}

/* Number line */
.rec-number-line-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 14px;
  text-align: center;
}

/* ==========================================================================
   SEO / AEO / GEO CONTENT SECTION
   ========================================================================== */
.rec-content-section {
  line-height: 1.6;
  font-size: 13.5px;
  color: #333333;
  margin-top: 30px;
}

.rec-content-section h2 {
  font-size: 20px;
  font-weight: bold;
  color: #003366;
  margin: 22px 0 10px 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.rec-content-section h3 {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 16px 0 8px 0;
}

.rec-content-section p {
  margin-bottom: 12px;
}

.rec-content-section ul,
.rec-content-section ol {
  margin: 0 0 16px 24px;
}

.rec-content-section li {
  margin-bottom: 6px;
}

.rec-formula-box {
  background: #f8fafc;
  border-left: 4px solid #003366;
  padding: 10px 14px;
  margin: 14px 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  color: #1e293b;
}

/* FAQ Section */
.rec-faq-item {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}

.rec-faq-question {
  width: 100%;
  background: #f1f5f9;
  border: none;
  text-align: left;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: bold;
  color: #003366;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rec-faq-question:hover {
  background: #e2e8f0;
}

.rec-faq-answer {
  display: none;
  padding: 12px 14px;
  font-size: 13px;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
  line-height: 1.5;
}

.rec-faq-item.open .rec-faq-answer {
  display: block;
}

/* ==========================================================================
   SIDEBAR (RIGHT COLUMN)
   ========================================================================== */
.rec-sidebar-col {
  width: 100%;
}

.rec-side-search-form {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.rec-side-search-wrap {
  flex: 1;
  position: relative;
}

.rec-side-search-input {
  width: 100%;
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #7ba2cf;
  border-radius: 3px;
  outline: none;
}

.rec-side-search-input:focus {
  border-color: #205486;
}

.rec-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
}

.rec-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #0844a4;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
}

.rec-search-item:hover {
  background: #f1f5f9;
  text-decoration: underline;
}

.rec-search-cat {
  font-size: 10.5px;
  color: #64748b;
  text-transform: uppercase;
}

.rec-side-search-btn {
  background: #205486;
  color: #ffffff;
  border: 1px solid #163f66;
  border-radius: 3px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.rec-side-card {
  border: 1px solid #c9dbee;
  border-radius: 4px;
  background: #ffffff;
  margin-bottom: 20px;
  overflow: hidden;
}

.rec-side-card-title {
  background: #205486;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 7px 10px;
}

.rec-side-list {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}

.rec-side-list li {
  border-bottom: 1px solid #f1f5f9;
}

.rec-side-list li:last-child {
  border-bottom: none;
}

.rec-side-list a {
  display: block;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #0844a4;
  text-decoration: none;
}

.rec-side-list a:hover {
  background: #f1f5f9;
  text-decoration: underline;
}

.rec-side-list li.active a {
  font-weight: bold;
  color: #003366;
  background: #e9f0f8;
}

/* ==========================================================================
   MODALS (PRINT & SAVE / HISTORY)
   ========================================================================== */
.rec-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.rec-modal-card {
  background: #ffffff;
  border-radius: 6px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.rec-modal-header {
  background: #003366;
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rec-modal-title {
  font-size: 16px;
  font-weight: bold;
}

.rec-modal-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

.rec-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.rec-modal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rec-btn-sec {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  color: #334155;
}

.rec-btn-sec:hover {
  background: #f1f5f9;
}

.rec-print-sheet {
  border: 1px solid #e2e8f0;
  padding: 16px;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.5;
}

/* Print Specific Media Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .site-header,
  .site-footer,
  .rec-top-bar,
  .rec-sidebar-col,
  .rec-modal-actions,
  .rec-modal-close-btn,
  .rec-btn-compute,
  .rec-results-actions,
  .rec-adv-toggle-wrap,
  .rec-tabs {
    display: none !important;
  }

  .rec-main-grid {
    display: block !important;
  }

  .rec-clone-card,
  .rec-results-box,
  .rec-charts-section,
  .rec-amort-box,
  .rec-fraction-card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  body.rec-printing-modal .rec-modal-overlay {
    position: static !important;
    display: block !important;
    background: none !important;
    padding: 0 !important;
  }

  body.rec-printing-modal .rec-modal-card {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.rec-printing-modal .rec-modal-body {
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.rec-printing-modal .rec-print-sheet {
    display: block !important;
    width: 100% !important;
    border: none !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.rec-printing-modal #main-content {
    display: none !important;
  }
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .rec-main-grid {
    grid-template-columns: 1fr;
  }

  .rec-adv-panel {
    grid-template-columns: 1fr;
  }

  .rec-frac-charts-grid {
    grid-template-columns: 1fr;
  }
}
