/* ─────────────────────────────────────────────────────────
   avatar-picker.css — MEA Hub
   Modal mengambang (compact, ~300px) buat ganti foto profil
   (preset / upload).
   ───────────────────────────────────────────────────────── */

.avp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.6);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: avp-fade-in 0.15s ease both;
}

@keyframes avp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.avp-sheet {
  width: 100%;
  max-width: 300px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 16px;
  animation: avp-pop-in 0.18s ease both;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes avp-pop-in {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.avp-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.avp-subtitle {
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Preset grid ────────────────────────────────────────── */
.avp-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.avp-preset-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  background: var(--surface-2);
  -webkit-tap-highlight-color: transparent;
}
.avp-preset-item:active { transform: scale(0.95); }
.avp-preset-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.avp-preset-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback kalau gambar preset gagal load — tetap kelihatan
   & bisa diklik (bukan disembunyikan total) */
.avp-preset-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: var(--surface-2);
}

/* ── Actions ────────────────────────────────────────────── */
.avp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  border: 1px solid transparent;
}
.avp-btn:active { transform: scale(0.99); }
.avp-btn:disabled { opacity: 0.6; cursor: default; }

.avp-btn-primary {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(129, 212, 250, 0.25);
}

.avp-btn-danger {
  background: rgba(255, 82, 82, 0.08);
  color: var(--red);
  border-color: rgba(255, 82, 82, 0.2);
}

.avp-btn-ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

.avp-hint {
  font-size: 0.7rem;
  color: var(--text-3);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

.avp-hint.error {
  color: var(--red);
}

.avp-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
