#jitsi-container {
  width: 100%;
  height: 800px;
  /* Increased height */
  margin: 20px 0;
}

/* General Body */
body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  margin: 0;
  padding: 0;
}

/* Container */
.container {
  max-width: 900px;
  margin: 50px auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header Container */
.header-with-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.calculator-logo {
  height: 40px;
  width: auto;
  margin-right: 15px;
  object-fit: contain;
}

h1 {
  color: #333;
  margin: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .header-with-logo {
    flex-direction: column;
    gap: 10px;
  }

  .calculator-logo {
    width: 35px;
    height: 35px;
  }
}

/* Original h1 styling for pages without logo */
.container h1:not(.header-with-logo h1) {
  margin: 0 0 20px 0;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.header-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.scenario-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
  }

  .scenario-controls input,
  .scenario-controls select,
  .scenario-controls button,
  .header-buttons button {
    width: 100%;
    min-width: unset;
  }

  .scenario-controls {
    margin-right: 0;
  }
}

.scenario-controls input,
.scenario-controls select,
.scenario-controls button,
.header-buttons button {
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 120px;
  font-size: 14px;
  text-align: center;
}

.scenario-controls select {
  width: 220px;
  height: auto;
  min-height: 45px;
  white-space: normal;
  padding: 8px 16px;
  line-height: 1.2;
}

.scenario-controls input,
.scenario-controls select {
  background-color: #007BFF;
  color: white;
  border: 1px solid #0056b3;
}

.scenario-controls input::placeholder {
  color: white;
  font-weight: 600;
}

.scenario-controls select {
  background-color: #007BFF !important;
  color: white !important;
}

.scenario-controls select option {
  background-color: white;
  color: black;
}

.scenario-controls select option[disabled] {
  background-color: #007BFF;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
}

#savedScenarios {
  background-color: #007BFF !important;
  color: white !important;
  border: 1px solid #0056b3 !important;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  width: 220px;
  cursor: pointer;
}

#savedScenarios:hover {
  background-color: #0056b3 !important;
}

/* Other Headings */
h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

/* Form */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 25px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

form>div {
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 15px;
}

form>div>div {
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  form>div {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  form>div {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  form>div {
    grid-template-columns: 1fr;
  }
}

form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

form input,
form select {
  width: 100%;
  box-sizing: border-box;
}



label {
  font-weight: 600;
  margin-bottom: 12px;
  color: #495057;
  display: block;
  font-size: 20px;
}

input,
select {
  padding: 12px;
  border: 2px solid #e9ecef !important;
  border-radius: 6px;
  font-size: 15px;
  width: 100%;
  transition: border-color 0.2s;
}

input#interestRate,
input#customInterestRate,
input#mortgageType {
  border: 2px solid #e9ecef !important;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0066CC !important;
  border-width: 3px !important;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.3);
}

button {
  padding: 15px 20px;
  background-color: #007BFF;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  min-height: 50px;
}

button:hover {
  background-color: #0056b3;
}

/* Results Container: left text, right donut chart */
.results-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-top: 20px;
  gap: 20px;
}

.results-left {
  flex: 1;
  text-align: left;
}

.results-right {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  padding: 20px;
}

#myDonutChart {
  max-width: 100%;
  height: 420px !important;
}

/* The main line chart */
#myChart {
  max-width: 100%;
  height: 400px;
  margin: 20px 0;
}

/* Loan Disbursement Options */
#loanDisbursementOptions {
  margin-top: 20px;
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#loanDisbursementOptions h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

.lifetime-payment-container {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #e8f5e9;
  border-radius: 6px;
  font-size: 16px;
}

.lifetime-payment-container strong {
  color: #2c3e50;
}

.lifetime-payment-container span {
  font-weight: bold;
  color: #28a745;
}

.option-container {
  display: grid;
  grid-template-columns: auto minmax(250px, 1fr) minmax(120px, 200px);
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#optionContainer2 {
  grid-template-columns: auto minmax(300px, 1fr) minmax(120px, 200px) auto minmax(120px, 200px);
}

.option-container label {
  margin: 0;
  font-weight: bold;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.option-container input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.option-container input[type="number"],
.option-container select {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  max-width: 100px;
}

/* Specific width for duration select to maintain original size */
#duration {
  max-width: 200px;
}

#calculateDisbursementsButton {
  margin-top: 15px;
  width: 100%;
}

/* Simulator Section */
#simulatorSection {
  margin-top: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.simulator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

#simulatorSection {
  overflow-x: auto;
  max-width: 100%;
}

.simulator-container {
  max-width: 100%;
  overflow-x: auto;
}

.top-scroll-container {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 8px;
  height: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.top-scroll-content {
  height: 1px;
}

#simulatorTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#simulatorTable th,
#simulatorTable td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
  word-wrap: normal;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#simulatorTable th {
  background-color: #eee;
  text-align: center;
  font-weight: bold;
  line-height: 1.2;
  height: auto;
}

#simulatorTable input {
  max-width: 80px;
  padding: 2px 4px;
  font-size: 12px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

input:invalid {
  border-color: #ff6b6b;
}

/* Hidden input for Number of Months */
#numberOfMonths {
  display: none;
}

/* Tooltip styles - Fixed positioning and z-index issues */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:before {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(-100% - 15px);
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 16px;
  background-color: #2c3e50;
  color: white;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  white-space: normal;
  min-width: 180px;
  max-width: 450px;
  width: max-content;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 99999;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  pointer-events: none;
  line-height: 1.5;
  border: 2px solid #34495e;
  font-family: Arial, sans-serif;
}

[data-tooltip]:after {
  content: "";
  position: absolute;
  top: calc(-100% - 5px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #2c3e50;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 99999;
  pointer-events: none;
}

[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(5px);
}

/* Specific positioning for Screen Share button tooltip to appear above */
button[onclick="shareScreen()"][data-tooltip]:before {
  top: auto;
  bottom: calc(100% + 15px);
  transform: translateX(-50%) translateY(0);
}

button[onclick="shareScreen()"][data-tooltip]:after {
  top: auto;
  bottom: calc(100% + 5px);
  transform: translateX(-50%) translateY(0);
  border-top: none;
  border-bottom: 10px solid #2c3e50;
}

/* Ensure scenario controls container allows tooltips to show */
.scenario-controls {
  position: relative;
  z-index: 10;
  overflow: visible;
}

/* Specific tooltip positioning for scenario controls */
.scenario-controls [data-tooltip] {
  position: relative;
  overflow: visible;
}

.scenario-controls [data-tooltip]:before {
  top: calc(-100% - 25px);
  white-space: normal;
  max-width: 280px;
  text-align: center;
  font-size: 13px;
  padding: 10px 14px;
  z-index: 99999;
}

.scenario-controls [data-tooltip]:after {
  top: calc(-100% - 17px);
  border-top: 8px solid #2c3e50;
  border-bottom: none;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  z-index: 99999;
}

/* Ensure header container doesn't clip tooltips */
.header-container {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.header-buttons {
  overflow: visible;
  position: relative;
}

/* Ensure form doesn't clip tooltips */
form {
  overflow: visible;
  position: relative;
}



/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  input,
  select,
  button {
    font-size: 14px;
  }

  #resultsContainer {
    flex-direction: column;
  }

  .results-left,
  .results-right {
    width: 100%;
    margin-bottom: 20px;
  }
}

.financial-table {
  margin: 15px 0;
  overflow-x: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 10px;
  width: 100%;
  font-size: 0.9em;
}

.financial-table {
  table-layout: fixed;
  width: 100%;
}

.table-title {
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  padding: 8px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border-radius: 6px 6px 0 0;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  display: block;
  transform: translateX(-10px);
  width: calc(100% + 20px);
}

.financial-table th:nth-last-child(-n+2) {
  position: relative;
}

.financial-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
}

.financial-table th,
.financial-table td {
  padding: 8px;
  text-align: right;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
}

.financial-table th {
  background: #f8f9fa;
  font-weight: 600;
  text-align: center;
  color: #2c3e50;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
}

.financial-table td {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1em;
  color: #2c3e50;
}

.financial-table tr:hover td {
  background-color: #f5f9ff;
}

.financial-table tr:last-child td {
  border-bottom: none;
  font-weight: bold;
}

.purchase-charts {
  margin: 20px auto;
  padding: 15px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  max-width: 900px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
  width: 100%;
}

.chart-container {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  height: 450px;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-container {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  height: 450px;
  margin: 15px 0;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.chart-container.span-2 {
  grid-column: span 2;
  height: 450px;
}

.chart-container h4 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 14px;
}

.purchase-benefits {
  margin: 30px auto;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  width: 100%;
}

.purchase-benefits h3 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 25px;
  font-size: 24px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .benefit-grid {
    grid-template-columns: 1fr;
  }
}

.benefit-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.benefit-card h4 {
  color: #28a745;
  margin-bottom: 15px;
  font-size: 18px;
}

.benefit-card ul {
  list-style: none;
  padding: 0;
}

.benefit-card li {
  margin-bottom: 10px;
  padding-left: 25px;
  position: relative;
}

.benefit-card li:before {
  content: "✓";
  color: #28a745;
  position: absolute;
  left: 0;
  font-weight: bold;
}

.benefit-summary {
  background: #e8f5e9;
  padding: 15px;
  border-radius: 6px;
  margin-top: 20px;
  text-align: center;
  font-size: 16px;
}

.call-to-action {
  margin-top: 30px;
  padding: 25px;
  background: #f8f9fa;
  border: 2px solid #28a745;
  border-radius: 8px;
}

.call-to-action h4 {
  color: #28a745;
  text-align: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.action-points {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.action-point {
  padding: 10px;
  background: white;
  border-radius: 6px;
  font-size: 16px;
}

.highlight {
  color: #28a745;
  font-weight: bold;
}

.next-steps {
  margin-top: 20px;
  padding: 15px;
  background: #28a745;
  color: white;
  border-radius: 6px;
  text-align: center;
}

.next-steps ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.next-steps li {
  margin: 5px 0;
  font-size: 16px;
}

/* FAQ Section */
.faq-section {
  margin: 30px 0;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

.faq-item {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.faq-item h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
}

.faq-item p {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.faq-controls {
  text-align: center;
  margin-top: 20px;
}

.faq-button {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 10px;
}

.faq-button:hover {
  background-color: #45a049;
}

/* Traditional Financial Analysis Section */
.financial-analysis {
  margin: 30px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  max-width: 900px;
}

.financial-analysis h3 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 25px;
  font-size: 24px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.analysis-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.analysis-card h4 {
  color: #28a745;
  margin-bottom: 15px;
  font-size: 18px;
  text-align: center;
}

.payment-comparison p,
.funds-breakdown p {
  margin: 10px 0;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #e9ecef;
}

.editable {
  min-width: 100px;
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.editable:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.editable:focus {
  background: white;
  border-color: #80bdff;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

@media (max-width: 768px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

/* PDF Dropdown Styling */
.pdf-dropdown-container {
  position: relative;
  display: inline-block;
}

.pdf-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  min-width: 160px;
  margin-top: 2px;
}

.pdf-option {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}

.pdf-option:hover {
  background-color: #f5f5f5;
}

.pdf-option:last-child {
  border-bottom: none;
}

.pdf-option:first-child {
  border-radius: 4px 4px 0 0;
}

.pdf-option:last-child {
  border-radius: 0 0 4px 4px;
}

@media print {
  body {
    font-size: 12px;
  }

  .no-print {
    display: none;
  }

  .container {
    max-width: none;
    margin: 0;
    padding: 10px;
  }

  .chart-container {
    page-break-inside: avoid;
    margin: 20px 0;
  }

  .results-container {
    page-break-inside: avoid;
  }

  /* Fix Transaction Summary overlap in print */
  .transaction-summary {
    position: static !important;
    transform: none !important;
    margin-top: 30px !important;
    page-break-before: auto;
    clear: both;
  }

  /* Ensure charts have proper spacing in print */
  #myChart, #myDonutChart {
    margin-bottom: 30px !important;
  }

  /* Add space between chart sections */
  .chart-section {
    margin-bottom: 40px !important;
    page-break-inside: avoid;
  }
}