:root {
  --bg: #0b0b0d;
  --bg-elevated: #16161a;
  --card: #1c1c21;
  --card-hover: #24242b;
  --border: #2a2a31;
  --text: #f5f5f7;
  --text-dim: #9a9aa5;
  --accent: #6c5ce7;
  --accent-hover: #8477ec;
  --danger: #e5566d;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Vazirmatn", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% -10%, #1c1c26 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  padding: 48px 16px 80px;
}

.page {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3a3a7a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.35);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name {
  margin-top: 18px;
  font-size: 22px;
  font-weight: 700;
}

.bio {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  max-width: 340px;
}

.links {
  width: 100%;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.link-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.link-title {
  flex: 1;
  text-align: center;
  margin-right: 24px;
}

.empty {
  color: var(--text-dim);
  text-align: center;
  margin-top: 40px;
  font-size: 14px;
  line-height: 1.8;
}

.footer {
  margin-top: 48px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer a {
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer a:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ---------- Admin panel ---------- */

.admin-page {
  max-width: 640px;
  width: 100%;
}

.admin-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 20px;
  margin: 0;
}

.admin-header a {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.panel {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.row {
  display: flex;
  gap: 10px;
}

.row .field { flex: 1; }

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.link-row .drag {
  cursor: grab;
  color: var(--text-dim);
  user-select: none;
}

.link-row input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  padding: 6px 4px;
}

.link-row input:focus { outline: none; }

.link-row .icon-input { width: 40px; text-align: center; }
.link-row .title-input { flex: 1; }
.link-row .url-input { flex: 2; color: var(--text-dim); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
}

.icon-btn:hover { color: var(--danger); background: rgba(229, 86, 109, 0.1); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

input[type="file"] { display: none; }
