/* ================================================
   client.css — Client role styles for AmverCoach
   ================================================ */

/* ── Client Dashboard ── */
.client-dashboard {
  padding: var(--space-6) var(--space-4) calc(var(--nav-height) + var(--space-4));
}

.client-dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}

/* ── Next Session Card ── */
.next-session-card {
  background: linear-gradient(135deg, var(--primary) 0%, #9F5BF0 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  color: var(--white);
  position: relative;
  min-height: 100px;
}

.next-session-card--clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.next-session-card--clickable:active {
  transform: scale(0.98);
}

.next-session-card__label {
  font-size: var(--text-xs);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.next-session-card__type {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

.next-session-card__time {
  font-size: var(--text-sm);
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-session-card__empty {
  font-size: var(--text-base);
  opacity: 0.75;
  margin-top: var(--space-2);
}

.next-session-card__arrow {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
}

/* ── Client Calendar ── */
.client-calendar {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Calendar time grid (reuse trainer styles with scoped prefix) */
.cal-time-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  border-top: 1px solid var(--gray-100);
  min-height: 48px;
}

.cal-time-label {
  font-size: 11px;
  color: var(--gray-400);
  padding: var(--space-1) var(--space-2);
  text-align: right;
  padding-top: var(--space-2);
}

.cal-time-cell {
  padding: var(--space-1) var(--space-2);
  position: relative;
}

.cal-day-nav,
.cal-multiday-nav,
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-100);
}

.cal-day-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--gray-800);
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gray-600);
}

.cal-time-grid {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

/* Month calendar */
.cal-month-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--gray-100);
}

.cal-month-day-name {
  text-align: center;
  padding: var(--space-2);
  font-size: 11px;
  font-weight: var(--font-semibold);
  color: var(--gray-500);
  text-transform: uppercase;
}

.cal-month-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-month-cell {
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 4px;
  min-height: 48px;
}

.cal-month-cell--other .cal-month-cell-num {
  color: var(--gray-300);
}

.cal-month-cell--today .cal-month-cell-num {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
}

.cal-month-cell-num {
  font-size: 12px;
  font-weight: var(--font-medium);
  color: var(--gray-800);
  margin-bottom: 2px;
}

.cal-month-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

/* ── Client Programs ── */
/* (Uses existing card styles + custom header) */

/* ── Client Chat ── */
/* с.85 (v805): контент чата растянут на высоту экрана — инпут прижат к низу над таб-баром */
#client-chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* с.85 (v806): открытая переписка клиента — полноэкранная, как у тренера:
   таб-бар скрыт, отступ под него снят. Класс ставит/снимает ClientChat + App.navigateTo */
body.client-conv-open #client-bottom-nav {
  display: none !important;
}
body.client-conv-open #screen-client-chat {
  padding-bottom: 0;
}

.client-chat-screen .chat-conv-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
}

.client-chat-screen .chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.client-chat-screen .chat-input {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-end;
  padding: var(--space-2) var(--space-3);
  gap: var(--space-2);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
}

/* ── Client Profile ── */
.client-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) var(--space-4) var(--space-4);
}

/* ── Gender Toggle (reuse .toggle) ── */
.toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 3px;
}

.toggle__option {
  flex: 1;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle__option.active {
  background: var(--white);
  color: var(--primary);
  font-weight: var(--font-semibold);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Client Registration ── */
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: background 0.2s;
}

.progress-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 5px;
}

.progress-dot.completed {
  background: var(--primary);
  opacity: 0.5;
}

.progress-line {
  width: 24px;
  height: 2px;
  background: var(--gray-200);
  border-radius: 1px;
}

.progress-line.completed {
  background: var(--primary);
}

/* ── Role switch chip in header ── */
.role-switch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

/* ── Bottom nav visibility for dual roles ── */
body[data-role="trainer"] .bottom-nav--trainer.visible,
body.logged-in .bottom-nav--trainer.visible {
  display: flex;
}

body[data-role="client"] .bottom-nav--trainer.visible {
  display: none !important;
}

body[data-role="client"] .bottom-nav--client.visible {
  display: flex !important;
}
