/* ---------------------------------------------------------------------------
   Arda — link-in-bio profili ve yonetim paneli
   Tema degiskenleri sayesinde koyu/acik tema birlikte calisir.
--------------------------------------------------------------------------- */

:root {
  --bg: #070a11;
  --surface: rgba(17, 24, 37, 0.86);
  --surface-solid: #111825;
  --surface-soft: rgba(26, 35, 51, 0.7);
  --surface-bright: #1b2536;
  --border: rgba(161, 178, 207, 0.16);
  --border-strong: rgba(161, 178, 207, 0.3);
  --text: #f4f7fc;
  --text-soft: #c2cbdb;
  --muted: #98a3b5;
  --accent: #9d8cff;
  --accent-deep: #6e5bd4;
  --danger: #ff7a8a;
  --ok: #6ee7a8;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #f5f7fc;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: rgba(236, 241, 250, 0.9);
  --surface-bright: #e8eef8;
  --border: rgba(39, 53, 79, 0.14);
  --border-strong: rgba(39, 53, 79, 0.26);
  --text: #161f33;
  --text-soft: #3d4a60;
  --muted: #5a6780;
  --accent: #6753d5;
  --accent-deep: #4c3bb8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(70% 55% at 50% -10%, rgba(157, 140, 255, 0.18), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, rgba(110, 91, 212, 0.12), transparent 70%);
}

a {
  color: inherit;
}

/* ---------------------------------------------------------------------------
   Herkese acik profil sayfasi
--------------------------------------------------------------------------- */

.page-profile {
  display: grid;
  min-height: 100dvh;
  padding: clamp(24px, 5vw, 48px);
  place-items: center;
}

.profile {
  display: flex;
  width: 100%;
  max-width: 520px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Avatar: yuklenen gorsel varsa gorsel, yoksa harf. */
.profile-avatar {
  position: relative;
  display: grid;
  width: clamp(96px, 22vw, 132px);
  height: clamp(96px, 22vw, 132px);
  margin-bottom: 20px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-deep), var(--accent));
  box-shadow:
    0 0 0 5px rgba(157, 140, 255, 0.12),
    0 18px 44px rgba(110, 91, 212, 0.36);
}

.avatar-letter {
  font-size: clamp(38px, 9vw, 54px);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.profile-avatar.is-monogram .avatar-image {
  display: none;
}

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

.avatar-image[hidden] {
  display: none;
}

.profile-name {
  margin: 0 0 10px;
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.profile-bio {
  max-width: 42ch;
  margin: 0 0 26px;
  color: var(--text-soft);
  font-size: clamp(14px, 2.4vw, 16px);
  white-space: pre-line;
  text-wrap: pretty;
}

.profile-bio:empty {
  display: none;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-link {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-soft);
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--accent);
  background: var(--surface-bright);
  transform: translateY(-3px);
}

.platform-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.platform-letter {
  fill: currentColor;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
}

/* Etiket hover/focus ile belirir. */
.social-tip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 2;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 10px 26px rgba(2, 5, 12, 0.45);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  pointer-events: none;
}

.social-link:hover .social-tip,
.social-link:focus-visible .social-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.profile-status {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Yonetim paneli
--------------------------------------------------------------------------- */

.page-admin {
  padding: clamp(20px, 5vw, 40px) clamp(16px, 4vw, 24px);
}

.admin {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.admin-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 4vw, 27px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.admin-hint {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.admin-login,
.admin-section {
  margin-bottom: 18px;
  padding: clamp(18px, 3.4vw, 26px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.admin-section-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.admin-section-head .admin-section-title {
  margin-bottom: 0;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.field-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 15px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(157, 140, 255, 0.35);
  outline-offset: 1px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
}

.button:hover {
  background: var(--surface-bright);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0716;
  font-weight: 600;
}

.button-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #f6f3ff;
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.button-quiet {
  color: var(--muted);
}

.button-quiet:hover {
  color: var(--text);
}

.button-danger {
  border-color: rgba(255, 122, 138, 0.4);
  color: var(--danger);
}

.button-danger:hover {
  background: rgba(255, 122, 138, 0.12);
}

.admin-status {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.admin-status.is-ok {
  color: var(--ok);
}

.admin-status.is-error {
  color: var(--danger);
}

/* Avatar satiri */
.avatar-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.avatar-row .profile-avatar {
  width: 84px;
  height: 84px;
  margin-bottom: 0;
  box-shadow: none;
}

.avatar-row .avatar-letter {
  font-size: 34px;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* Baglanti satirlari */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.link-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.link-row-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
}

.link-row-icon .platform-icon {
  width: 19px;
  height: 19px;
}

.link-row-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 10px;
  align-items: end;
}

.field-compact {
  margin-bottom: 0;
}

.field-compact input,
.field-compact select {
  padding: 8px 10px;
  font-size: 14px;
}

.link-row-actions {
  display: flex;
  grid-column: 2;
  gap: 8px;
  justify-content: flex-end;
}

.link-row-actions .button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.link-row-status {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 16px;
}

.admin-footnote {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-footnote a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  .link-row-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .link-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .link-row-status {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .social-link:hover,
  .social-link:focus-visible {
    transform: none;
  }
}
