/* =========================
   Container & Titles
========================= */
#rateContainer {
  margin: 20px auto 4rem;
  max-width: 100%;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Arial, sans-serif;
}

#rateContainer .title {
  text-align: center;
  margin: 5px 0 6px;
  font-size: 22px;
  font-weight: bold;
  color: #222;
}

/* Billing month line with dynamic spans */
#rateContainer #rate-month-year {
  text-align: center;
  font-size: 16px;
  margin-bottom: 10px;
  color: #555;
}

#rateContainer #rate-month-year #selectedMonth,
#rateContainer #rate-month-year #selectedYear {
  font-weight: 700;
  color: #222;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin: 0 2px;
}

/* =========================
   Filters (Month & Year)
========================= */
#rateContainer .filter-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 15px;
}

#rateContainer .filter-container label {
  font-weight: 600;
  color: #333;
}

#rateContainer #monthSelector,
#rateContainer #yearSelector {
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  transition: border .2s, box-shadow .2s;
}

#rateContainer #monthSelector:hover,
#rateContainer #yearSelector:hover {
  border-color: #00b33c;
  box-shadow: 0 2px 5px rgba(0, 179, 60, .25);
}

/* =========================
   Table Styling
========================= */
#rateContainer table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 15px;
  font-size: 13px;
  background-color: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .08);
  border-radius: 5px;
  overflow: hidden;
  table-layout: fixed;
  /* keep columns consistent */
}

/* ===== FIXED CELLS ===== */
#rateContainer th,
#rateContainer td {
  padding: 6px 8px;
  border: 1px solid #ddd;
  text-align: center;
  vertical-align: middle;

  /* IMPORTANT: allow wrapping by default (prevents header overlap) */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Header cells: wrap nicely and stay readable */
#rateContainer thead th {
  background-color: #f4f4f4;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  font-size: 11px;
  /* slightly smaller to fit */
  line-height: 1.15;
  /* tighter lines */
}

/* First header row (A..I) can stay on one line */
#rateContainer thead tr:first-child th {
  background-color: #eef2f6;
  white-space: nowrap;
  font-size: 12px;
}

/* Third header row (Net Purchase / Net Sale) keep readable */
#rateContainer thead tr:nth-child(3) th {
  font-size: 11px;
}

/* Body cells: keep numbers on one line (looks clean) */
#rateContainer tbody td:not(:first-child) {
  white-space: nowrap;
}

/* Body zebra + hover */
#rateContainer tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#rateContainer tbody tr:hover {
  background-color: #f1f1f1;
  transition: background-color .2s ease-in-out;
}

/* First column (Source) left-aligned + allow wrapping */
#rateContainer tbody td:first-child,
#rateContainer thead tr:nth-child(2) th:first-child {
  text-align: left;
  white-space: normal;
}

/* =========================
   Footer (Generation Charge) - UPDATED DESIGN for your <tfoot>
========================= */

/* Make the whole footer look like a card row */
#rateContainer tfoot td.footer-inline {
  background: #ffffff;
  /* card background */
  color: #222;
  border: 1px solid #e6e6e6;
  font-weight: 600;
  text-align: center;
  padding: 18px 16px;
  font-size: 15px;
  letter-spacing: .2px;

  /* “card” feel */
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  border-radius: 12px;

  /* spacing from the table body */
  position: relative;
}

/* green accent line at top */
#rateContainer tfoot td.footer-inline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: #00cc44;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Put everything on clean lines */
#rateContainer tfoot td.footer-inline {
  line-height: 1.35;
}

/* Month style */
#rateContainer #billingMonth {
  display: block;
  /* NEW LINE */
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  color: #111;
}

/* Value pill style */
#rateContainer #generationCharge.gc-pill {
  display: inline-block;
  margin-top: 12px;
  /* NEW LINE */
  background: #b6f2c8;
  color: #000;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .5px;
  white-space: nowrap;
  border: 1px solid #8fe3a9;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06) inset;
}

/* Optional: make the footer row borders not fight the card look */
#rateContainer tfoot tr td {
  border-left: none;
  border-right: none;
}

/* Mobile tweaks (footer card) */
@media (max-width: 480px) {
  #rateContainer tfoot td.footer-inline {
    font-size: 14px;
    padding: 16px 12px;
  }

  #rateContainer #billingMonth {
    font-size: 16px;
  }

  #rateContainer #generationCharge.gc-pill {
    font-size: 20px;
    padding: 9px 14px;
  }
}

/* =========================
   Make Table Fit on One Page
========================= */
@media screen and (max-width: 1400px) {
  #rateContainer table {
    font-size: 12px;
  }

  #rateContainer th,
  #rateContainer td {
    padding: 5px 6px;
  }

  #rateContainer .title {
    font-size: 20px;
  }

  #rateContainer #rate-month-year {
    font-size: 15px;
  }
}

/* =========================
   Compact Responsive Table
========================= */
@media screen and (max-width: 992px) {
  #rateContainer {
    padding: 0 5px;
  }

  #rateContainer table {
    font-size: 11px;
    table-layout: auto;
    /* let columns flex on small screens */
  }

  #rateContainer th,
  #rateContainer td {
    padding: 4px 5px;
  }

  #rateContainer .title {
    font-size: 18px;
  }

  #rateContainer #rate-month-year {
    font-size: 14px;
  }
}

/* =========================
   Hard overrides to guarantee <tfoot> renders
========================= */
#rateTable {
  display: table !important;
  width: 100%;
}

#rateTable thead {
  display: table-header-group !important;
}

#rateTable tbody {
  display: table-row-group !important;
}

#rateTable tfoot {
  display: table-footer-group !important;
}

#rateTable,
#rateContainer {
  overflow: visible !important;
}

#generationCharge {
  text-align: center !important;
}

/* ==== FORCE footer card styles (place at VERY BOTTOM of your CSS) ==== */
#rateTable tfoot td.footer-inline {
  background: #ffffff !important;
  color: #222 !important;
  border: 1px solid #e6e6e6 !important;
  font-weight: 600 !important;
  text-align: center !important;
  padding: 18px 16px !important;
  font-size: 15px !important;
  letter-spacing: .2px !important;

  box-shadow: 0 6px 18px rgba(0, 0, 0, .08) !important;
  border-radius: 12px !important;
  position: relative !important;
}

#rateTable tfoot td.footer-inline::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 6px !important;
  background: #00cc44 !important;
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
}

/* Month style */
#rateTable #billingMonth {
  display: block !important;
  margin-top: 6px !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  color: #111 !important;
}

/* VALUE PILL — targets #generationCharge whether or not it has class="gc-pill" */
#rateTable #generationCharge,
#rateTable #generationCharge.gc-pill {
  display: inline-block !important;
  margin-top: 12px !important;
  background: #b6f2c8 !important;
  color: #000 !important;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: .5px !important;
  white-space: nowrap !important;
  border: 1px solid #8fe3a9 !important;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06) inset !important;
}

/* Remove side borders that make the card look “boxed in” */
#rateTable tfoot tr td {
  border-left: none !important;
  border-right: none !important;
}

@media (max-width: 480px) {
  #rateTable tfoot td.footer-inline {
    font-size: 14px !important;
    padding: 16px 12px !important;
  }

  #rateTable #billingMonth {
    font-size: 16px !important;
  }

  #rateTable #generationCharge,
  #rateTable #generationCharge.gc-pill {
    font-size: 20px !important;
    padding: 9px 14px !important;
  }
}