/* ════════════════════════════════════════
   ANIROXA — profile.css
════════════════════════════════════════ */

/* ── Profile header ─────────────────────────────────────────── */
.profile-header-inner {
  grid-template-columns: 36px 1fr 36px !important;
}
.profile-header-spacer {
  width: 36px;
}
.profile-header-title {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: center;
}
.back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.back-btn:hover { color: var(--text); border-color: var(--border2); }
.back-btn svg { width: 17px; height: 17px; }

/* ── Main layout ─────────────────────────────────────────────── */
.profile-main {
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 56px;
  padding-left: 16px;
  padding-right: 16px;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ── Avatar section ──────────────────────────────────────────── */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-ring {
  position: relative;
  width: 100px;
  height: 100px;
}

/* gradient ring */
.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 50%, #7c3aed 100%);
  z-index: 0;
  opacity: 0.75;
}

.avatar-circle {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--bg3);
  border: 3px solid var(--bg);
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.avatar-circle img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar-icon-default {
  width: 40px; height: 40px;
  color: var(--text3);
}
.avatar-initials {
  font-family: var(--font-d);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  user-select: none;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 3px; right: 3px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(230,62,109,0.45);
  transition: background-color 0.15s, transform 0.15s;
}
.avatar-edit-btn:hover { background: var(--accent2); transform: scale(1.1); }
.avatar-edit-btn svg { width: 13px; height: 13px; stroke: #fff; }

.avatar-hint {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ── Profile card ────────────────────────────────────────────── */
.profile-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 20px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.profile-name-row {
  text-align: center;
  padding: 16px 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-name {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.profile-admin-badge {
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(230,62,109,0.12);
  border: 1px solid rgba(230,62,109,0.32);
  color: var(--accent);
  user-select: none;
  align-self: center;
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -4px;
}

/* ── Form section ────────────────────────────────────────────── */
.profile-section {
  padding: 16px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.profile-label {
  font-family: var(--font-d);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text3);
}
.profile-field-wrap {
  display: flex;
  gap: 8px;
}
.profile-input {
  flex: 1;
  height: 42px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 0 14px;
  font-family: var(--font-b);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}
.profile-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,62,109,0.12);
  background: var(--surface);
}
.profile-input::placeholder { color: var(--text3); }
.profile-save-btn {
  height: 42px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 600;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(230,62,109,0.3);
  transition: background-color 0.18s, transform 0.14s, box-shadow 0.18s;
}
.profile-save-btn:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(230,62,109,0.45);
}
.profile-save-btn:active { transform: scale(0.97); }
.profile-field-hint {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.4;
}

/* ── Telegram row ────────────────────────────────────────────── */
.profile-tg-row {
  flex-direction: row !important;
  align-items: center;
  gap: 12px !important;
  padding: 14px 0 6px !important;
}
.profile-tg-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(44,165,224,0.08);
  border: 1px solid rgba(44,165,224,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #2CA5E0;
  opacity: 0.55;
}
.profile-tg-icon svg { width: 16px; height: 16px; }
.profile-tg-info {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0.5;
}
.profile-tg-title {
  font-family: var(--font-b);
  font-size: 13px; font-weight: 500;
  color: var(--text);
}
.profile-tg-sub {
  font-size: 11px;
  color: var(--text3);
}
.profile-sync-badge {
  font-family: var(--font-b);
  font-size: 10px; font-weight: 600;
  padding: 3px 9px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 100px;
  color: var(--text3);
  white-space: nowrap;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.profile-sync-badge.synced {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

/* ── Telegram row synced state ───────────────────────────────── */
.profile-tg-row.synced .profile-tg-icon {
  opacity: 1;
  background: rgba(44,165,224,0.14);
  border-color: rgba(44,165,224,0.3);
}
.profile-tg-row.synced .profile-tg-info { opacity: 1; }

/* ── Sync button ─────────────────────────────────────────────── */
.profile-sync-btn-wrap {
  padding: 4px 0 12px;
}
.profile-sync-btn {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(44,165,224,0.08);
  border: 1px solid rgba(44,165,224,0.22);
  border-radius: 11px;
  color: #2CA5E0;
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, transform 0.14s, opacity 0.18s;
}
.profile-sync-btn:hover {
  background: rgba(44,165,224,0.16);
  border-color: rgba(44,165,224,0.38);
  transform: translateY(-1px);
}
.profile-sync-btn:active { transform: scale(0.98); }
.profile-sync-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.profile-sync-btn.loading svg {
  animation: sync-spin 0.75s linear infinite;
}
@keyframes sync-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Bio textarea ────────────────────────────────────────────── */
.profile-bio-input {
  height: auto;
  min-height: 82px;
  resize: none;
  line-height: 1.55;
  padding: 10px 14px;
  font-size: 13px;
}
.profile-field-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Show-telegram toggle row ────────────────────────────────── */
.profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 10px;
}
.profile-toggle-label {
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}
.profile-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.profile-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.profile-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 26px;
  cursor: pointer;
  transition: background .2s;
}
.profile-toggle-track::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.profile-toggle input:checked + .profile-toggle-track { background: var(--accent); }
.profile-toggle input:checked + .profile-toggle-track::before { transform: translateX(18px); }

/* ── Public profile ──────────────────────────────────────────── */
.pub-loading,
.pub-not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 0;
  color: var(--text3);
  font-size: 14px;
}
.pub-bio-section { padding: 14px 0 8px; }
.pub-bio {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0 0;
}
.pub-bio-empty { color: var(--text3); font-style: italic; }

.pub-tg-section { padding: 12px 0 6px; }
.pub-tg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 11px;
  background: rgba(44,165,224,0.1);
  border: 1px solid rgba(44,165,224,0.25);
  color: #2CA5E0;
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .18s, border-color .18s, transform .14s;
}
.pub-tg-btn:hover {
  background: rgba(44,165,224,0.18);
  border-color: rgba(44,165,224,0.4);
  transform: translateY(-1px);
}

/* ── Reset button ────────────────────────────────────────────── */
/* ── Privacy notice ──────────────────────────────────────────── */
.profile-privacy-notice {
  width: 100%;
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 12px;
  color: #f59e0b;
}
.privacy-notice-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text2);
}
.privacy-notice-text span:first-child {
  color: var(--text);
  font-weight: 600;
}
.privacy-notice-hint {
  color: var(--text3);
  font-size: 11px;
}
.privacy-notice-ok {
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(245,158,11,.3);
  background: rgba(245,158,11,.1);
  color: #f59e0b;
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  align-self: center;
}
.privacy-notice-ok:hover { background: rgba(245,158,11,.18); }
.profile-privacy-notice.visible { display: flex; }

.profile-reset-btn {
  font-family: var(--font-b);
  font-size: 12px; font-weight: 500;
  color: var(--text3);
  background: none; border: none; cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.15s, background-color 0.15s;
}
.profile-reset-btn:hover {
  color: var(--accent);
  background: rgba(230,62,109,0.06);
}

/* ── Reset confirm modal ─────────────────────────────────────── */
.reset-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.reset-modal.visible { display: flex; }

.reset-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.reset-modal.open .reset-modal-backdrop { opacity: 1; }

.reset-modal-card {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 24px 22px 20px;
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: scale(0.92) translateY(8px);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
}
.reset-modal.open .reset-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.reset-modal-title {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.reset-modal-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin: 0;
}

.reset-modal-safe {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 8px;
  padding: 7px 10px;
  margin: 2px 0 4px;
}
.reset-modal-safe svg { flex-shrink: 0; stroke: #10b981; }

.reset-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.reset-modal-cancel {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.reset-modal-cancel:hover { background: var(--surface); color: var(--text); }

.reset-modal-confirm {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: rgba(230,62,109,0.12);
  color: var(--accent);
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.reset-modal-confirm:hover { background: rgba(230,62,109,0.22); }

/* ── Toast ───────────────────────────────────────────────────── */
.profile-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 13px; font-weight: 500;
  padding: 10px 22px;
  border-radius: 100px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 500;
  white-space: nowrap;
}
.profile-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.profile-toast.toast-error {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

/* ── Watchlist section ───────────────────────────────────────── */
.wl-profile-card {
  width: 100%;
}
.wl-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 12px 0 6px;
}
.wl-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2); font-family: var(--font-d); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.wl-tab:hover { background: var(--bg3); color: var(--text); }
.wl-tab.active {
  background: rgba(230,62,109,0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.wl-tab-count {
  font-size: 11px;
  background: var(--bg3);
  border-radius: 100px;
  padding: 1px 6px;
  color: var(--text3);
}
.wl-tab.active .wl-tab-count { background: rgba(230,62,109,0.15); color: var(--accent); }

.wl-anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  padding: 12px 0 4px;
}
.wl-anime-card {
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: var(--text);
}
.wl-anime-card:hover .wl-anime-title { color: var(--accent); }
.wl-anime-poster {
  width: 100%; aspect-ratio: 2/3;
  border-radius: 10px; overflow: hidden;
  background: var(--bg3);
}
.wl-anime-poster img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.wl-no-poster {
  width: 100%; height: 100%;
  background: var(--bg3);
}
.wl-anime-title {
  font-size: 11px; font-weight: 500; color: var(--text2);
  line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  transition: color 0.15s;
}
.wl-empty {
  font-size: 13px; color: var(--text3); padding: 12px 0 4px; margin: 0;
}
