﻿/* TouchTo — profile screen redesign styles (AssistUK) */

/* Page head: eyebrow + big serif title */
.r-profile-head { margin-bottom: 32px; }
.r-profile-lead { margin-top: 4px; }

/* Responsive grid of large, touch-friendly profile cards */
.r-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  /* Override the legacy .profile-picker rule (max-width:600px + fixed 120px
     columns + centering) that still rides on this element and squeezed the
     cards into ~2 columns with large empty gaps. */
  max-width: none;
  width: 100%;
  justify-content: stretch;
  justify-items: stretch;
  align-items: stretch;
}

/* A single profile card */
.r-profile-card {
  position: relative;
  /* Override the legacy .profile-card { width: 140px } so the card fills its
     grid track instead of leaving a large gap inside each column. */
  width: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 230px;
  padding: 28px 22px 22px;
  background: var(--c-bg-primary);
  border: 1px solid var(--c-border);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.r-profile-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.r-profile-card:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.r-profile-card.is-active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(75,105,140,0.16), var(--shadow-md);
}

/* Big circular avatar */
.r-profile-avatar {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 6px 18px rgba(0,0,0,0.16);
}

/* Active check badge */
.r-profile-avatar__check {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-success);
  border: 3px solid var(--c-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Profile name */
.r-profile-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--c-fg1);
  margin: 0;
  word-break: break-word;
}

/* Primary meta (age + age-group) */
.r-profile-meta {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-fg2);
  min-height: 18px;
  margin: -4px 0 0;
}

/* Secondary stats row (sessions + streak) */
.r-profile-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  font-family: var(--f-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-fg3);
  margin: -8px 0 0;
}
.r-profile-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.r-profile-stat i, .r-profile-stat svg {
  width: 14px;
  height: 14px;
  color: var(--c-warning);
}

/* Compact edit/delete actions */
.r-profile-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
  justify-content: center;
}
.r-profile-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-border);
  color: var(--c-fg2);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.r-profile-iconbtn:hover { background: var(--c-bg-tertiary); color: var(--c-fg1); }
.r-profile-iconbtn:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.r-profile-iconbtn--danger:hover { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.r-profile-iconbtn i, .r-profile-iconbtn svg { width: 18px; height: 18px; }

/* "Add profile" card */
.r-profile-card--add {
  background: transparent;
  border: 2px dashed var(--c-border-strong);
  box-shadow: none;
  justify-content: center;
  color: var(--c-fg2);
}
.r-profile-card--add:hover {
  border-color: var(--c-accent);
  background: var(--c-bg-secondary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.r-profile-avatar--add {
  background: var(--c-bg-tertiary);
  color: var(--c-accent);
  box-shadow: none;
}
.r-profile-avatar--add i, .r-profile-avatar--add svg { width: 40px; height: 40px; }
.r-profile-card--add .r-profile-name { color: var(--c-fg2); }

/* Back button spacing in manage/add mode */
.r-profile-back { margin-bottom: 16px; }

/* ── Header toolbar (Import + privacy note) ────────────────────────── */
.r-profile-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 20px;
}
.r-profile-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-fg3);
}
.r-profile-privacy i, .r-profile-privacy svg {
  width: 16px;
  height: 16px;
  color: var(--c-success);
  flex-shrink: 0;
}

/* ── Granular data tools ("Daten verwalten") ───────────────────────── */
.r-profile-datatools { margin-top: 4px; }
.r-profile-datatools__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.r-profile-datatools__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.r-profile-datatools__btn i, .r-profile-datatools__btn svg {
  flex-shrink: 0;
}

/* ── Create / Edit form (inline panel) ────────────────────────────── */
.profile-form {
  max-width: 560px;
  width: 100%;
  margin: 28px auto 0;
  padding: 28px 30px 26px;
  background: var(--c-bg-primary);
  border: 1px solid var(--c-border);
  border-radius: 26px;
  box-shadow: 0 12px 40px var(--c-shadow-lg);
}
.profile-form__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--c-fg1);
  margin: 0 0 20px;
}
.profile-form__group { margin-bottom: 18px; }

/* Field labels (Oswald-ish eyebrow tone) */
.r-profile-fieldlabel {
  display: block;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-fg2);
  margin-bottom: 8px;
}

/* Name + age inputs */
.profile-form__input {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  color: var(--c-fg1);
  background: var(--c-bg-secondary);
  border: 1.5px solid var(--c-border-strong);
  border-radius: 14px;
  min-height: 50px;
  box-sizing: border-box;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.profile-form__input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(75,105,140,0.16);
}
.profile-form__input.form-input--error {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(211,47,47,0.16);
}
.r-profile-age-input { max-width: 160px; }

/* Age-group (audience) segmented chooser */
.r-profile-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.r-profile-seg__btn {
  flex: 1 1 0;
  min-width: 96px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--c-border-strong);
  background: var(--c-bg-secondary);
  color: var(--c-fg1);
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}
.r-profile-seg__btn:hover { border-color: var(--c-accent); background: var(--c-bg-tertiary); }
.r-profile-seg__btn:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.r-profile-seg__btn.is-on {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(75,105,140,0.3);
}

/* Form action buttons */
.profile-form__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  flex-wrap: wrap;
}
.profile-form__actions .btn-primary-blue,
.profile-form__actions .btn-ghost-pill { min-height: 52px; }

@media (max-width: 560px) {
  .r-profile-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .r-profile-card { min-height: 200px; padding: 22px 14px 18px; }
  .r-profile-avatar { width: 84px; height: 84px; font-size: 2rem; }
  .profile-form { padding: 22px 18px 20px; border-radius: 20px; }
  .r-profile-seg__btn { flex-basis: 45%; }
  .profile-form__actions .btn-primary-blue,
  .profile-form__actions .btn-ghost-pill { flex: 1; }
}
