
 /* =============================
   General Styles
   ============================= */

#mortgage-calculator {
  max-width: 900px;
  margin: auto;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  position: relative;
  direction: rtl;
  font-family: 'Heebo', sans-serif;
}

/* =============================
   Logo
   ============================= */
.logo-container {
  text-align: center;
  margin-bottom: 20px;
}

.logo-container img {
  max-width: 120px;
}

/* =============================
   Loan Row Layout
   ============================= */
.loan-row {
  background: #dfeaf7;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  position: relative;
}

.loan-row input[type="text"],
.loan-row input[type="number"],
.loan-row select,
.month-combo input {
  flex: 1;
  padding: 8px 16px !important;
  font-size: 14px !important;
  border: 1px solid #aaa !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  min-height: 42px !important;
  background: #fff !important;
  appearance: none !important;
  transition: all 0.3s !important;
  outline: none !important;
}

/* =============================
   Month Combo Dropdown
   ============================= */
.month-combo {
  flex: 1;
  max-width: 120px;
  position: relative;
}

.month-combo input {
  border: 1px solid #aaa !important;
  box-shadow: none !important;
}

.month-combo .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #aaa;
  background: #fff;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  display: none;
}

.month-combo .dropdown .item {
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.month-combo .dropdown .item:hover {
  background: #dfeaf7;
}

/* =============================
   Summary Section
   ============================= */
.summary-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.summary-grid div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50%;
  border-bottom: 1px solid #ddd;
  padding: 6px 0;
}

.summary-grid div b {
  font-weight: normal;
  margin: 0;
}

.summary-grid div span {
  font-weight: bold;
  margin: 0;
}

.summary-grid div b::after {
  content: " -";
  margin-inline-end: 8px;
}

.summary-grid div:last-child {
  border-bottom: none;
}

/* =============================
   Buttons and Remove Icons
   ============================= */
.remove-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  background: #f1f1f1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.remove-btn svg {
  fill: gray;
}

button {
  cursor: pointer;
  padding: 12px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
}

/* =============================
   Amortization Header
   ============================= */
#amortizationContent h3 {
  text-align: center;
  font-size: 20px;
  color: #2951a1;
  margin-bottom: 20px;
  border-bottom: 2px solid #dfeaf7;
  padding-bottom: 10px;
  font-weight: 600;
}

/* =============================
   Track Number Badge
   ============================= */
.track-number {
  font-weight: bold;
  font-size: 16px;
  background: #2951a1;
  color: white;
  padding: 3px 12px;
  border-radius: 5px;
  margin-inline-start: auto;
  margin-inline-end: 0;
}

/* =============================
   Field Sizing Classes
   ============================= */
.loan-row .wide {
  flex: 2;
}

.loan-row .small {
  flex: 0.7;
}

.month-combo.wide {
  flex: 2;
}

.loan-row .amount.wide {
  flex: 1.5 !important;
  max-width: none !important;
}

/* =============================
   Interest Group + Rate Hint
   ============================= */
.interest-group {
  position: relative;
  flex: 1.5 !important;
  gap: 4px;
}

.loan-row .rate-hint {
  direction: ltr;
  text-align: left;
}

/* =============================
   Mobile Styles
   ============================= */
@media (max-width: 768px) {
  #mortgage-calculator {
    width: 100% !important;
    margin: 0 auto !important;
  }

  #amortizationContent {
    padding: 10px;
    font-size: 13px;
  }

  #amortizationContent table th,
  #amortizationContent table td {
    font-size: 12px;
    padding: 6px;
  }

  .loan-row {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .loan-row input[type="text"],
  .loan-row input[type="number"],
  .loan-row select,
  .month-combo input {
    width: 100% !important;
  }

  .month-combo {
    max-width: none !important;
    width: 100% !important;
  }

  .track-number {
    order: -1;
    align-self: flex-start;
    margin-inline-start: 0 !important;
    margin-inline-end: auto !important;
  }

  .remove-btn {
    top: 5px;
    left: 5px;
  }

  button {
    width: 100% !important;
    margin-bottom: 10px;
  }

  .summary-grid div {
    width: 100% !important;
    justify-content: space-between !important;
    padding: 10px 5px !important;
  }

  .rate-index-wrap {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    align-items: flex-start;
  }

  .rate-index-wrap .interest-group,
  .rate-index-wrap .index {
    flex: 1;
    min-width: 0;
  }

  .interest-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
  }

  .interest-group input.interest {
    width: 100%;
    box-sizing: border-box;
  }

  .interest-group .rate-hint {
    position: static;
    margin-top: 0px;
    font-size: 0.8em;
    text-align: center;
    color: #666;
    white-space: normal;
  }

  .index {
    width: 100%;
    box-sizing: border-box;
  }
}

/* =============================
   Desktop Only Rate + Index Row
   ============================= */
@media (min-width: 769px) {
  .rate-index-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex: 3;
  }

  .rate-index-wrap .interest-group,
  .rate-index-wrap .index {
    flex: 1;
    min-width: 0;
  }

  .interest-group {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
  }

  .interest-group .rate-hint {
    position: absolute;
    top: calc(100% + 0px);
    left: 0;
    right: 0;
    font-size: 0.7em;
    color: #555;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
  }
}

