/* assets/css/profile/presets.css
 *
 * Mood-preset picker — the dashboard surface where creators flip the
 * whole-page vibe in one click. Lives next to themes; reuses the same
 * dark glass aesthetic as analytics-privacy.css and modal-buttons.css.
 *
 * Responsive: 1 column on phones, 2 on small tablets, 3 on desktop.
 */

/* ── Filter chips ───────────────────────────────────────────────────── */
.presets-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px 0;
}

.preset-filter {
  font: 600 12px/1 'Onest', system-ui, sans-serif;
  background: rgba(255, 255, 255, 0.04);
  color: #a0a0a8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  text-transform: capitalize;
  transition: background 0.14s, color 0.14s, border-color 0.14s, transform 0.1s;
}
.preset-filter:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.preset-filter.is-active {
  background: rgba(99, 102, 241, 0.15);
  color: #c4b5fd;
  border-color: rgba(99, 102, 241, 0.40);
}
.preset-filter:active { transform: scale(0.97); }

/* ── Grid ───────────────────────────────────────────────────────────── */
.presets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .presets-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (min-width: 768px) {
  .presets-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* ── Card ───────────────────────────────────────────────────────────── */
.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.14s, background 0.14s, box-shadow 0.16s;
  outline: 0;
}
.preset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.35);
}
.preset-card:focus-visible {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.preset-card:active { transform: translateY(-1px) scale(0.99); }

/* Active state (currently applied preset) */
.preset-card.is-active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.08);
}
.preset-card__active {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
}

/* Visual preview gradient strip at the top */
.preset-card__preview {
  display: block;
  width: 100%;
  height: 84px;
  background-size: 200% 200%;
  background-position: center;
  position: relative;
}
.preset-card__preview::after {
  /* Faint inner shadow at the bottom so the gradient feels like it
     belongs to a screen, not floating in space. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

/* Body */
.preset-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}
.preset-card__name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}
.preset-card__desc {
  font-size: 0.81rem;
  color: #a0a0a8;
  line-height: 1.4;
}
.preset-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.preset-card__tag {
  font-size: 0.7rem;
  color: #c4b5fd;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.20);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* Loading skeleton — reuses the analytics-privacy shimmer for parity */
.ap-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.03) 100%
  );
  background-size: 200% 100%;
  animation: ap-shimmer 1.6s infinite;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .preset-card { transition: none; }
  .preset-card:hover { transform: none; }
}

/* ─────────────────────────────────────────────────────────────────────
 * Frames picker (profile-frames.js) — same shape as presets, slightly
 * different preview semantics (frames have an accent glow, not a
 * gradient strip).
 * ───────────────────────────────────────────────────────────────────── */
.frames-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .frames-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (min-width: 768px) {
  .frames-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

.frame-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.14s, background 0.14s, box-shadow 0.16s;
  outline: 0;
}
.frame-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.35);
}
.frame-card:focus-visible {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.frame-card.is-active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.08);
}
.frame-card__active {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  z-index: 2;
}

/* Preview area — frame's signature accent + ambient glow */
.frame-card__preview {
  position: relative;
  height: 84px;
  background: #0a0a0f;
  overflow: hidden;
}
.frame-card__preview-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 70% at 50% 100%, var(--g, #6366f1), transparent 65%);
  opacity: 0.55;
}

/* List-view card has a fake "stack of pills" preview */
.frame-card__preview--list {
  background: linear-gradient(180deg, #1a1a1f, #0c0c10);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.frame-card__preview--list span {
  display: block;
  width: 60%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}
.frame-card__preview--list span:nth-child(1) { width: 35%; background: rgba(255,255,255,0.18); }

/* Body */
.frame-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}
.frame-card__name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}
.frame-card__desc {
  font-size: 0.81rem;
  color: #a0a0a8;
  line-height: 1.4;
}
.frame-card__tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 2px;
}
.frame-card__tag {
  font-size: 0.7rem;
  color: #c4b5fd;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.20);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .frame-card { transition: none; }
  .frame-card:hover { transform: none; }
}

/* ─────────────────────────────────────────────────────────────────────
 * Dedicated preview pane INSIDE the Frames panel.
 * Lives next to the picker grid, NOT inside the main #profile-preview-box.
 * (Earlier attempt mounted into the editor surface and broke link-add /
 * banner upload — kept those untouched now.)
 * ───────────────────────────────────────────────────────────────────── */
.frames-preview-host {
  position: relative;
  margin: 0 0 18px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.frames-preview-host.has-frame {
  background: #000;
  aspect-ratio: 9 / 14;
  max-height: 560px;
}
.frames-preview-host > .mdr-frame-root {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.frames-preview-empty {
  text-align: center;
  color: #6b7280;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px;
}
.frames-preview-empty i {
  font-size: 1.6rem;
  color: rgba(99, 102, 241, 0.55);
}
.frames-preview-empty p { margin: 0; }

@media (min-width: 900px) {
  .frames-preview-host.has-frame {
    aspect-ratio: 16 / 11;
    max-height: 520px;
  }
}

/* ─────────────────────────────────────────────────────────────────────
 * Toolbar "Frame" button dot — lights up indigo when a non-default
 * frame is active on the profile. Visual confirmation right next to
 * where the creator edits everything else.
 * ───────────────────────────────────────────────────────────────────── */
#frame-btn { position: relative; }
.circle-dot {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 0 2px var(--card, #0d0d12), 0 0 8px rgba(99, 102, 241, 0.6);
}
.circle-dot.is-on { display: block; }

/* ─────────────────────────────────────────────────────────────────────
 * Profile-edit toolbar "More" (…) popover.
 * Shrinks the 13-icon row to 6 visible icons + an overflow menu so the
 * editor stops scaring new users on first load.
 * ───────────────────────────────────────────────────────────────────── */
#more-tools-btn { position: relative; }

.more-tools-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  min-width: 200px;
  background: rgba(13, 13, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.55);
}
.more-tools-popover.is-open { display: flex; }

.more-tools-popover__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: #e5e7eb;
  font: 500 13.5px/1 'Onest', system-ui, sans-serif;
  cursor: pointer;
  width: 100%;
  /* Cancel the .circle base styles so the row reads as a list item, not
     an isolated circle. The icon inside stays small + indigo. */
  height: auto !important;
  border-radius: 8px !important;
}
.more-tools-popover__row:hover {
  background: rgba(99, 102, 241, 0.10);
  color: #fff;
}
.more-tools-popover__row i {
  color: #a78bfa;
  width: 16px;
  text-align: center;
  font-size: 13px;
  flex: 0 0 16px;
}
.more-tools-popover__row span {
  flex: 1;
  text-align: left;
}

/* The popover sits inside the banner-actions2 row which has its own
   stacking context. Make sure the row itself doesn't clip its children
   so the popover can escape downwards. */
.banner-actions2 { overflow: visible !important; }
