/* tutor_profile.css
   Clean, stable and fully scoped CSS for the tutor profile page and
   availability section.

   Key changes:
   - Visual hour bars now use flex so they distribute evenly across the
     number of visible hour cells (no hardcoded 24-columns).
   - Label row mirrors the same flex behaviour to stay aligned.
   - Preserved states, focus, print rules, and responsive fallbacks.
*/

/* ==============================
   Theme tokens (scoped)
   ============================== */
.tutor-profile-page,
.tp-availability-standalone {
  --tp-accent: var(--accent, #1a73e8);
  --tp-muted: var(--muted, #666);
  --tp-success: #2a9d8f;
  --tp-danger: #ef6c49;
  --tp-bg: var(--card-background, #fff);

  /* layout tuning */
  --tp-page-max: 1300px;
  --tp-page-padding: 20px;
}

/* ==============================
   Page scope + layout tokens
   ============================== */
.tutor-profile-page {
  --tp-card-gap: 20px;
  --tp-media-width: 220px;
  --tp-radius: 10px;

  max-width: var(--tp-page-max);
  margin: 28px auto;
  padding: 0 var(--tp-page-padding);
  box-sizing: border-box;
}

/* ==============================
   Card + general layout
   ============================== */
.tutor-profile-page .tp-card {
  display: flex;
  gap: var(--tp-card-gap);
  align-items: flex-start;
  background: var(--tp-bg);
  border-radius: var(--tp-radius);
  padding: 18px;
  box-shadow: 0 6px 18px rgba(13,20,30,0.06);
}

.tutor-profile-page .tp-media {
  width: var(--tp-media-width);
  flex: 0 0 var(--tp-media-width);
  position: relative;
}
.tutor-profile-page .tp-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.tutor-profile-page .badge {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  color: #fff;
  background: rgba(0,0,0,0.6);
}
.tutor-profile-page .badge.verified { background: var(--tp-accent); }
.tutor-profile-page .badge.school { background: #2a9d8f; }

.tutor-profile-page .tp-main { flex: 1; min-width: 0; }
.tutor-profile-page .tp-name { margin: 0; font-size: 1.6rem; font-weight: 700; }
.tutor-profile-page .tp-headline { margin-top: 6px; color: var(--tp-muted); font-weight: 500; }

/* ==============================
   Section boxes
   ============================== */
.tutor-profile-page .tp-section {
  background: #fff;
  border: 1px solid rgba(12, 18, 26, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 14px;
  box-shadow: 0 6px 18px rgba(13, 20, 30, 0.04);
}

.tutor-profile-page .tp-section:first-of-type {
  margin-top: 0;
}

.tutor-profile-page .tp-section h2,
.tutor-profile-page .tp-section h3 {
  margin-top: 0;
}

/* ==============================
   Buttons / actions
   ============================== */
.tutor-profile-page .tp-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tutor-profile-page .btn { padding: 10px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; line-height: 1; }
.tutor-profile-page .btn.primary { background: var(--tp-accent); color: #fff; box-shadow: 0 4px 12px rgba(13,20,30,0.06); }
.tutor-profile-page .btn.outline { background: transparent; border: 1px solid #e6e9ee; }

/* Book lesson gate (unauthenticated) */
.tutor-profile-page .book-gate {
  position: relative;
}

.tutor-profile-page .book-gate-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, 80vw);
  background: #ffffff;
  border: 1px solid rgba(12, 18, 26, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(13, 20, 30, 0.12);
  display: grid;
  gap: 10px;
  z-index: 1100;
}

.tutor-profile-page .gate-action {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  background: rgba(26, 115, 232, 0.08);
  color: inherit;
  border: 1px solid rgba(26, 115, 232, 0.18);
}

.tutor-profile-page .gate-action--secondary {
  background: #f6f7fb;
  border-color: rgba(12, 18, 26, 0.08);
}

.tutor-profile-page .gate-title {
  font-weight: 700;
}

.tutor-profile-page .gate-sub {
  font-size: 0.86rem;
  color: var(--tp-muted);
}

.tutor-profile-page .offering-link--button {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--tp-accent);
  cursor: pointer;
}


/* ==============================
   Section headings & helpers
   ============================== */
.tutor-profile-page .tp-about h2,
.tutor-profile-page .tp-offerings h3,
.tutor-profile-page .tp-quals h3,
.tutor-profile-page .tp-reviews h3 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 1.05rem;
}
.tutor-profile-page .availability-exceptions { margin-top: 18px; }

.tutor-profile-page .tp-reviews-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tutor-profile-page .review-rotator {
  position: relative;
}

.tutor-profile-page .review-rotator .review-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 0.45s ease, transform 0.45s ease;
  opacity: 0;
  pointer-events: none;
}

.tutor-profile-page .review-rotator .review-item.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ==============================
   AVAILABILITY: tables — stable, table-layout based
   ============================== */
.tp-availability-standalone.container {
  max-width: var(--tp-page-max);
  margin: 18px auto 16px;
  padding: 0 var(--tp-page-padding);
  box-sizing: border-box;
}

.tp-availability-standalone h3 { margin: 0 0 8px 0; font-weight: 700; color: #111; }

.tp-availability-standalone .av-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(13,20,30,0.04);
  border: 1px solid rgba(12,18,26,0.03);
}

.tp-availability-standalone .av-table th,
.tp-availability-standalone .av-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f5;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}

.tp-availability-standalone .av-table thead th {
  background: #fbfcfd;
  font-weight: 600;
  font-size: 0.92rem;
}

.tp-availability-standalone .av-table tbody tr:last-child td { border-bottom: none; }
.tp-availability-standalone .muted { color: var(--tp-muted); }

/* ==============================
   Column widths — Day | Visual | Hours
   ============================== */
.tp-availability-standalone .av-weekly th:nth-child(1),
.tp-availability-standalone .av-weekly td:nth-child(1) {
  width: 12%;
  white-space: nowrap;
  padding-right: 10px;
}

.tp-availability-standalone .av-weekly th:nth-child(2),
.tp-availability-standalone .av-weekly td:nth-child(2) {
  width: 68%;
  padding-left: 8px;
  padding-right: 12px;
}

.tp-availability-standalone .av-weekly th:nth-child(3),
.tp-availability-standalone .av-weekly td:nth-child(3) {
  width: 20%;
  padding-left: 10px;
}

/* make sure exceptions table follows same sizing (explicit for clarity) */
.tp-availability-standalone .av-exceptions th:nth-child(1),
.tp-availability-standalone .av-exceptions td:nth-child(1),
.tp-availability-standalone .av-exceptions th:nth-child(2),
.tp-availability-standalone .av-exceptions td:nth-child(2),
.tp-availability-standalone .av-exceptions th:nth-child(3),
.tp-availability-standalone .av-exceptions td:nth-child(3) {
  /* inherits widths from av-weekly */
}

/* ==============================
   HOUR BAR: flexible distribution
   - uses flexbox so number of visible hour cells controls layout
   - both labels and hour cells share the same flex model so they align
   ============================== */
.tp-availability-standalone .hour-bar.full {
  display: flex;              /* distribute children evenly */
  width: 100%;
  gap: 6px;                   /* gap between hour cells */
  align-items: center;
  height: 20px;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  box-sizing: border-box;
}

/* Each .hour occupies equal share of the available width.
   Flex allows arbitrary visible counts (1..N) to work correctly. */
.tp-availability-standalone .hour-bar.full .hour {
  flex: 1 1 0;
  min-width: 6px;
  height: 18px;
  border-radius: 3px;
  background: rgba(0,0,0,0.04);
  transition: background 120ms ease, transform 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* states */
.tp-availability-standalone .hour-bar.full .hour.available {
  background: linear-gradient(180deg, var(--tp-accent), color-mix(in srgb, var(--tp-accent) 85%, white 15%));
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset;
}

.tp-availability-standalone .hour-bar.full .hour.unavailable { background: rgba(0,0,0,0.06); }
.tp-availability-standalone .hour-bar.full .hour.booked {
  filter: grayscale(30%) opacity(0.92);
  box-shadow: none;
}
.tp-availability-standalone .hour-bar.full .hour.held {
  background: repeating-linear-gradient(
    135deg,
    rgba(26,115,232,0.55),
    rgba(26,115,232,0.55) 4px,
    rgba(26,115,232,0.3) 4px,
    rgba(26,115,232,0.3) 8px
  );
  box-shadow: none;
}

/* exception states */
.tp-availability-standalone .hour-bar.full .hour.exception-available {
  background: linear-gradient(180deg, var(--tp-success), color-mix(in srgb, var(--tp-success) 80%, white 20%));
  box-shadow: 0 2px 6px rgba(42,157,143,0.14);
}
.tp-availability-standalone .hour-bar.full .hour.exception-unavailable {
  background: linear-gradient(180deg, var(--tp-danger), color-mix(in srgb, var(--tp-danger) 80%, white 20%));
  box-shadow: 0 2px 6px rgba(239,108,73,0.12);
}
.tp-availability-standalone .hour-bar.full .hour.muted { background: rgba(0,0,0,0.03); }

/* legend dots (if used elsewhere in page) */
.tp-availability-standalone .legend-dot.available { background: var(--tp-accent); }
.tp-availability-standalone .legend-dot.unavailable { background: rgba(0,0,0,0.06); }
.tp-availability-standalone .legend-dot.exception-available { background: var(--tp-success); }
.tp-availability-standalone .legend-dot.exception-unavailable { background: var(--tp-danger); }

/* ==============================
   HOUR LABELS (use same flex model to mirror visual)
   ============================== */
.tp-availability-standalone .hour-bar.labels {
  display: flex;
  width: 100%;
  gap: 6px;
  align-items: center;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

.tp-availability-standalone .hour-bar.labels .hour-label {
  flex: 1 1 0;
  min-width: 6px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--tp-muted);
  user-select: none;
  pointer-events: none;
}

/* ==============================
   Responsive adjustments
   ============================== */
/* Slightly reduce label density on small screens */
@media (max-width: 820px) {
  .tp-availability-standalone .av-table th,
  .tp-availability-standalone .av-table td {
    padding: 8px 10px;
  }

  .tp-availability-standalone .hour-bar.full { gap: 4px; height: 14px; }
  .tp-availability-standalone .hour-bar.full .hour { min-width: 4px; height: 12px; border-radius: 2px; }
  .tp-availability-standalone .hour-bar.labels { gap: 4px; height: 14px; }
  .tp-availability-standalone .hour-bar.labels .hour-label { font-size: 9px; min-width: 4px; height: 12px; }
}

/* Very small screens: stack content and simplify labels */
@media (max-width: 520px) {
  .tutor-profile-page .tp-card { flex-direction: column; }
  .tp-availability-standalone .availability-tables-grid { grid-template-columns: 1fr; gap: 14px; }
  .tp-availability-standalone .hour-bar.labels { display: none; } /* simplify on very small screens */
}

/* Print: hide color bars and prefer textual ranges */
@media print {
  .tp-availability-standalone .hour-bar.full,
  .tp-availability-standalone .hour-bar.labels,
  .tp-availability-standalone .legend-dot { display: none; }

  .tp-availability-standalone .av-table th,
  .tp-availability-standalone .av-table td { font-size: 11pt; display: table-cell; }
}

/* ==============================
   Tooltip and live region (JS will inject tooltip with class .tp-hour-tooltip)
   ============================== */
.tp-hour-tooltip {
  position: absolute;
  padding: 6px 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 13px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1200;
  transition: opacity 120ms ease;
}

/* Visually hidden helper for screen readers */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* Accessibility: focus styles for hour slots */
.tp-availability-standalone .hour-bar .hour:focus {
  outline: 3px solid rgba(26,115,232,0.2);
  outline-offset: 2px;
}

/* keep modal z-index local to the page */
.tutor-profile-page .modal { z-index: 9999; }

/* ==============================
   Header / offerings / small helpers (scoped under .tutor-profile-page)
   ============================== */

/* Header: title + actions */
.tutor-profile-page .tp-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  width: 100%;
}

.tutor-profile-page .tp-title { min-width: 0; }

.tutor-profile-page .tp-meta {
  margin-top: 10px;
  color: var(--tp-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.tutor-profile-page .tp-meta .dot { color: #d0d6df; margin: 0 4px; }
.tutor-profile-page .tp-dbs { color: #0f766e; font-weight: 600; }

/* Top actions */
.tutor-profile-page .tp-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tutor-profile-page .btn {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tutor-profile-page .btn.primary {
  background: var(--tp-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(26,115,232,0.08);
  border: 0;
}

.tutor-profile-page .btn.outline {
  background: transparent;
  border: 1px solid #e6e9ee;
  color: inherit;
}

.tutor-profile-page .tp-share-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tutor-profile-page .tp-share-label {
  color: var(--tp-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.tutor-profile-page .tp-share-link {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(12, 18, 26, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #fff;
  color: #0b1220;
  padding: 0;
}

.tutor-profile-page .tp-share-link.tp-share-copy {
  cursor: pointer;
}

.tutor-profile-page .tp-share-link:hover,
.tutor-profile-page .tp-share-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(12, 18, 26, 0.12);
  outline: none;
}

.tutor-profile-page .tp-share-icon {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.tutor-profile-page .tp-share-facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}

.tutor-profile-page .tp-share-x {
  background: #111111;
  border-color: #111111;
  color: #fff;
}

.tutor-profile-page .tp-share-linkedin {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #fff;
}

.tutor-profile-page .tp-share-whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.tutor-profile-page .tp-share-telegram {
  background: #24a1de;
  border-color: #24a1de;
  color: #fff;
}

.tutor-profile-page #shareProfileStatus {
  flex-basis: 100%;
}

/* Offerings grid */
.tutor-profile-page .tp-offerings { margin-top: 18px; }

.tutor-profile-page .offerings-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

/* Offering card */
.tutor-profile-page .offering-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(250,252,255,1), rgba(245,247,250,1));
  border: 1px solid rgba(12,18,26,0.04);
  box-shadow: 0 2px 8px rgba(13,20,30,0.03);
  transition: transform 120ms ease, box-shadow 120ms ease;
  min-height: 78px;
}

.tutor-profile-page .offering-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(13,20,30,0.06);
}

.tutor-profile-page .offering-info { min-width: 0; }

.tutor-profile-page .offering-subject {
  font-weight: 700;
  font-size: 0.98rem;
  color: #0b1220;
}

.tutor-profile-page .offering-subject .muted {
  color: var(--tp-muted);
  font-weight: 500;
  font-size: 0.92rem;
  margin-left: 6px;
}

.tutor-profile-page .note {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #374151;
}

/* Price + select */
.tutor-profile-page .offering-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 88px;
}

.tutor-profile-page .price {
  font-weight: 800;
  font-size: 1rem;
  color: #0b1220;
}

.tutor-profile-page .offering-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--tp-accent);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
}

.tutor-profile-page .offering-link:hover { text-decoration: underline; }

/* Small-screen adjustments for offerings */
@media (max-width: 680px) {
  .tutor-profile-page .tp-card { flex-direction: column; }
  .tutor-profile-page .tp-media { width: 100%; flex: 0 0 auto; }
  .tutor-profile-page .tp-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .tutor-profile-page .tp-actions { justify-content: flex-start; }
  .tutor-profile-page .offerings-list { grid-template-columns: 1fr; }
  .tutor-profile-page .offering-meta { align-items: flex-start; text-align: left; }
  .tutor-profile-page .offering-link { display: inline-block; margin-top: 6px; }
}

/* Focus and accessibility */
.tutor-profile-page .btn:focus,
.tutor-profile-page .offering-link:focus,
.tutor-profile-page .offering-card:focus-within {
  outline: 3px solid rgba(26,115,232,0.12);
  outline-offset: 3px;
}

/* ==============================
   NEW: Availability chips & textual ranges
   ============================== */
.availability-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.avail-chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--tp-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(26,115,232,0.06);
  text-decoration: none;
  cursor: default;
}

.avail-chip:focus {
  outline: 3px solid rgba(26,115,232,0.18);
  outline-offset: 3px;
}

.muted-chip {
  background: #eef2f6;
  color: #374151;
  box-shadow: none;
}

.availability-text {
  display: block;
}
.availability-text .range-line {
  margin: 4px 0;
  color: #0b1220;
  font-size: 0.95rem;
}
.availability-text .range-line strong { margin-right: 8px; }

@media (max-width: 680px) {
  .availability-chips { gap: 6px; }
  .avail-chip { padding: 6px 8px; font-size: 0.9rem; }
  .availability-text .range-line { font-size: 0.92rem; }
}

@media print {
  .availability-chips { display: none; }
  .availability-text { display: block; }
}

/* ==============================
   Optional: in-slot hour-text and contrast rules
   ============================== */
.tp-availability-standalone .hour-bar.full .hour .hour-text {
  display: block;
  width: 100%;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  pointer-events: none;
  user-select: none;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

.tp-availability-standalone .hour-bar.full .hour.available .hour-text,
.tp-availability-standalone .hour-bar.full .hour.booked .hour-text,
.tp-availability-standalone .hour-bar.full .hour.exception-available .hour-text,
.tp-availability-standalone .hour-bar.full .hour.exception-unavailable .hour-text {
  color: #fff;
}

.tp-availability-standalone .hour-bar.full .hour.unavailable .hour-text,
.tp-availability-standalone .hour-bar.full .hour.muted .hour-text {
  color: rgba(0,0,0,0.55);
}

/* hide small minute text on very narrow screens to avoid crowding */
@media (max-width: 520px) {
  .tp-availability-standalone .hour-bar.full .hour .hour-text { display: none; }
}
/* =========================================================
   Tutor profile — fully responsive, availability-safe CSS
   ========================================================= */

/* ---------------------------------------------------------
   Global scope + tokens
   --------------------------------------------------------- */
.tutor-profile-page,
.tp-availability-standalone {
  --tp-accent: var(--accent, #1a73e8);
  --tp-muted: #6b7280;
  --tp-bg: #ffffff;

  --radius: 10px;
  --gap: 16px;
  --max-width: 1300px;
}

/* ---------------------------------------------------------
   Page container
   --------------------------------------------------------- */
.tutor-profile-page {
  max-width: var(--max-width);
  margin: 28px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Reduce extra bottom space on tutor profile pages */
.tutor-profile-page-body .site-main .container,
.tutor-profile-page-body .site-main .inner {
  padding-bottom: 0;
}

/* Hide Hours column (Weekly + Exceptions) */
.tp-availability-standalone .av-table th:nth-child(3),
.tp-availability-standalone .av-table td:nth-child(3) {
  display: none;
}

.tp-availability-standalone .av-weekly th:nth-child(1),
.tp-availability-standalone .av-weekly td:nth-child(1),
.tp-availability-standalone .av-exceptions th:nth-child(1),
.tp-availability-standalone .av-exceptions td:nth-child(1) {
  width: 18%;
  white-space: nowrap;
}

.tp-availability-standalone .av-weekly th:nth-child(2),
.tp-availability-standalone .av-weekly td:nth-child(2),
.tp-availability-standalone .av-exceptions th:nth-child(2),
.tp-availability-standalone .av-exceptions td:nth-child(2) {
  width: 82%;
}

/* Unified slots view: hide visual bar column, keep slots column visible on all screens. */
.tp-availability-standalone .av-table th:nth-child(2),
.tp-availability-standalone .av-table td:nth-child(2) {
  display: none !important;
}

.tp-availability-standalone .av-table th:nth-child(3),
.tp-availability-standalone .av-table td:nth-child(3) {
  display: table-cell !important;
}

/* Mobile: show the Hours column so times are readable */
@media (max-width: 600px) {
  .tp-availability-standalone .av-table th:nth-child(3),
  .tp-availability-standalone .av-table td:nth-child(3) {
    display: block;
  }
}


/* ---------------------------------------------------------
   Card layout
   --------------------------------------------------------- */
.tutor-profile-page .tp-card {
  display: flex;
  gap: 20px;
  background: var(--tp-bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 22px rgba(13,20,30,0.06);
}

@media (max-width: 720px) {
  .tutor-profile-page .tp-card {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------
   Media
   --------------------------------------------------------- */
.tp-media {
  width: 220px;
  flex: 0 0 220px;
}

.tp-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

@media (max-width: 720px) {
  .tp-media {
    width: 100%;
    flex: none;
  }
}

/* ---------------------------------------------------------
   Main content
   --------------------------------------------------------- */
.tp-main {
  flex: 1;
  min-width: 0;
}

.tp-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.tp-headline {
  margin-top: 6px;
  color: var(--tp-muted);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: var(--tp-accent);
  color: #fff;
  border: 0;
}

.btn.outline {
  background: transparent;
  border: 1px solid #e5e7eb;
}

/* =========================================================
   AVAILABILITY SECTION
   ========================================================= */
.tp-availability-standalone {
  max-width: var(--max-width);
  margin: 28px auto 40px;
  padding: 0 20px;
}

/* ---------------------------------------------------------
   Availability tables
   --------------------------------------------------------- */
.av-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}

.av-table th,
.av-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
}

.av-table thead th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 0.9rem;
}

.muted {
  color: var(--tp-muted);
}

/* ---------------------------------------------------------
   Column sizing (DESKTOP)
   --------------------------------------------------------- */
.av-weekly th:nth-child(1),
.av-weekly td:nth-child(1) {
  width: 14%;
  white-space: nowrap;
}

.av-weekly th:nth-child(2),
.av-weekly td:nth-child(2) {
  width: 64%;
}

.av-weekly th:nth-child(3),
.av-weekly td:nth-child(3) {
  width: 22%;
  font-size: 0.9rem;
}

/* =========================================================
   Hour bars (core fix)
   ========================================================= */
.hour-bar.full,
.hour-bar.labels {
  display: flex;
  width: 100%;
  gap: 6px;
  align-items: center;
  box-sizing: border-box;
}

.hour-bar.full {
  height: 20px;
}

.hour-bar.labels {
  height: 18px;
}

/* Each visible hour occupies equal width */
.hour,
.hour-label {
  flex: 1 1 0;
  min-width: 6px;
  height: 100%;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   Hour states
   --------------------------------------------------------- */
.hour {
  background: rgba(0,0,0,0.05);
  cursor: pointer;
}

.hour.available {
  background: linear-gradient(
    180deg,
    var(--tp-accent),
    rgba(26,115,232,0.85)
  );
}

.hour.booked {
  background: rgba(26,115,232,0.45);
}
.hour.held {
  background: repeating-linear-gradient(
    135deg,
    rgba(26,115,232,0.55),
    rgba(26,115,232,0.55) 4px,
    rgba(26,115,232,0.3) 4px,
    rgba(26,115,232,0.3) 8px
  );
}

.hour.unavailable {
  background: rgba(0,0,0,0.08);
}

/* ---------------------------------------------------------
   Labels
   --------------------------------------------------------- */
.hour-label {
  font-size: 10px;
  color: var(--tp-muted);
  user-select: none;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Hour text (inside bars)
   --------------------------------------------------------- */
.hour-text {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  pointer-events: none;
}

/* =========================================================
   RESPONSIVE BEHAVIOR
   ========================================================= */

/* Tablet */
@media (max-width: 900px) {
  .hour-bar.full {
    height: 14px;
  }

  .hour-bar.labels {
    height: 14px;
  }

  .hour,
  .hour-label {
    min-width: 4px;
  }
}

/* Mobile — stack rows safely */
@media (max-width: 600px) {
  .av-table thead {
    display: none;
  }

  .av-table tr {
    display: block;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
  }

  .av-table th,
  .av-table td {
    display: block;
    width: 100%;
    padding: 8px 6px;
  }

  .av-table th {
    font-weight: 700;
    padding-bottom: 4px;
  }

  .hour-bar.labels {
    display: none;
  }
}

/* Very small screens — simplify */
@media (max-width: 480px) {
  .hour-text {
    display: none;
  }
}

/* Public tutor profile mobile: prioritize readable range list (HH:MM-HH:MM),
   hide compact visual bars that can show truncated hour text. */
@media (max-width: 700px) {
  .tp-availability-standalone .av-table th:nth-child(2),
  .tp-availability-standalone .av-table td:nth-child(2) {
    display: none !important;
  }

  .tp-availability-standalone .av-table th:nth-child(3),
  .tp-availability-standalone .av-table td:nth-child(3) {
    display: table-cell !important;
  }

  .tp-availability-standalone .hour-bar.full .hour .hour-text {
    display: none !important;
  }
}

/* Slot chips (non-clickable visual style) */
.tp-availability-standalone .slot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-availability-standalone .slot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.85rem;
  line-height: 1.2;
  font-weight: 600;
  user-select: text;
}

/* =========================================================
   Accessibility
   ========================================================= */
.hour:focus {
  outline: 3px solid rgba(26,115,232,0.25);
  outline-offset: 2px;
}

/* =========================================================
   Tooltip
   ========================================================= */
.tp-hour-tooltip {
  position: absolute;
  padding: 6px 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 13px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1200;
}

/* =========================================================
   Utilities
   ========================================================= */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Final media polish (image + video) for desktop/mobile
   --------------------------------------------------------- */
.tutor-profile-page .tp-media {
  position: relative;
}

.tutor-profile-page .tp-profile-media {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f1f5f9;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18);
}

.tutor-profile-page .tp-profile-image,
.tutor-profile-page .tp-profile-video {
  aspect-ratio: 1 / 1;
  min-height: 220px;
}

.tutor-profile-page .tp-profile-video {
  outline: none;
}

.tutor-profile-page .tp-profile-video-shell {
  position: relative;
}

.tutor-profile-page .tp-video-launch {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
  cursor: pointer;
}

.tutor-profile-page .tp-video-launch__icon {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
  margin-left: 2px;
}

.tutor-profile-page .tp-video-launch__label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tutor-profile-page .tp-profile-video-shell.is-mobile-launch .tp-video-launch {
  display: inline-flex;
}

.tutor-profile-page .tp-profile-video-shell.is-mobile-launch.is-playing .tp-video-launch {
  display: none;
}

@media (min-width: 1280px) {
  .tutor-profile-page .tp-profile-image,
  .tutor-profile-page .tp-profile-video {
    min-height: 240px;
  }
}

@media (max-width: 720px) {
  .tutor-profile-page .tp-profile-image,
  .tutor-profile-page .tp-profile-video {
    aspect-ratio: 16 / 10;
    min-height: 200px;
    max-height: 320px;
  }

  .tutor-profile-page .tp-video-launch {
    left: 12px;
    right: auto;
    bottom: 12px;
    min-height: 44px;
    padding: 9px 14px;
  }
}

/* =========================================================
   Final responsive overrides (single source of truth)
   ========================================================= */

.tutor-profile-page .tp-main,
.tutor-profile-page .tp-title,
.tutor-profile-page .tp-meta,
.tutor-profile-page .tp-section,
.tutor-profile-page .offering-card,
.tp-availability-standalone .av-table th,
.tp-availability-standalone .av-table td {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Keep desktop stable while preventing mid-width crowding */
@media (min-width: 901px) {
  .tutor-profile-page .tp-card {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }
}

/* Clean transition zone: stack title/actions earlier to avoid collisions */
@media (max-width: 1157px) {
  .tutor-profile-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tutor-profile-page .tp-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tutor-profile-page .tp-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .tutor-profile-page .tp-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
  }

  .tutor-profile-page .tp-media {
    width: 100%;
    flex: none;
  }

  .tutor-profile-page .tp-profile-image,
  .tutor-profile-page .tp-profile-video {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
  }

  .tp-availability-standalone {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tp-availability-standalone .av-table th,
  .tp-availability-standalone .av-table td {
    padding: 10px;
    font-size: 0.92rem;
  }

  .tp-availability-standalone .av-weekly th:nth-child(1),
  .tp-availability-standalone .av-weekly td:nth-child(1) {
    width: 22%;
  }

  .tp-availability-standalone .av-weekly th:nth-child(2),
  .tp-availability-standalone .av-weekly td:nth-child(2) {
    width: 78%;
  }

  .tp-availability-standalone .av-table th:nth-child(3),
  .tp-availability-standalone .av-table td:nth-child(3) {
    display: none;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .tutor-profile-page {
    margin-top: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .tutor-profile-page .tp-section {
    padding: 12px;
    margin-top: 10px;
  }

  .tutor-profile-page .tp-name {
    font-size: 1.35rem;
  }

  .tutor-profile-page .offerings-list {
    grid-template-columns: 1fr;
  }

  .tp-availability-standalone {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tp-availability-standalone .av-table thead {
    display: none;
  }

  .tp-availability-standalone .av-table tr {
    display: block;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
  }

  .tp-availability-standalone .av-table tr.hour-labels-row {
    display: none;
  }

  .tp-availability-standalone .av-table th,
  .tp-availability-standalone .av-table td {
    display: block;
    width: 100%;
    border: 0;
    padding: 6px 0;
  }

  /* Mobile readability: show textual time column, hide visual bar column */
  .tp-availability-standalone .av-table th:nth-child(2),
  .tp-availability-standalone .av-table td:nth-child(2) {
    display: none;
  }

  .tp-availability-standalone .av-table th:nth-child(3),
  .tp-availability-standalone .av-table td:nth-child(3) {
    display: block;
  }

  .tp-availability-standalone .hour-bar.labels {
    display: none;
  }

  .tp-availability-standalone .hour-bar.full {
    height: 14px;
    gap: 4px;
  }

  .tp-availability-standalone .hour-bar.full .hour {
    min-width: 4px;
    height: 12px;
  }
}
/* End of file */
