/* reset & basic */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background: #e0e0e0; color: #333; }

/* NAVBAR */
.navbar {
  position: sticky;
  top: 1rem;

  /* shrink to content */
  display: flex;
  width: max-content;

  /* center on page */
  margin: 1.5rem auto;

  align-items: center;
  gap: 3rem;

  /* larger padding */
  padding: 1.25rem 2rem;

  /* text size */
  font-size: 1.125rem;

  /* frosted-glass look */
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);

  border-radius: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
.navbar__links a {
  font-size: inherit;
  padding-bottom: 0.35rem;
}

/* Solid border */
hr.solid {
  border-top: 1px solid #ededed;
}


.navbar__logo {
  margin-right: 2rem;
  font-weight: bold;
}
.navbar__links {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.navbar__links li a {
  text-decoration: none;
  color: inherit;
  padding-bottom: 0.25rem;
}
.navbar__links li.active a {
  border-bottom: 2px solid #555;
}

/* Version badge in top-right corner */
#version-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  font-size: 0.875rem;
  color: #333;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 1001;
  pointer-events: none; /* so it never blocks clicks */
}


/* CARD */
.card {
  max-width: 900px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 0.75rem;
}
.card__title {
  text-align: center;
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}
.card__title::after {
  content: "";
  display: block;
  width: 50%;
  height: 2px;
  background: #555;
  margin: 0.5rem auto 0;
}
.card__content {
  text-align: center;
  font-size: 1.25rem;
  margin-top: 1rem;
}

/* billing-page extras */
.button-group,
.toggle-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}
.button-group button,
.toggle-group button {
  padding: 0.5rem;
  background: #f2f4f5;
  color: #333;
  border-radius: 0.25rem;
  text-align: left;
  cursor: pointer;
  border: 1px solid #a7a7a7;
  border-radius: 5px;
  width: 180px;
  margin: auto;
}
/* — Shared button reset for billing page categories & CPT items — */
.category-button,
.cpt-item-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f2f4f5;
  color: #333;
  border: 1px solid #a7a7a7;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  position: relative;            /* for ::after underline */
  transition: background-color 0.2s, color 0.2s;
  font-weight: 600;
  width: 180px;
  margin: auto;
  text-align: left;
}

/* Hover/Active */
.category-button:hover,
.category-button:active,
.cpt-item-button:hover,
.cpt-item-button:active {
  background-color: #dadada;
  color: #747474;
}

/* Selected state */
.category-button.selected,
.cpt-item-button.selected {
  background-color: #dadada;
  color: #747474;
}

/* Underline for selected */
.category-button.selected::after,
.cpt-item-button.selected::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #555;
  border-radius: 1px;
}
/* —— Toggle-group buttons act like category & CPT buttons —— */
.toggle-group button {
  position: relative;
  padding: 0.5rem 0.75rem;
  background: #f2f4f5;
  color: #333;
  border: 1px solid #a7a7a7;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s;
  margin: 0;

  
}

/* hover/active */
.toggle-group button:hover,
.toggle-group button:active {
  background-color: #dadada;
  color: #747474;
}

/* selected state */
.toggle-group button.selected {
  background-color: #dadada;
  color: #747474;
}

/* underline for selected */
.toggle-group button.selected::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #555;
  border-radius: 1px;
}

/* wrap both search + toggles, center them */
.cpt-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* only the sidebar + details sit side-by-side */
.cpt-body {
  display: flex;
  gap: 1rem;
}

/* make the billing‐lookup table text smaller */
#billing-table th,
#billing-table td {
  font-size: 0.72rem;  /* adjust up/down to taste */
}

#prefix-lookup table th,
#prefix-lookup table td {
  font-size: 0.85rem;
}



.search {
  display: block;
  width: 60%;
  margin: 0 auto 1rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
}
.billing-content {
  gap: 1rem;
}
.billing-sidebar {
  flex: 1;
  background: #f1f1f1;
  padding: 1rem;
  border-radius: 0.5rem;
}
.billing-sidebar ul {
  list-style: none;
  margin-top: 0.5rem;
}
.billing-sidebar li {
  margin: 0.25rem 0;
}
.billing-details {
  flex: 2;
  background: #f1f1f1;
  padding: 1rem;
  border-radius: 0.5rem;
}
.billing-details h2 {
  margin-bottom: 0.5rem;
}
.billing-details p {
  margin: 0.25rem 0;
}
.icons {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

/* utility to hide until a category is selected */
.hidden {
  display: none;
}

.cpt-group {
  margin-bottom: 1rem;
}
.cpt-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.cpt-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
}

/* —— CPT Accordion Styles —— */
.cpt-group {
  margin-bottom: 1rem;
}

/* Header bar with arrow */
.cpt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f2f4f5;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  user-select: none;
  border: 1px solid #a7a7a7;
  border-radius: 5px;
  font-weight: 600;
}
.cpt-header .arrow {
  transition: transform 0.2s ease;
}
/* flip arrow when open */
.cpt-header.open .arrow {
  transform: rotate(180deg);
}

/* Hidden by default; flex-column when open */
.cpt-items {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.cpt-items.open {
  display: flex;
}

/* The individual code buttons */
.cpt-item-button {
  padding: 0.5rem;
  background: #f2f4f5;
  color: #333;
  border-radius: 0.25rem;
  text-align: left;
  cursor: pointer;
  border: 1px solid #a7a7a7;
  border-radius: 5px;
  width: 180px;
  margin: auto;
}

.cpt-item-button:hover {
  background-color: #dadada;
  color: #747474;
  transition: 0.3s;
}

.cpt-item-button:active {
  background-color: #dadada;
  color: #747474;
  transition: 0.3s;
}

/* make sure buttons are position:relative for ::after to work */
.cpt-item-button {
  position: relative;
  transition: background-color 0.2s, color 0.2s;
}

/* “selected” state background/text */
.cpt-item-button.selected {
  background-color: #dadada;
  color: #747474;
}

/* — Shared toggle & category active state — */
.toggle-group button,
.category-button {
  position: relative;           /* needed for ::after */
  transition: background-color 0.2s, color 0.2s;
}

/* hover */
.toggle-group button:hover,
.category-button:hover {
  background-color: #dadada;
  color: #747474;
}

/* persistent “selected” look */
.toggle-group button.selected,
.category-button.selected {
  background-color: #dadada;
  color: #747474;
}

/* underline for selected */
.toggle-group button.selected::after,
.category-button.selected::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #555;
  border-radius: 1px;
}

/* make search input a block with known width */
.search {
  display: block;
  width: 60%;
  margin: 0 auto;
  position: relative;
  z-index: 1000;
}

/* suggestions list flush under the input */
#search-suggestions {
  list-style: none;
  margin: 0;
  margin-top: -1px;              /* pull up to touch the bottom edge */
  padding: 0;
  width: 60%;                    /* same as .search */
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;              /* avoid double border */
  border-radius: 0 0 4px 4px;    /* only round bottom corners */
  max-height: 200px;
  overflow-y: auto;
  z-index: 999;                  /* under the input */
}

/* individual suggestion items */
#search-suggestions li {
  padding: 0.5rem;
  cursor: pointer;
}

/* hover highlight */
#search-suggestions li:hover {
  background: #f0f0f0;
}

/* when toggle-group is hidden, keep its vertical gap before billing-content */
#toggle-group.hidden + #billing-content {
  margin-top: 1rem;
}

/* —— Calculator panels layout —— */
.calculator {
  margin-top: 1.5rem;
}
.calc-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* each panel */
.calc-card {
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  flex: 1;
  max-width: 300px;
  padding: 1rem;
  text-align: center;
}

/* panel headings with underline */
.calc-card h2 {
  margin-bottom: 1rem;
  font-weight: 500;
  position: relative;
}
.calc-card h2::after {
  content: "";
  display: block;
  width: 50%;
  height: 2px;
  background: #888;
  margin: 0.5rem auto 0;
}

/* container for the pill buttons */
.calc-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* pill-style buttons */
.calc-items button,
.submit-btn {
  padding: 0.5rem;
  background: #e0e0e0;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
.calc-items button:hover,
.submit-btn:hover {
  background: #d4d4d4;
}

/* submit button styling */
.submit-btn {
  width: 100px;
  margin: 0 auto;
  background: #007bff;
  color: #fff;
  border-radius: 0.25rem;
}
.submit-btn:hover {
  background: #006ae1;
}

/* output box for patient responsibility */
.calc-output {
  margin-top: 1rem;
}
.calc-output span {
  display: inline-block;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 1rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.25rem;
  color: #333;
}

.service-btn.selected {
  background: #007bff;
  color: white;
}

/* pill-style service dropdowns */
.service-select {
  /* remove native arrows */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  display: block;
  margin: 0.5rem auto;      /* vertical spacing + center */
  width: 80%;               /* adjust as needed */
  max-width: 220px;
  padding: 0.5rem 1rem;     /* vertical/horizontal padding */
  font-size: 1rem;
  text-align: center;       /* center the selected text */
  border: 1px solid #a7a7a7;
  border-radius: 999px;     /* full pill */
  background: #f2f4f5;
  cursor: pointer;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

/* when the select is disabled */
.service-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.coins-input {
  background-image: none;
  cursor: text;
}

#clear-btn {
  padding: 0.5rem 0.75rem;
  background: #f2f4f5;
  color: #333;
  border: 1px solid #a7a7a7;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  position: relative;            /* for ::after underline */
  transition: background-color 0.2s, color 0.2s;
  font-weight: 600;
  width: 100px;
  margin: auto;
}

#clear-btn:hover {
  background-color: #dadada;
  color: #747474;
}

    /* Prefix-Lookup table styling */
    #prefix-lookup .prefix-search {
      appearance: none;
      display: block;
      margin: 0.5rem auto;
      width: 80%;
      max-width: 300px;
      padding: 0.5rem 1rem;
      font-size: 1rem;
      text-align: center;
      border: 1px solid #a7a7a7;
      border-radius: 999px;
      background: #f2f4f5;
      background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 1rem center;
    }
    #prefix-lookup table {
      width: 90%;
      margin: 0.5rem auto;
      border-collapse: collapse;
    }
    #prefix-lookup th, #prefix-lookup td {
      padding: 0.5rem;
      border: 1px solid #ccc;
    }
    #prefix-lookup th {
      background: #ddd;
    }
    #prefix-lookup tr:nth-child(even) {
      background: #f9f9f9;
    }

    #protocol-lookup .form-field {
      margin-bottom: 0.75rem;
    }
    #cpt-rows .cpt-row {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
    }
    #cpt-rows .cpt-row input {
      flex: 1;
    }
    #cpt-rows .remove-row {
      background: #e74c3c;
      color: white;
      border: none;
      padding: 0 0.5rem;
      cursor: pointer;
    }
    #add-cpt-row {
      margin-top: 0.5rem;
    }
    



/* make the subgroup headers smaller & indented */
.cpt-header--subgroup {
  font-size: 0.9em;
  background-color: #f2f4f5;
  width: 200px;
  align-items: center;
  margin: auto;
}

/* any CPT-item with an empty code (i.e. your “PET” header) */
/* only the “subgroup” cpt-items */
.cpt-items.cpt-subgroup {
  margin-top: 0;
  /* or whatever spacing you need */
}

/* only targets the buttons in the PET-Scan subgroup */
.pet-scan-items .cpt-item-button {
  /* your special styling here */
  font-size: 10px;
  margin-top: 0;
}

.lexi-items .cpt-item-button {
  /* your special styling here */
  font-size: 10px;
  margin-top: 0;
}

/* ─── Billing-Lookup Table Styling (matches #prefix-lookup) ───────────────── */

/* input pill */
#billing-table-layout .prefix-search {
  appearance: none;
  display: block;
  margin: 0.5rem auto;
  width: 80%;
  max-width: 300px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  text-align: center;
  border: 1px solid #a7a7a7;
  border-radius: 999px;
  background: #f2f4f5;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

/* table wrapper */
#billing-table {
  width: 100%;
  margin: 0.5rem auto;
  border-collapse: collapse;
}

/* cells */
#billing-table th,
#billing-table td {
  padding: 0.75rem;
  border: 1px solid #ccc;
}

/* header row */
#billing-table th {
  background: #ddd;
}

/* zebra striping */
#billing-table tr:nth-child(even) {
  background: #f9f9f9;
}

/* center the “CPT Covered” column (4th column) */
#billing-table th:nth-child(4),
#billing-table td:nth-child(4) {
  text-align: center;
}

#billing-table th:nth-child(1),
#billing-table td:nth-child(1),
#billing-table th:nth-child(2),
#billing-table td:nth-child(2),
#billing-table th:nth-child(5),
#billing-table td:nth-child(5) {
  text-align: center;
}
