/* Learning-centre pages and shared responsive fixes. */
.center-register-page > h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 900; line-height: 1.25; margin-bottom: 16px; }
.center-register-page > p { color: var(--muted); line-height: 1.65; }
.centers-page, .center-register-page, .center-single-page { font-family: inherit; color: var(--dark); }
.centers-page input, .centers-page select, .center-register-page input, .center-register-page select, .center-register-page textarea { font-family: inherit; }
.centers-page,
.center-register-page,
.center-single-page {
  min-width: 0;
  overflow-x: hidden;
  padding: 3.5rem 0 5rem;
}

.centers-page .container,
.center-register-page.container,
.center-single-page.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

.centers-hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(135deg, #f5f8ff, #fff);
}

.section-kicker {
  color: #3564d9;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.centers-hero h1,
.center-register-intro h1,
.center-detail-head h1 {
  max-width: 100%;
  margin: .65rem 0 .85rem;
  overflow-wrap: anywhere;
  line-height: 1.08;
  font-size: clamp(2rem, 5vw, 4rem);
}

.centers-hero p,
.center-register-intro p {
  max-width: 760px;
  margin-bottom: 0;
  color: #64748b;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.centers-search {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr));
  align-items: end;
  gap: .75rem;
  max-width: 1200px;
  margin-top: 1.75rem;
}

.centers-search label {
  display: grid;
  min-width: 0;
  gap: .4rem;
  color: #64748b;
  font-size: .82rem;
  font-weight: 800;
}

.centers-search .mentora-select,
.centers-search-actions {
  min-width: 0;
}

.centers-search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .6rem;
}

.centers-search input,
.centers-search select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: .75rem 1rem;
  border: 1px solid #dbe2ef;
  border-radius: 14px;
  background: #fff;
  font: inherit;
}

.centers-search-actions .book-btn,
.centers-clear-btn {
  min-height: 50px;
  padding: .75rem 1rem;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.centers-clear-btn {
  background: #eef4ff;
  color: #2563eb;
}

#adminCentersPanel,
#adminReferralsPanel {
  margin-top: 1.25rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

#adminCentersPanel .section-header.compact,
#adminReferralsPanel .section-header.compact {
  margin-bottom: .75rem;
}

#adminCentersPanel .section-header.compact h2,
#adminReferralsPanel .section-header.compact h2 {
  margin: .45rem 0 .35rem;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  overflow-wrap: anywhere;
}

#adminCentersPanel .section-header.compact p,
#adminReferralsPanel .section-header.compact p {
  margin: 0;
}

#adminCentersPanel .admin-empty-state,
#adminReferralsPanel .admin-empty-state {
  margin: 0;
  padding: .25rem 0;
}

.centers-results {
  padding-top: 2.75rem;
  padding-bottom: 2rem;
}

.centers-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.centers-results-head h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.center-register-cta,
.centers-results-head .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  background: #eef4ff;
  color: #2563eb;
  font-weight: 900;
  white-space: normal;
  text-align: center;
}

.center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
}

.center-card,
.center-detail-card,
.center-form {
  min-width: 0;
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 22px;
  box-shadow: 0 12px 35px rgba(35, 47, 75, .07);
}

.center-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}

.center-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(37, 99, 235, .13);
}

.center-card-image {
  height: 190px;
  background: linear-gradient(135deg, #e8edff, #f7f8fc);
  overflow: hidden;
}

.center-card-image img,
.center-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.center-card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.2rem;
}

.center-card h3 {
  max-width: 100%;
  margin: .35rem 0 .55rem;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}

.center-meta,
.center-card p {
  max-width: 100%;
  color: #64748b;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.center-card p {
  flex: 1;
}

.center-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .8rem 0;
}

.center-chip {
  padding: .35rem .6rem;
  border-radius: 999px;
  background: #f0f2ff;
  color: #5346a8;
  font-size: .78rem;
}

.center-rating {
  color: #e39b21;
  font-weight: 800;
}

.center-register-intro {
  margin-bottom: 2rem;
}

.center-form {
  padding: clamp(1.15rem, 3vw, 2rem);
}

.center-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.center-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .45rem;
  color: #27324a;
  font-weight: 800;
}

.center-form input,
.center-form textarea,
.center-form select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: .75rem .85rem;
  border: 1px solid #dbe2ef;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.center-form textarea {
  min-height: 120px;
  resize: vertical;
}

.center-form .wide {
  grid-column: 1 / -1;
}

.center-form small {
  color: #64748b;
  font-weight: 400;
}

.form-message {
  min-height: 1.5rem;
  margin: 1rem 0;
  color: #b42318;
  overflow-wrap: anywhere;
}

.form-message.success {
  color: #147d4d;
}

.center-detail-card {
  padding: clamp(1.2rem, 4vw, 3rem);
}

.center-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.center-detail-head h1 {
  margin: .3rem 0;
}

.center-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}

.center-gallery img {
  height: 180px;
  border-radius: 14px;
}

.center-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr);
  gap: 2rem;
}

.center-detail-columns h2 {
  overflow-wrap: anywhere;
}

.center-contact-box {
  height: max-content;
  padding: 1.2rem;
  border-radius: 16px;
  background: #f7f8fc;
  overflow-wrap: anywhere;
}

.center-teachers {
  color: #475569;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Keep the home CTA and admin cards readable on narrow screens too. */
.become-box h2,
.admin-request-card h3,
.admin-request-card p {
  overflow-wrap: anywhere;
}

.center-home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
}

.center-home-actions a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  background: #eef4ff;
  color: #2563eb;
  font-weight: 900;
  text-decoration: none;
}

.center-home-actions a:last-child {
  background: #2563eb;
  color: #fff;
}

#adminCentersPanel > .admin-actions {
  margin-bottom: 1rem;
}

#adminAddCenterBtn {
  min-height: 46px;
}

.register-center-cta {
  display: grid;
  gap: .35rem;
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid #dbe7fb;
  border-radius: 18px;
  background: #f7faff;
}

.register-center-cta strong {
  color: #17233d;
}

.register-center-cta span {
  color: #64748b;
}

.register-center-cta .book-btn {
  justify-self: start;
  margin-top: .3rem;
  text-decoration: none;
}

.admin-page .container {
  width: 100%;
  max-width: 1240px;
  padding-inline: clamp(18px, 3vw, 32px);
}

.admin-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-referral-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.admin-center-card {
  background: linear-gradient(135deg, #f8fbff 0%, #fff 70%);
  border-color: #dbe7fb;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .07);
}

.admin-center-card .admin-actions {
  justify-content: flex-end;
}

@media (max-width: 992px) {
  .centers-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-page [hidden] { display: none !important; }

#adminCenterModal { z-index: 4000; }

@media (max-width: 700px) {
  .centers-page,
  .center-register-page,
  .center-single-page {
    padding-top: 2.2rem;
    padding-bottom: 4rem;
  }

  .centers-hero {
    padding-top: 2.3rem;
    padding-bottom: 2.4rem;
  }

  .centers-hero h1,
  .center-register-intro h1,
  .center-detail-head h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .centers-search,
  .center-form-grid,
  .center-detail-columns {
    grid-template-columns: 1fr;
  }

  .centers-search-actions {
    align-items: stretch;
  }

  .centers-search-actions > * {
    width: 100%;
  }

  .centers-results-head,
  .center-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .centers-results-head .text-link {
    width: 100%;
  }

  .center-form .wide {
    grid-column: auto;
  }

  .center-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .center-gallery img {
    height: 130px;
  }

  .admin-summary,
  .admin-referral-summary {
    grid-template-columns: 1fr 1fr;
  }

  .admin-center-card .admin-actions {
    justify-content: flex-start;
  }

  .center-home-actions,
  .center-home-actions a,
  .register-center-cta .book-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .admin-summary,
  .admin-referral-summary {
    grid-template-columns: 1fr;
  }
}
