/* scheduling-overrides.css
   Overrides to adapt the availability UI to the site theme and make it responsive/touch-friendly.
*/

/* Basic table / card look to match site */
.availability-table {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e9eef4;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(11,31,53,0.06);
  font-size: 0.95rem;
}

.availability-table th,
.availability-table td {
  padding: 8px;
  border-top: 1px solid #eef3f7;
  text-align: center;
  vertical-align: middle;
}

/* Sticky time column look for larger screens */
.time-col {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: transparent;
}

/* Table wrapper allows horizontal scrolling on small screens */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* slot cell */
.slot-cell {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  transition: transform .06s ease, background .08s ease;
  min-width: 56px;
  min-height: 44px;
}

/* visual for selected slot */
.slot-cell.selected {
  background: linear-gradient(180deg, rgba(11,95,255,0.18), rgba(11,95,255,0.08));
  outline: 2px solid rgba(11,95,255,0.14);
  transform: translateY(-1px);
}

/* count badge inside cell (admin heatmap) */
.slot-cell .count {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Hover / focus affordances */
.slot-cell:hover,
.slot-cell:focus {
  transform: translateY(-0.6px);
  outline: none;
}

/* Form card adjustments: spacing and input widths */
.form-card {
  padding: 1rem;
}

/* ensure inputs use site form-input style but with full width */
.form-card .form-input,
.form-card input[type="text"],
.form-card input[type="email"],
.form-card textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
}

/* Labels */
.form-card .form-label {
  display: block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--muted);
}

/* Actions layout */
.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

/* Make ghost button slightly smaller on mobile */
.btn.ghost {
  padding: 0.5rem 0.9rem;
}

/* small text */
.small {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Layout: two-column on wider screens, stacked on mobile */
.page-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* content column takes full width when narrow */
.content-column { min-width: 0; }
.sidebar-column { min-width: 0; }

@media (max-width: 880px) {
  .page-row {
    grid-template-columns: 1fr;
  }
  .sidebar-column {
    order: 2;
  }
  .content-column {
    order: 1;
  }
  .availability-table th,
  .availability-table td {
    padding: 10px;
  }
  .slot-cell {
    min-width: 64px;
    min-height: 56px;
  }
  .form-card {
    padding: 0.85rem;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn {
    width: 100%;
  }
}

/* Accessibility: make table elements focusable and visible on focus */
.slot-cell:focus {
  box-shadow: 0 0 0 3px rgba(11,95,255,0.12);
  border-radius: 4px;
}

/* Danger style for delete controls */
.btn.danger {
  border-color: rgba(255,40,40,0.15);
  color: #b33333;
}
.btn.danger:hover {
  background: rgba(255,40,40,0.06);
}

.cell-badge { display:inline-flex; min-width:20px; height:20px; padding:0 6px; align-items:center; justify-content:center; border-radius:12px; font-size:0.85rem; color:#fff; box-shadow: 0 1px 0 rgba(0,0,0,0.08); margin:2px; }
.client-item.client-selected { background: rgba(11,95,255,0.06); border-radius:6px; }

/* client-number badges inside grid */
.client-number {
  margin: 2px;
  padding: 0 6px;
  height: 20px;
  line-height: 20px;
  display: inline-block;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

/* client list rows */
.client-row { padding: 6px 4px; border-bottom: 1px solid rgba(0,0,0,0.04); }
.client-row .muted { color: var(--muted); font-size: 12px; }

/* Assignment pill (therapist) */
.assignment-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 14px rgba(8,15,30,0.06);
  cursor: default;
  transform: translateY(-6px) scale(0.98);
  opacity: 0;
  transition: transform 160ms cubic-bezier(.22,.9,.34,1), opacity 160ms ease;
  pointer-events: auto;
}

/* Visible state animates in */
.assignment-pill.assignment-pill--visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* initials bubble */
.assignment-pill .pill-initials {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  border-radius:6px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight:700;
  font-size:0.85rem;
  padding:0 4px;
}

/* therapist name (hide on narrow view) */
.assignment-pill .pill-name {
  display:inline-block;
}
@media (max-width:640px){
  .assignment-pill .pill-name { display:none; }
}

/* count badge inside pill */
.assignment-pill .pill-count {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  margin-left:4px;
  border-radius:50%;
  background:#fff;
  color:inherit;
  color: #111;
  font-weight:700;
  font-size:0.75rem;
  padding:0 6px;
}

/* after-slot indicator: a thin bar at the bottom of the cell */
.after-indicator {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 6px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0.95;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* ensure td.inner has position:relative so after-indicator positions correctly */
.slot-cell .inner { position: relative; min-height: 36px; }

/* little improvement: make pills focusable and accessible */
.assignment-pill:focus { outline: 3px solid rgba(255,255,255,0.12); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
