/* ===== Core Calculator Layout ===== */
.brc-calculator {
  padding: 2rem;
  width: 100%;
  margin: auto;
  font-family: sans-serif;
}

#runwayForm {
  width: 50%;
  margin: 0 auto;
}

.burn-rate-heading {
  color: #002f87;
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.brc-calculator label {
  font-size: 1.25rem;
  font-weight: 600;
  color: #002f87;
  margin-bottom: 8px;
  display: block;
}

.brc-calculator input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  font-size: 1rem;
  box-sizing: border-box;
}

.brc-calculator button {
  background-color: #002f87;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: 25%;
}

.brc-calculator button:hover {
  background-color: #0140b8;
}

#results {
  margin-top: 1.5rem;
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
}

.brc-calculator p {
  font-size: 16px;
  margin-bottom: 20px;
  color: #002f87;
  text-align: center;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  -webkit-overflow-scrolling: touch;
}

.brc-modal-content {
  background-color: #fff;
  margin: 8% auto;
  padding: 30px 40px;
  border-radius: 12px;
  max-width: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeInScale 0.3s ease forwards;
  overflow-x: auto;
}

.brc-modal-content h3 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.8rem;
  color: #002f87;
  border-bottom: 2px solid #002f87;
  padding-bottom: 8px;
  text-align: center;
}

.brc-close {
  position: absolute;
  top: 18px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.3s ease;
}
.brc-close:hover {
  color: #002f87 !important;
}

/* ===== Table in Modal ===== */
.brc-modal-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  background-color: #fafafa;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  min-width: 450px;
}

.brc-modal-content table thead tr {
  background-color: #002f87;
  color: white;
  font-weight: 600;
  text-align: left;
}

.brc-modal-content table thead th {
  padding: 12px 15px;
  width: 13%;
}

.brc-modal-content table tbody tr {
  background-color: #fff;
  transition: background-color 0.25s ease;
}

.brc-modal-content table tbody tr:hover {
  background-color: #f1f9f1;
}

.brc-modal-content table tbody td {
  padding: 14px 15px;
  vertical-align: middle;
}

.brc-modal-content table tbody tr.total-row {
  font-weight: 700;
  background-color: #e6f4ea;
  border-top: 2px solid #002f87;
}

.brc-modal-content table tbody tr.total-row td:first-child {
  text-align: right;
  padding-right: 10px;
}

/* ===== Modal Animation ===== */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Responsive Fixes ===== */
@media (max-width: 768px) {
  #runwayForm {
    width: 100%;
  }

  .brc-calculator {
    padding: 1.5rem;
  }

  .brc-calculator button {
    width: 100%;
    font-size: 1rem;
    padding: 12px 20px;
  }

  .burn-rate-heading {
    font-size: 1.3rem;
  }

  #results {
    font-size: 1rem;
  }

  .brc-modal-content {
    max-width: 95%;
    padding: 20px;
    margin: 15% auto;
  }

  .brc-modal-content h3 {
    font-size: 1.4rem;
  }

  .brc-modal-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    background-color: #fafafa;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    min-width: auto;
  }

  .brc-modal-content table thead tr {
    background-color: #002f87;
    color: white;
    font-weight: 600;
    text-align: left;
  }

  .brc-modal-content table thead th {
    padding: 12px 15px;
    width: 13%;
  }

  .brc-modal-content table tbody tr {
    background-color: #fff;
    transition: background-color 0.25s ease;
  }

  .brc-modal-content table tbody tr:hover {
    background-color: #f1f9f1;
  }

  .brc-modal-content table tbody td {
    padding: 14px 15px;
    vertical-align: middle;
  }

  .brc-modal-content table tbody tr.total-row {
    font-weight: 700;
    background-color: #e6f4ea;
    border-top: 2px solid #002f87;
  }

  .brc-modal-content table tbody tr.total-row td:first-child {
    text-align: right;
    padding-right: 10px;
  }

  .brc-close {
    top: 12px;
    right: 15px;
    font-size: 24px;
  }
}

@media (max-width: 400px) {
  .brc-modal-content {
    padding: 15px;
    margin: 20% auto;
  }

  .brc-modal-content h3 {
    font-size: 1.3rem;
  }

  .brc-modal-content table {
    font-size: 0.85rem;
  }
}
