/* --- /profiles: Netflix-style "who's practicing" picker ---
   #profilesWrap is a flex child of the shared #pageBody (see base.css),
   which already sizes it to fill the viewport below the top bar. */

#profilesWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

#profilesCard {
  width: 520px;
  max-width: 92vw;
  text-align: center;
}

#profilesTitle {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 6px;
}

#profilesSubtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 36px;
}

#profileTiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.profile-tile {
  position: relative;
  width: 104px;
}

.profile-tile-select {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
}

.profile-tile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--panel-raised);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.profile-tile-select:hover .profile-tile-avatar,
.profile-tile-select:focus-visible .profile-tile-avatar {
  border-color: var(--accent);
  transform: scale(1.05);
}
.profile-tile.active .profile-tile-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.profile-tile-name {
  font-size: 0.85rem;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tile-delete {
  position: absolute;
  top: -4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: #e53e3e;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.profile-tile:hover .profile-tile-delete,
.profile-tile-delete:focus-visible {
  opacity: 1;
}
.profile-tile-delete:hover { background: #e53e3e; color: #fff; }

.profile-tile-add .profile-tile-avatar {
  border-style: dashed;
  font-size: 2rem;
  font-weight: 400;
}

/* Sits between the Add-profile and Import-profile tiles (see
   profilesPage.js) - height matches .profile-tile-avatar so it lines up
   with the circles rather than the tiles' full column height (which
   includes the name label below). */
.profile-tile-or {
  display: flex;
  align-items: center;
  height: 84px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

#profilesEmptyHint {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Profile detail modal (mic + languages for one profile) --- */

#profileDetailOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#profileDetailOverlay.visible { display: flex; }

#profileDetailModal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
#profileDetailModal h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 16px;
}
#profileDetailModal .sidebar-section h3 {
  margin-bottom: 8px;
}
#profileDetailLanguages .conv-option {
  cursor: pointer;
}


/* ===== /profiles: blue identity and animated background ===== */
#pageBody > #profilesWrap {
  flex: 1;
  min-height: 0;
}

#profilesWrap {
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, .22);
  --text: #f8fbff;
  --text-muted: #c5d7f3;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse at 12% 18%, rgba(37, 99, 235, .38), transparent 42%),
    radial-gradient(ellipse at 88% 78%, rgba(14, 165, 233, .25), transparent 40%),
    linear-gradient(135deg, #08152f 0%, #102b55 48%, #071a36 100%);
}

#profilesWrap::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 28% 38%, rgba(59, 130, 246, .20), transparent 28%),
    radial-gradient(circle at 76% 62%, rgba(56, 189, 248, .16), transparent 32%);
  animation: profilesBlueGlow 14s ease-in-out infinite alternate;
}

#profilesCard {
  position: relative;
  z-index: 1;
}

#profilesTitle {
  color: #f8fbff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .22);
}

#profilesSubtitle {
  color: #c5d7f3;
}

.profile-tile-avatar {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(191, 219, 254, .35);
  color: #eaf3ff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  backdrop-filter: blur(8px);
}

.profile-tile-select:hover .profile-tile-avatar,
.profile-tile-select:focus-visible .profile-tile-avatar {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .20),
              0 10px 28px rgba(0, 0, 0, .20);
}

.profile-tile.active .profile-tile-avatar {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .28),
              0 0 24px rgba(37, 99, 235, .30);
}

.profile-tile-name {
  color: #f1f6ff;
}

.profile-tile-or,
#profilesEmptyHint {
  color: #c5d7f3;
}

.profile-tile-add .profile-tile-avatar {
  border-color: rgba(147, 197, 253, .65);
  color: #bfdbfe;
}

#profilesWrap button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 4px;
}

@keyframes profilesBlueGlow {
  from {
    transform: translate3d(-1%, 0, 0) scale(1);
    opacity: .65;
  }
  to {
    transform: translate3d(1%, 1%, 0) scale(1.08);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #profilesWrap::before {
    animation: none;
  }
}


/* --- Profile detail modal: blue accent --- */
#profileDetailOverlay {
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, .22);
}
