/*
 * realm.css — Realm page styles
 * All styles class-based, no inline style="" attributes
 */

/* ── View toggle bar ──────────────────────────────────────────── */
.rl-view-toggle-bar {
  background: rgba(7, 12, 28, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  position: sticky;
  top: 0;
  z-index: 40;
  padding: .6rem 0;
}
.rl-view-toggle-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.rl-toggle-tabs { display: flex; gap: .45rem; }
.rl-toggle-tab {
  padding: .38rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: transparent;
  color: var(--clr-text-muted);
  font-size: .83rem;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.rl-toggle-tab:hover  { color: var(--clr-text); border-color: rgba(148, 163, 184, .5); }
.rl-toggle-tab.active { border-color: rgba(99, 102, 241, .65); background: rgba(99, 102, 241, .15); color: #c4b5fd; }
.rl-toggle-actions { display: flex; gap: .45rem; }

/* ── Editor layout ────────────────────────────────────────────── */
.rl-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.rl-editor-panel {
  border: 1px solid var(--clr-border);
  border-radius: .95rem;
  padding: 1.2rem;
  background: var(--clr-card);
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.rl-editor-panel-wide { grid-column: 1 / -1; }
.rl-section-title { font-size: 1rem; font-weight: 700; margin: 0; }
.rl-muted { font-size: .84rem; color: var(--clr-text-muted); }

/* ── Avatar row ───────────────────────────────────────────────── */
.rl-avatar-row { display: flex; align-items: center; gap: .9rem; }
.rl-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99, 102, 241, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

/* ── Form inputs ──────────────────────────────────────────────── */
.rl-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  display: block;
  margin-bottom: .2rem;
}
.rl-input {
  width: 100%;
  background: rgba(7, 12, 28, .7);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: .65rem;
  padding: .55rem .85rem;
  color: var(--clr-text);
  font-size: .88rem;
  box-sizing: border-box;
}
.rl-input:focus { outline: none; border-color: rgba(99, 102, 241, .5); }
.rl-textarea { resize: vertical; min-height: 72px; }
.rl-char-count { font-size: .75rem; color: var(--clr-text-muted); text-align: right; }
.rl-input-prefix-row { display: flex; align-items: center; gap: 0; }
.rl-prefix {
  background: rgba(148, 163, 184, .08);
  border: 1px solid rgba(148, 163, 184, .28);
  border-right: none;
  border-radius: .65rem 0 0 .65rem;
  padding: .55rem .75rem;
  font-size: .82rem;
  color: var(--clr-text-muted);
  white-space: nowrap;
}
.rl-input-slug { border-radius: 0 .65rem .65rem 0; }

/* ── Emoji picker ─────────────────────────────────────────────── */
.rl-emoji-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.rl-emoji-btn {
  width: 42px;
  height: 42px;
  border-radius: .6rem;
  border: 1.5px solid rgba(148, 163, 184, .2);
  background: rgba(15, 23, 42, .6);
  font-size: 1.25rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.rl-emoji-btn:hover { border-color: rgba(99, 102, 241, .5); background: rgba(99, 102, 241, .1); }
.rl-emoji-btn.active { border-color: rgba(99, 102, 241, .75); background: rgba(99, 102, 241, .2); }

/* ── Theme swatches ───────────────────────────────────────────── */
.rl-theme-grid {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.rl-theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  border: 1.5px solid rgba(148, 163, 184, .2);
  border-radius: .75rem;
  padding: .55rem .7rem;
  background: rgba(15, 23, 42, .5);
  cursor: pointer;
  font-size: .78rem;
  color: var(--clr-text-muted);
  transition: border-color .15s, background .15s;
}
.rl-theme-swatch:hover  { border-color: rgba(99, 102, 241, .5); }
.rl-theme-swatch.active { border-color: rgba(99, 102, 241, .75); background: rgba(99, 102, 241, .15); color: #c4b5fd; }
.rl-swatch-preview {
  width: 36px;
  height: 18px;
  border-radius: .35rem;
}
.rl-theme-dark-purple  { background: linear-gradient(135deg, #1e1b4b, #312e81); }
.rl-theme-dark-ocean   { background: linear-gradient(135deg, #0c1a2e, #1e40af); }
.rl-theme-dark-forest  { background: linear-gradient(135deg, #052e16, #065f46); }
.rl-theme-dark-ember   { background: linear-gradient(135deg, #1c0a00, #7c2d12); }
.rl-theme-minimal-light { background: linear-gradient(135deg, #f8fafc, #e2e8f0); }

/* ── Link items ───────────────────────────────────────────────── */
.rl-links-list, .rl-featured-list { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .55rem; }
.rl-link-item, .rl-featured-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: .75rem;
  padding: .55rem .75rem;
  flex-wrap: wrap;
}
.rl-link-icon { font-size: 1.05rem; flex-shrink: 0; }
.rl-link-inputs { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 160px; }
.rl-link-input-row { display: flex; gap: .4rem; }
.rl-link-input-sm {
  flex: 1;
  min-width: 80px;
  background: rgba(7, 12, 28, .65);
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: .5rem;
  padding: .38rem .65rem;
  color: var(--clr-text);
  font-size: .82rem;
}
.rl-link-input-sm:focus { outline: none; border-color: rgba(99, 102, 241, .5); }
.rl-link-remove-btn {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: .85rem;
  padding: .25rem .5rem;
  border-radius: .45rem;
  flex-shrink: 0;
}
.rl-link-remove-btn:hover { color: #fca5a5; }
.rl-add-link-btn { align-self: flex-start; }

/* ── Referral ─────────────────────────────────────────────────── */
.rl-referral-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.rl-input-ref { max-width: 240px; }
.rl-inline-check { display: inline-flex; align-items: center; gap: .35rem; }

/* ── Preview card ─────────────────────────────────────────────── */
.rl-preview-container { max-width: 480px; margin: 0 auto; }
.rl-preview-card {
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 1.25rem;
  padding: 2rem 1.5rem 1.5rem;
  background: rgba(10, 15, 30, .92);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rl-preview-header { display: flex; align-items: center; gap: 1rem; }
.rl-preview-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.rl-preview-name     { font-size: 1.2rem; font-weight: 800; }
.rl-preview-username { font-size: .78rem; color: var(--clr-text-muted); }
.rl-preview-bio      { font-size: .88rem; color: var(--clr-text-muted); line-height: 1.55; margin: 0; }

/* Preview links */
.rl-preview-links { display: flex; flex-direction: column; gap: .55rem; }
.rl-preview-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: .85rem;
  padding: .7rem 1rem;
  color: var(--clr-text);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s;
}
.rl-preview-link:hover { background: rgba(255, 255, 255, .1); }

/* Preview featured */
.rl-preview-featured { display: flex; flex-direction: column; gap: .5rem; }
.rl-preview-feat-item {
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: .8rem;
  padding: .65rem .85rem;
  background: rgba(99, 102, 241, .08);
}
.rl-preview-feat-title { font-size: .9rem; font-weight: 600; }
.rl-preview-feat-desc  { font-size: .8rem; color: var(--clr-text-muted); margin-top: .2rem; }

/* Referral */
.rl-preview-referral {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgba(99, 102, 241, .25);
  border-radius: .75rem;
  padding: .6rem .9rem;
  font-size: .84rem;
  color: #c4b5fd;
  flex-wrap: wrap;
}
.rl-preview-footer { text-align: center; margin-top: .5rem; }
.rl-preview-poweredby { font-size: .75rem; color: var(--clr-text-muted); text-decoration: none; }
.rl-preview-poweredby:hover { color: var(--clr-text); }

/* ── Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
