/* ============================================================
   Study Hub — Profile Picker (dark theme, matches app)
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #fff;
  background-attachment: fixed;
}

.picker-wrap {
  width: 100%;
  max-width: 900px;
  text-align: center;
}

.picker-header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 40px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.profile-card {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 24px 16px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.profile-card:active {
  transform: translateY(-1px) scale(0.98);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.profile-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.profile-class {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.picker-footer {
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 16px;
  font-family: inherit;
}

.link-btn:hover { color: #fff; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.modal.hidden { display: none; }

.modal-card {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px;
  max-width: 440px;
  width: 100%;
  text-align: left;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-card h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: #fff;
}

.modal-note {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

.photo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-row img,
.photo-row .mini-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.photo-row .row-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.photo-row button {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #facc15;
  color: #0f172a;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

.photo-row button.remove {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #3b82f6;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover { background: #2563eb; }

@media (max-width: 500px) {
  .picker-header h1 { font-size: 1.8rem; }
  .profile-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .profile-card { padding: 18px 10px; }
  .profile-avatar { width: 72px; height: 72px; font-size: 2.2rem; }
}