/* ============================= */
/* Availability Modal & Backdrop */
/* ============================= */
.availability-modal {
  display: none!important;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  z-index: 9999!important;
}
.availability-modal.open {
  display: flex!important;
}

/* ============================= */
/* Modal Content Container */
/* ============================= */
.availability-content {
  position: relative;
  width: 85vw;         /* wider on all screens */
  max-width: 1200px;   /* up to 1200px */
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ----------------------------- */
/* Desktop Override for Width */
/* ----------------------------- */
@media (min-width: 768px) {
  .availability-content {
    width: 80vw;        /* 80% of viewport on desktop */
    max-width: 1400px;  /* up to 1400px */
  }
}

/* ============================= */
/* Close Button */
/* ============================= */
.availability-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #c00;
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
}

/* ============================= */
/* Export (Download List) Button */
/* ============================= */
.availability-export {
  padding: 1rem;
  background: transparent; /* no grey bar */
  text-align: left;
}
.export-btn {
  display: inline-block;
  background: #15917C;
  color: #fff;
  font-weight: bold;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
}
.export-btn:hover {
  background: #127461;
}

/* ============================= */
/* Table Wrapper (Scrollable) */
/* ============================= */
.table-responsive {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1rem 2rem 2rem; /* extra horizontal padding */
}
/* ============================= */
/* Table Base Styles */
/* ============================= */
#availability-html-container table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}


/* Hide original letter header row */
#availability-html-container table thead > tr:first-child {
  display: none !important;
}

/* Sticky descriptive header (first visible row) */
#availability-html-container table thead > tr:first-child + tr th {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #ccc;
  z-index: 2;
  font-weight: 600;
  text-align: left;
}

/* ============================= */
/* Table Cells */
/* ============================= */
#availability-html-container th,
#availability-html-container td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
}

/* Zebra Stripes */
#availability-html-container tbody tr:nth-child(odd) {
  background: #f9f9f9;
}

#availability-html-container tr.highlight-row {
  background-color: rgba(255,235,59,0.4) !important;
}

/* ============================= */
/* Column Widths (tweak as needed) */
/* ============================= */
#availability-html-container table thead tr:first-child {
  display: none !important;
}
#availability-html-container th:nth-child(2),
#availability-html-container td:nth-child(2) { width: 30% !important; } /* visible col 1: wider */

#availability-html-container th:nth-child(3),
#availability-html-container td:nth-child(3) { width: 25% !important; } /* visible col 2: wider */

#availability-html-container th:nth-child(4),
#availability-html-container td:nth-child(4) { width: 12% !important; } /* visible col 3: narrower */

#availability-html-container th:nth-child(5),
#availability-html-container td:nth-child(5) { width: 8% !important; } /* visible col 4: narrower */

#availability-html-container th:nth-child(6),
#availability-html-container td:nth-child(6) { width: 12% !important; } /* visible col 5: narrower */

#availability-html-container th:nth-child(7),
#availability-html-container td:nth-child(7) { width: 13% !important; } /* visible col 5: narrower */

.table-responsive {
  overflow: auto; /* you already have this */
}
#availability-html-container table {
  min-width: 760px;           /* ensures columns keep their proportions on narrow viewports */
  table-layout: fixed;        /* keep fixed on desktop */
  box-sizing: border-box;
}

/* 2) Pin the next header row and style it */
#availability-html-container table thead > tr:first-child + tr th {
  position: sticky !important;
  top: 0 !important;
  background: #202020 !important;  /* dark background */
  color: #fff !important;           /* white text */
  font-weight: bold !important;     /* bold labels */
  z-index: 5 !important;            /* above table body */
  padding: .75rem .5rem !important; /* adjust as needed */
}

#availability-html-container tbody tr:nth-child(1) {
  position: sticky !important;
  top: 0 !important;
  background: #202020 !important;
  color: #fff !important;
  font-weight: bold !important;
  padding: .75rem .5rem !important;
  z-index: 5 !important;
}

/* Hide the first column entirely */
#availability-html-container table th:first-child,
#availability-html-container table td:first-child {
  display: none !important;
}


#availability-html-container table thead tr:nth-child(2) th {
  color: #fff !important;
  font-weight: bold !important;
}

/* ============================= */
/* Mobile Optimization */
/* ============================= */
@media (max-width: 600px) {
  .availability-content {
    width: 95vw;
    height: 95vh;
    max-width: none;
  }
  .availability-close {
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
  }
  .availability-export {
    padding: 0.5rem;
    text-align: center;
  }
  .export-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
  }
  #availability-html-container th,
  #availability-html-container td {
    padding: 0.4rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  /* Let the table size to content a bit more gracefully on mobile */
  #availability-html-container table {
    table-layout: auto !important;
 min-width: 0 !important
  }

  /* Hide 2nd and 5th VISIBLE columns on mobile */
  #availability-html-container th:nth-child(3),
  #availability-html-container td:nth-child(3),
  #availability-html-container th:nth-child(6),
  #availability-html-container td:nth-child(6) {
    display: none !important;
  }

#availability-html-container thead th:nth-child(2),
  #availability-html-container tbody td:nth-child(2) { width: 40% !important; } /* first visible */
  #availability-html-container thead th:nth-child(4),
  #availability-html-container tbody td:nth-child(4) { width: 20% !important; } /* second visible */
  #availability-html-container thead th:nth-child(5),
  #availability-html-container tbody td:nth-child(5) { width: 20% !important; } /* third visible */
  #availability-html-container thead th:nth-child(7),
  #availability-html-container tbody td:nth-child(7) { width: 20% !important; } /* fourth visible (7th child) */

  #availability-html-container th,
  #availability-html-container td {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    padding: 0.45rem 0.5rem !important;
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
  }
	
 .table-responsive {
    overflow-x: hidden !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}