/* ═══════════════════════════════════════════════════════════════
   Profile Customization — settings UI
   ═══════════════════════════════════════════════════════════════ */

.profile-customization-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

.profile-customization-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.profile-customization-title .ui-icon,
.profile-customization-title svg {
    width: 15px;
    height: 15px;
    color: var(--profile-custom-accent, var(--c-basic));
}

.profile-customization-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-customization-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
}

.profile-customization-field .profile-input {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 13px;
}

.profile-customization-badge {
    display: none; /* shown via JS when text is set */
    width: fit-content;
    max-width: 100%;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--profile-custom-accent-soft, rgba(16, 185, 129, 0.14));
    border: 1px solid color-mix(in srgb, var(--profile-custom-accent, var(--c-basic)) 36%, transparent);
    color: var(--profile-custom-accent, var(--c-basic));
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#profile-customization-badge {
    flex-shrink: 0;
}

.pp-customization-badge {
    flex: 0 1 auto;
    max-width: min(100%, 180px);
    min-height: 22px;
    margin: 0;
    padding: 3px 9px;
    font-size: 11px;
    line-height: 1.2;
}

.partner-profile-modal .pp-title-row {
    flex-wrap: wrap;
    justify-content: center;
}

.partner-profile-modal .pp-name {
    flex: 0 1 auto;
    max-width: 100%;
}

/* ── Nick row: badge sits inline after the nickname ──────────── */
.profile-hero-nick-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.profile-hero-nick-row .profile-hero-nick {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Settings preview badge row ───────────────────────────────── */
.profile-settings-preview-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    margin-top: 2px;
}

.profile-settings-preview-badge {
    flex-shrink: 0;
    font-size: 11px;
    min-height: 20px;
    padding: 2px 8px;
}

body.light .profile-customization-settings {
    background: var(--surface-2);
    border-color: var(--border);
}

body.light .profile-customization-badge {
    background: color-mix(in srgb, var(--profile-custom-accent, var(--c-basic)) 12%, white);
}

@media (max-width: 560px) {
    .profile-customization-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Profile Cover System
   ---------------------------------------------------------------
   Architecture (static, zero-animation profile covers):

   Each card/modal gets position: relative + overflow: hidden.

   ::before  — static base gradient (no animation, painted once)
   ::after   — static accent layer

   Isolation:
     contain: layout style paint  → limits repaint scope to card

   Covers are intentionally static: no drift, no scroll-time hiding,
   no transition or animation work inside profile surfaces.
   ═══════════════════════════════════════════════════════════════ */

/* ── Shared cover infrastructure ──────────────────────────────── */

.profile-card,
.partner-profile-modal {
    /* style + paint isolate repaint scope without breaking scroll/layout */
    contain: style paint;
}

/* own-profile card needs hard clipping so the cover doesn't bleed past border-radius */
.profile-card {
    overflow: hidden;
}

/* children stay above the cover layers */
.profile-card > *,
.partner-profile-modal > * {
    position: relative;
    z-index: 1;
}

/* Base (::before) + accent (::after) cover layers */
.profile-card[data-profile-cover]:not([data-profile-cover="none"])::before,
.partner-profile-modal[data-profile-cover]:not([data-profile-cover="none"])::before,
.profile-card[data-profile-cover]:not([data-profile-cover="none"])::after,
.partner-profile-modal[data-profile-cover]:not([data-profile-cover="none"])::after {
    content: "";
    position: absolute;
    /* Constrain to top ~180px — covers fade out naturally,
       so no overflow:hidden needed on the scrollable modal */
    inset: 0 0 auto 0;
    height: 180px;
    width: 100%;
    pointer-events: none;
    border-radius: inherit;
}

/* Static base: painted once, no animation */
.profile-card[data-profile-cover]:not([data-profile-cover="none"])::before,
.partner-profile-modal[data-profile-cover]:not([data-profile-cover="none"])::before {
    z-index: 0;
    /* fade into the card background at the bottom */
    mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
}

/* Accent layer: static, no keyframes */
.profile-card[data-profile-cover]:not([data-profile-cover="none"])::after,
.partner-profile-modal[data-profile-cover]:not([data-profile-cover="none"])::after {
    z-index: 0;
    mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 90%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 90%);
}


/* ── Static cover presets ───────────────────────────────────────── */



/* ════════════════════════════════════════════════════════════════
   AURORA — Northern lights: teal + cyan + violet bloom
   ════════════════════════════════════════════════════════════════ */

.profile-card[data-profile-cover="aurora"]::before,
.partner-profile-modal[data-profile-cover="aurora"]::before {
    /* rich static base: deep navy with cyan sweep + violet corner */
    background:
        radial-gradient(ellipse 70% 60% at 15% 25%, rgba(6, 182, 212, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse 55% 50% at 82% 20%, rgba(124, 58, 237, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 80% 40% at 50% 50%, rgba(16, 185, 129, 0.18) 0%, transparent 70%),
        linear-gradient(135deg, #050d1a 0%, #0c1528 50%, #0a0f22 100%);
    opacity: 0.9;
}

.profile-card[data-profile-cover="aurora"]::after,
.partner-profile-modal[data-profile-cover="aurora"]::after {
    /* static shimmer: a wide cyan wave */
    background:
        radial-gradient(ellipse 90% 55% at 40% 30%, rgba(34, 211, 238, 0.38) 0%, transparent 65%),
        radial-gradient(ellipse 50% 70% at 75% 15%, rgba(167, 139, 250, 0.32) 0%, transparent 55%);
    opacity: 0.75;
}


/* ════════════════════════════════════════════════════════════════
   DUSK — Cinematic sunset: rose → violet → amber
   ════════════════════════════════════════════════════════════════ */

.profile-card[data-profile-cover="dusk"]::before,
.partner-profile-modal[data-profile-cover="dusk"]::before {
    background:
        radial-gradient(ellipse 65% 55% at 14% 22%, rgba(244, 63, 94, 0.48) 0%, transparent 58%),
        radial-gradient(ellipse 55% 45% at 80% 18%, rgba(251, 191, 36, 0.32) 0%, transparent 52%),
        radial-gradient(ellipse 70% 60% at 50% 40%, rgba(109, 40, 217, 0.36) 0%, transparent 65%),
        linear-gradient(145deg, #13050d 0%, #1a0824 55%, #120d05 100%);
    opacity: 0.88;
}

.profile-card[data-profile-cover="dusk"]::after,
.partner-profile-modal[data-profile-cover="dusk"]::after {
    background:
        radial-gradient(ellipse 80% 50% at 30% 25%, rgba(251, 113, 133, 0.30) 0%, transparent 60%),
        radial-gradient(ellipse 55% 60% at 70% 20%, rgba(253, 224, 71, 0.22) 0%, transparent 55%);
    opacity: 0.70;
}


/* ════════════════════════════════════════════════════════════════
   EMBER — Molten fire: amber core → crimson → deep black
   ════════════════════════════════════════════════════════════════ */

.profile-card[data-profile-cover="ember"]::before,
.partner-profile-modal[data-profile-cover="ember"]::before {
    background:
        radial-gradient(ellipse 55% 60% at 22% 30%, rgba(251, 146, 60, 0.52) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 75% 20%, rgba(220, 38, 38, 0.40) 0%, transparent 58%),
        radial-gradient(ellipse 40% 40% at 50% 55%, rgba(234, 179, 8, 0.22) 0%, transparent 50%),
        linear-gradient(140deg, #100500 0%, #1a0800 50%, #0d0402 100%);
    opacity: 0.92;
}

.profile-card[data-profile-cover="ember"]::after,
.partner-profile-modal[data-profile-cover="ember"]::after {
    background:
        radial-gradient(ellipse 70% 50% at 35% 28%, rgba(253, 186, 116, 0.28) 0%, transparent 60%),
        radial-gradient(ellipse 50% 65% at 68% 22%, rgba(239, 68, 68, 0.24) 0%, transparent 55%);
    opacity: 0.72;
}


/* ════════════════════════════════════════════════════════════════
   FOREST — Bioluminescent night: emerald mist + moonlight
   ════════════════════════════════════════════════════════════════ */

.profile-card[data-profile-cover="forest"]::before,
.partner-profile-modal[data-profile-cover="forest"]::before {
    background:
        radial-gradient(ellipse 60% 55% at 18% 28%, rgba(16, 185, 129, 0.46) 0%, transparent 58%),
        radial-gradient(ellipse 40% 40% at 78% 16%, rgba(110, 231, 183, 0.30) 0%, transparent 48%),
        radial-gradient(ellipse 30% 35% at 60% 20%, rgba(167, 243, 208, 0.45) 0%, transparent 38%),
        radial-gradient(ellipse 70% 50% at 45% 50%, rgba(6, 78, 59, 0.50) 0%, transparent 65%),
        linear-gradient(135deg, #020d08 0%, #050f0a 55%, #030a06 100%);
    opacity: 0.90;
}

.profile-card[data-profile-cover="forest"]::after,
.partner-profile-modal[data-profile-cover="forest"]::after {
    background:
        radial-gradient(ellipse 80% 45% at 30% 30%, rgba(52, 211, 153, 0.25) 0%, transparent 62%),
        radial-gradient(ellipse 35% 50% at 65% 18%, rgba(209, 250, 229, 0.30) 0%, transparent 45%);
    opacity: 0.68;
}


/* ── "none" preset: no cover layers at all ──────────────────── */
.profile-card[data-profile-cover="none"]::before,
.partner-profile-modal[data-profile-cover="none"]::before,
.profile-card[data-profile-cover="none"]::after,
.partner-profile-modal[data-profile-cover="none"]::after {
    content: none;
}


/* ── Light mode: de-saturate slightly so covers don't overpower ─ */
body.light .profile-card[data-profile-cover]:not([data-profile-cover="none"])::before,
body.light .partner-profile-modal[data-profile-cover]:not([data-profile-cover="none"])::before {
    opacity: 0.45;
}
body.light .profile-card[data-profile-cover]:not([data-profile-cover="none"])::after,
body.light .partner-profile-modal[data-profile-cover]:not([data-profile-cover="none"])::after {
    opacity: 0.30;
}

/* Profile surfaces are intentionally static. Hover/focus states may still
   change immediately, but no CSS animation or transition should run inside profiles. */
.profile-card,
.profile-card *,
.profile-card::before,
.profile-card::after,
.profile-card *::before,
.profile-card *::after,
.profile-settings-avatar,
.profile-settings-avatar *,
.profile-settings-avatar::before,
.profile-settings-avatar::after,
.profile-settings-avatar *::before,
.profile-settings-avatar *::after,
.partner-profile-overlay,
.partner-profile-overlay *,
.partner-profile-overlay::before,
.partner-profile-overlay::after,
.partner-profile-overlay *::before,
.partner-profile-overlay *::after,
.partner-profile-modal,
.partner-profile-modal *,
.partner-profile-modal::before,
.partner-profile-modal::after,
.partner-profile-modal *::before,
.partner-profile-modal *::after,
.pp-photo-context-menu,
.pp-photo-context-menu *,
.pp-photo-context-menu::before,
.pp-photo-context-menu::after,
.pp-photo-context-menu *::before,
.pp-photo-context-menu *::after {
    animation: none !important;
    transition: none !important;
}
