/* -------------- Search bar (slider overlay) -------------- */
/* Styles your existing <form id="lessonSearchForm"> into a single-row white search bar */
#lessonSearchForm{
  width: min(1100px, 94vw);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);

  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: nowrap;

  /* If overlay wrapper uses pointer-events:none, this makes the form clickable */
  pointer-events: auto;
}

/* Visually hide labels but keep them in the DOM */
#lessonSearchForm > label{
  position: absolute;
  left: -9999px;
}

/* White inputs, flexible columns */
#lessonSearchForm select{
  flex: 1 1 0;
  min-width: 180px;
    margin-left: auto;
  margin-right: auto;
  width: 100%;
  background: #fff !important;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 12px;
  line-height: 1.2;
}

/* Submit button */
#lessonSearchForm button[type="submit"]{
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 12px 16px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.lesson-search-wrapper{
  display: flex;
  justify-content: center;
  margin-top: -34px;   /* pulls it up over the slider */
  position: relative;
  z-index: 5;
  padding: 0 18px;
}

/* Mobile: wrap cleanly */
@media (max-width: 900px){
  #lessonSearchForm{
    flex-wrap: wrap;
    align-items: stretch;
  }
  #lessonSearchForm select{
    flex: 1 1 260px;
    min-width: 220px;
  }
  #lessonSearchForm button[type="submit"]{
    width: 100%;
  }
}


/* -------------- Table base -------------- */
.fs-lessons-table {
  width: 100%;
  border-collapse: collapse;
}
.fs-lessons-table th,
.fs-lessons-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
  text-align: left;
  word-break: break-word;
}
.fs-lessons-table thead th {
  font-weight: 600;
  color: #0f172a;
}
.toggle-heading {
  margin: 28px 0 10px;
  font-size: 1.4rem;
  font-weight: 700;
}

/* -------------- Mobile: “cards” -------------- */
@media (max-width: 768px) {
  .fs-lessons-table thead { display: none; }

  .fs-lessons-table,
  .fs-lessons-table tbody,
  .fs-lessons-table tr,
  .fs-lessons-table td {
    display: block;
    width: 100%;
  }

  .fs-lessons-table tbody tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 16px 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
  }

  .fs-lessons-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
  }

  /* Label on the left */
  .fs-lessons-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    margin-right: 16px;
    flex: 0 0 auto;
  }

  /* coloured “Day” header bar per card */
  .fs-lessons-table tbody tr > td:first-child {
    background: #eef2ff;         /* indigo-50 */
    color: #111827;
    font-weight: 700;
    border-bottom: 1px solid #e5e7eb;
  }

  /* keep actions tidy */
  .fs-lessons-table td[data-label="Dates"],
  .fs-lessons-table td[data-label="Book"] {
    justify-content: flex-start;
    gap: 10px;
  }
}

/* -------------- Dates Modal -------------- */
#fsDatesOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  display: none;
  z-index: 999999; /* above admin bar/customizer */
}
#fsDatesOverlay.is-open { display: block; }
.fs-modal-open { overflow: hidden; }

/* Centered on all screens */
#fsDatesOverlay .fs-modal {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fs-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.fs-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.fs-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.fs-modal__body {
  padding: 12px 14px;
  overflow: auto;
}

/* Dates table inside modal */
.fs-dates-table {
  width: 100%;
  border-collapse: collapse;
}
.fs-dates-table th,
.fs-dates-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}
.fs-dates-table tr.is-closed td {
  color: #b91c1c;
  font-style: italic;
}
.fs-dates-btn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}
.fs-results-wrap{
  width: min(1100px, 94vw);
  margin: 18px auto 0;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.fs-results-wrap .fs-lessons-table{
  background: #fff;
}


/* Shared container-relative gutters; never size results against the viewport. */
.lesson-search-wrapper {width:100%;box-sizing:border-box;padding-inline:18px;}
#lessonSearchForm {width:100%;max-width:1100px;box-sizing:border-box;}
#lessonResults.fs-results-wrap {width:calc(100% - 36px);max-width:1100px;box-sizing:border-box;}
.fs-results-wrap[hidden],.fs-results-wrap:empty {display:none!important;}
#lessonSearchForm select {min-width:0;}
#lessonSearchForm button:disabled {cursor:wait;opacity:.7;}
@media(max-width:900px){#lessonSearchForm select{min-width:0;flex:1 1 220px;}}
