/* Rent vs. Buy Calculator Styles - Calculator Archive Exact Clone */

:root {
  --rvb-navy: #1b365d;
  --rvb-blue-header: #2b6cb0;
  --rvb-blue-header-dark: #1e4b7a;
  --rvb-blue-link: #0844a4;
  --rvb-blue-link-hover: #002277;
  --rvb-green-result: #4a7c33;
  --rvb-green-btn: #449d44;
  --rvb-green-btn-hover: #398439;
  --rvb-gray-btn: #94a3b8;
  --rvb-gray-btn-hover: #64748b;
  --rvb-border: #cbd5e1;
  --rvb-border-dark: #94a3b8;
  --rvb-bg-light: #f8fafc;
  --rvb-bg-alt: #f1f5f9;
  --rvb-text: #333333;
  --rvb-text-dark: #0f172a;
  --rvb-line-buy: #2b6cb0;
  --rvb-line-rent: #7fb800;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--rvb-text);
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.rvb-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

/* Breadcrumbs Row */
.rvb-breadcrumbs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rvb-breadcrumbs {
  font-size: 13px;
  color: var(--rvb-blue-link);
}
.rvb-breadcrumbs a {
  color: var(--rvb-blue-link);
  text-decoration: none;
}
.rvb-breadcrumbs a:hover {
  text-decoration: underline;
}
.rvb-breadcrumbs span {
  color: #777777;
  margin: 0 4px;
}
.rvb-breadcrumbs .crumb-current {
  color: #333333;
}

/* Top Actions */
.rvb-top-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rvb-top-link-btn {
  background: none;
  border: none;
  color: var(--rvb-blue-link);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rvb-top-link-btn:hover {
  color: var(--rvb-blue-link-hover);
}

/* Page Title */
.rvb-main-title {
  font-size: 24px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 2px 0;
  line-height: 1.25;
}

.rvb-intro-desc {
  font-size: 13px;
  color: #475569;
  margin: 0 0 10px 0;
  line-height: 1.45;
}

/* Content Layout Grid */
.rvb-content-grid {
  display: flex;
  flex-direction: row;
  gap: 22px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.rvb-main-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rvb-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Form Section: 2 Columns of Input Panels */
.rvb-form-section {
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  flex-wrap: wrap;
}

.rvb-form-col-left {
  flex: 1 1 340px;
  min-width: 300px;
}

.rvb-form-col-right {
  flex: 1 1 340px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Form Panel Card */
.rvb-panel-card {
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  background-color: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.rvb-panel-header {
  background-color: var(--rvb-blue-header);
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  padding: 6px 10px;
  margin: 0;
}

.rvb-table-form {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rvb-table-form tr {
  border-bottom: 1px solid #f1f5f9;
}
.rvb-table-form tr:last-child {
  border-bottom: none;
}

.rvb-table-form td {
  padding: 5px 8px;
  vertical-align: middle;
}

.rvb-td-label {
  color: #334155;
  white-space: nowrap;
  font-size: 12.5px;
  width: 55%;
}

.rvb-td-input {
  width: 45%;
}

.rvb-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #94a3b8;
  background-color: #ffffff;
  border-radius: 2px;
  overflow: hidden;
  height: 26px;
  box-sizing: border-box;
}

.rvb-prefix, .rvb-suffix {
  padding: 2px 5px;
  font-size: 12px;
  color: #475569;
  background-color: #f1f5f9;
  user-select: none;
  white-space: nowrap;
}
.rvb-prefix {
  border-right: 1px solid #cbd5e1;
}
.rvb-suffix {
  border-left: 1px solid #cbd5e1;
}

.rvb-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 2px 5px;
  font-size: 12.5px;
  text-align: right;
  background: transparent;
  color: #0f172a;
}
.rvb-input:focus {
  background-color: #f8fafc;
}

.rvb-select {
  width: 100%;
  height: 26px;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 12px;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
}

/* Action Buttons */
.rvb-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding: 6px 0;
}

.rvb-btn-calc {
  background-color: var(--rvb-green-btn);
  color: #ffffff;
  border: 1px solid #398439;
  font-size: 13.5px;
  font-weight: bold;
  padding: 6px 20px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease;
}
.rvb-btn-calc:hover {
  background-color: var(--rvb-green-btn-hover);
}

.rvb-btn-clear {
  background-color: #94a3b8;
  color: #ffffff;
  border: 1px solid #64748b;
  font-size: 13.5px;
  font-weight: bold;
  padding: 6px 18px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.rvb-btn-clear:hover {
  background-color: #64748b;
}

/* Result Section */
.rvb-result-section {
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  background-color: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rvb-result-header {
  background-color: var(--rvb-green-result);
  color: #ffffff;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rvb-result-title {
  font-size: 15px;
  font-weight: bold;
  margin: 0;
}

.rvb-save-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.95;
  padding: 2px 6px;
  border-radius: 2px;
}
.rvb-save-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.rvb-result-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Summary highlight text */
.rvb-summary-banner {
  font-size: 14.5px;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
}

.rvb-highlight-val {
  color: #15803d;
  font-weight: bold;
}

/* Chart Container */
.rvb-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: #ffffff;
  padding: 10px 0;
}

.rvb-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.rvb-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rvb-legend-box-buy {
  width: 14px;
  height: 14px;
  background-color: var(--rvb-line-buy);
}
.rvb-legend-box-rent {
  width: 14px;
  height: 14px;
  background-color: var(--rvb-line-rent);
}

.rvb-svg-chart {
  width: 100%;
  max-width: 580px;
  height: auto;
  overflow: visible;
}

/* 30-Year Table */
.rvb-table-intro {
  font-size: 13px;
  color: #334155;
  margin: 4px 0 0 0;
}

.rvb-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
}

.rvb-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: right;
}

.rvb-schedule-table th {
  background-color: var(--rvb-blue-header);
  color: #ffffff;
  padding: 6px 8px;
  font-weight: bold;
  border: 1px solid #1e4b7a;
  text-align: center;
}

.rvb-schedule-table th.sub-th {
  background-color: #245b95;
  font-weight: normal;
  font-size: 12px;
}

.rvb-schedule-table td {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.rvb-schedule-table td:first-child {
  text-align: center;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
}

.rvb-schedule-table tr:nth-child(even) {
  background-color: var(--rvb-bg-alt);
}

.rvb-schedule-table tr:hover {
  background-color: #e0f2fe;
}

.rvb-row-breakeven {
  background-color: #ecfdf5 !important;
  font-weight: bold;
}

/* Cumulative Cost Visualization Section */
.rvb-extra-chart-card {
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  background-color: #ffffff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rvb-extra-chart-title {
  font-size: 15px;
  font-weight: bold;
  color: #003366;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

/* Fraction Arithmetic Section */
.rvb-fraction-section {
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  background-color: #ffffff;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rvb-fraction-title {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.rvb-fraction-desc {
  font-size: 13px;
  color: #475569;
  margin: 0;
  line-height: 1.45;
}

.rvb-fraction-card {
  display: flex;
  flex-direction: row;
  gap: 18px;
  flex-wrap: wrap;
}

.rvb-fraction-form {
  flex: 1 1 270px;
  background-color: var(--rvb-bg-light);
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rvb-fraction-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rvb-frac-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rvb-frac-input {
  width: 52px;
  text-align: center;
  font-size: 13px;
  padding: 4px 2px;
  border: 1px solid #94a3b8;
  border-radius: 2px;
}

.rvb-frac-bar {
  width: 50px;
  height: 2px;
  background-color: #334155;
  margin: 2px 0;
}

.rvb-frac-op-select {
  padding: 5px 8px;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  background-color: #ffffff;
  cursor: pointer;
}

.rvb-fraction-results {
  flex: 1 1 290px;
  background-color: var(--rvb-bg-alt);
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rvb-frac-output-display {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
}

.rvb-frac-big-res {
  font-size: 22px;
  font-weight: bold;
  color: #1b365d;
}

.rvb-frac-dec-tag {
  background-color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 13px;
  color: #0f172a;
}

.rvb-frac-steps-box {
  background-color: #ffffff;
  border: 1px solid var(--rvb-border);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
}

/* Sidebar Styling */
.rvb-search-box-wrap {
  display: flex;
  gap: 4px;
  position: relative;
  width: 100%;
}

.rvb-search-input {
  flex: 1;
  border: 1px solid #a0aec0;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 2px;
  box-sizing: border-box;
}

.rvb-search-btn {
  background-color: #2b6cb0;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 2px;
  cursor: pointer;
}
.rvb-search-btn:hover {
  background-color: #1e4b7a;
}

.rvb-search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}
.rvb-search-results-dropdown.open {
  display: block;
}

.rvb-search-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #1e293b;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
}
.rvb-search-item:hover, .rvb-search-item.selected {
  background-color: #f1f5f9;
  color: #0844a4;
}

.rvb-search-item-cat {
  font-size: 11px;
  color: #64748b;
}

.rvb-links-card {
  border: 1px solid #2b6cb0;
  border-radius: 3px;
  background-color: #ffffff;
  overflow: hidden;
}

.rvb-links-header {
  background-color: #2b6cb0;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: bold;
}

.rvb-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px;
  gap: 5px 12px;
  font-size: 12.5px;
}

.rvb-links-grid a {
  color: #0844a4;
  text-decoration: underline;
}
.rvb-links-grid a:hover {
  color: #002277;
}

.rvb-more-links-row {
  grid-column: span 2;
  margin-top: 4px;
}

.rvb-links-footer {
  border-top: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 11.5px;
  color: #64748b;
  background-color: #f8fafc;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.rvb-links-footer a {
  color: #0844a4;
  text-decoration: none;
}
.rvb-links-footer a:hover {
  text-decoration: underline;
}

/* SEO & FAQ Section */
.rvb-seo-section {
  background-color: #ffffff;
  border-top: 2px solid #e2e8f0;
  padding-top: 20px;
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.rvb-seo-title {
  font-size: 20px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 10px 0;
}

.rvb-seo-subtitle {
  font-size: 16px;
  font-weight: bold;
  color: #1b365d;
  margin: 16px 0 6px 0;
}

.rvb-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.rvb-faq-item {
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  overflow: hidden;
}

.rvb-faq-question {
  background-color: #f8fafc;
  padding: 10px 14px;
  font-weight: bold;
  font-size: 13.5px;
  color: #1b365d;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.rvb-faq-question:hover {
  background-color: #f1f5f9;
}

.rvb-faq-answer {
  padding: 10px 14px;
  font-size: 13px;
  color: #334155;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: none;
  line-height: 1.5;
}
.rvb-faq-item.open .rvb-faq-answer {
  display: block;
}

/* Modals: Instant Tool, History, Print */
.rvb-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.rvb-modal-overlay.open {
  display: flex;
}

.rvb-modal-card {
  background-color: #ffffff;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rvb-instant-header {
  background-color: #2b6cb0;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rvb-instant-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

.rvb-modal-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.rvb-instant-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rvb-instant-subtitle {
  font-size: 13px;
  color: #475569;
  margin: 0;
}

.rvb-instant-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rvb-instant-label {
  font-size: 13px;
  font-weight: bold;
  color: #334155;
}

.rvb-instant-input {
  border: 1px solid #94a3b8;
  border-radius: 3px;
  padding: 7px 10px;
  font-size: 14px;
  outline: none;
}

.rvb-instant-btn {
  background-color: #1e4b7a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: bold;
  padding: 9px 18px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  align-self: flex-start;
}
.rvb-instant-btn:hover {
  background-color: #15385b;
}

.rvb-action-btn {
  background-color: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  padding: 7px 12px;
  border-radius: 3px;
  font-size: 12.5px;
  cursor: pointer;
}
.rvb-action-btn:hover {
  background-color: #e2e8f0;
}

.rvb-history-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rvb-history-item {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.rvb-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2000;
}
.rvb-toast.show {
  opacity: 1;
  visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .rvb-content-grid {
    flex-direction: column;
  }
  .rvb-sidebar {
    width: 100%;
    max-width: 100%;
  }
  .rvb-form-section {
    flex-direction: column;
  }
  .rvb-form-col-left, .rvb-form-col-right {
    width: 100%;
  }
}

/* Print styles */
@media print {
  body * {
    visibility: hidden;
  }
  .rvb-print-sheet, .rvb-print-sheet * {
    visibility: visible;
  }
  .rvb-print-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

body.rvb-printing-modal .rvb-modal-overlay#rvb-print-modal {
  background: #ffffff !important;
}
body.rvb-printing-modal .rvb-modal-card {
  box-shadow: none !important;
  border: none !important;
  max-width: 100% !important;
  width: 100% !important;
}
body.rvb-printing-modal .rvb-instant-header,
body.rvb-printing-modal .rvb-top-links,
body.rvb-printing-modal .no-print {
  display: none !important;
}

/* RTL for Arabic */
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .rvb-input {
  text-align: left;
}
html[dir="rtl"] .rvb-prefix {
  border-right: none;
  border-left: 1px solid #cbd5e1;
}
html[dir="rtl"] .rvb-suffix {
  border-left: none;
  border-right: 1px solid #cbd5e1;
}
html[dir="rtl"] .rvb-schedule-table {
  text-align: left;
}
html[dir="rtl"] .rvb-schedule-table td:first-child {
  text-align: center;
}
