/*
|--------------------------------------------------------------------------
| SNOVEL PROFILE
|--------------------------------------------------------------------------
| Authoritative profile layout layer.
| This file intentionally replaces the older conflicting profile rules.
|--------------------------------------------------------------------------
*/

.sn-profile-page {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 80px;
}

/* -----------------------------------------------------------------------
   HERO
------------------------------------------------------------------------ */

.sn-profile-hero {
    position: relative;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 24px;
    background:
        linear-gradient(
            180deg,
            rgba(124, 58, 237, .08),
            rgba(255, 255, 255, .015)
        );
    box-shadow:
        0 24px 80px rgba(0, 0, 0, .25);
}

/* -----------------------------------------------------------------------
   COVER
------------------------------------------------------------------------ */

.sn-profile-cover {
    position: relative;
    height: 340px;
    min-height: 340px;
    overflow: hidden;
    border-radius: 23px 23px 0 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.sn-profile-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, .02) 0%,
            rgba(0, 0, 0, .08) 45%,
            rgba(5, 5, 8, .82) 100%
        );
}

.sn-profile-cover img,
.sn-author-cover img,
.profile-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* -----------------------------------------------------------------------
   MAIN IDENTITY
------------------------------------------------------------------------ */

.sn-profile-main {
    position: relative;
    z-index: 3;

    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    align-items: end;
    gap: 20px;

    margin-top: -64px;
    padding: 0 28px 20px;
}

/* -----------------------------------------------------------------------
   AVATAR
------------------------------------------------------------------------ */

.sn-profile-avatar-wrap {
    position: relative;
    width: 150px;
    height: 150px;
    flex: 0 0 150px;
}

.sn-profile-avatar,
.sn-author-avatar,
.profile-avatar {
    position: relative;

    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;

    display: grid;
    place-items: center;

    overflow: visible;

    border: 6px solid #101018;
    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            #27272a,
            #111116
        );

    box-shadow:
        0 18px 45px rgba(0, 0, 0, .38);

    cursor: pointer;
    isolation: isolate;
}

.sn-profile-avatar > img,
.sn-author-avatar > img,
.profile-avatar > img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
    border-radius: inherit;
}

.sn-profile-avatar-edit {
    position: absolute;
    right: 3px;
    bottom: 5px;
    z-index: 8;
}

/* -----------------------------------------------------------------------
   ONLINE STATUS
------------------------------------------------------------------------ */

.sn-profile-online-status,
.sn-profile-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #a1a1aa;
    font-size: .72rem;
}

.sn-profile-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;

    border-radius: 50%;
    background: #71717a;

    box-shadow: 0 0 0 3px rgba(113, 113, 122, .08);
}

.sn-profile-status-dot.is-online {
    background: #22c55e;
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, .12),
        0 0 12px rgba(34, 197, 94, .55);
}

/* -----------------------------------------------------------------------
   IDENTITY
------------------------------------------------------------------------ */

.sn-profile-identity {
    min-width: 0;
    padding-bottom: 6px;
}

.sn-profile-name {
    margin: 0;

    font-size: clamp(1.7rem, 3vw, 2.45rem);
    line-height: 1.05;
    letter-spacing: -.045em;
    font-weight: 800;

    color: #fafafa;
}

.sn-profile-username {
    display: block;
    margin-top: 6px;

    color: #a78bfa;
    font-size: .84rem;
}

.sn-profile-bio {
    max-width: 700px;
    margin: 10px 0 0;

    color: #a1a1aa;
    font-size: .9rem;
    line-height: 1.65;
}

/* -----------------------------------------------------------------------
   ROLE / VERIFICATION / BADGES
------------------------------------------------------------------------ */

.sn-profile-recognition {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;

    margin-top: 10px;
}

.sn-profile-role,
.sn-profile-verified,
.sn-profile-badge-chip,
.sn-profile-achievement-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-height: 27px;
    padding: 4px 9px;

    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;

    background: rgba(255, 255, 255, .035);

    color: #d4d4d8;
    font-size: .66rem;
    font-weight: 700;
}

/* -----------------------------------------------------------------------
   ACTIONS
------------------------------------------------------------------------ */

.sn-profile-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    padding-bottom: 8px;
}

.sn-profile-actions > * {
    white-space: nowrap;
}

/* -----------------------------------------------------------------------
   STATS
------------------------------------------------------------------------ */

.sn-profile-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 34px;

    margin: 0 28px 22px;
    padding-top: 16px;

    border-top: 1px solid rgba(255, 255, 255, .07);
}

.sn-profile-stat {
    min-width: 70px;
}

.sn-profile-stat strong {
    display: block;

    font-size: 1.25rem;
    line-height: 1.1;
    font-weight: 800;

    color: #fafafa;
}

.sn-profile-stat-label {
    display: block;
    margin-top: 5px;

    color: #71717a;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* -----------------------------------------------------------------------
   CONTENT
------------------------------------------------------------------------ */

.sn-profile-content {
    width: 100%;
    max-width: 1220px;
    margin: 22px auto 0;
}

.sn-profile-tabs {
    display: flex;
    align-items: center;
    gap: 4px;

    margin-bottom: 16px;
    padding: 5px;

    overflow-x: auto;

    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 15px;

    background: rgba(255, 255, 255, .02);

    scrollbar-width: none;
}

.sn-profile-tabs::-webkit-scrollbar {
    display: none;
}

.sn-profile-tab {
    min-height: 38px;
    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    color: #a1a1aa;
    font-size: .76rem;
    font-weight: 700;

    white-space: nowrap;
}

.sn-profile-tab:hover,
.sn-profile-tab.is-active {
    background: rgba(124, 58, 237, .12);
    color: #c4b5fd;
}

/* -----------------------------------------------------------------------
   PRIVATE PROFILE
------------------------------------------------------------------------ */

.sn-profile-private {
    padding: 35px 20px;

    text-align: center;

    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;

    background: rgba(255, 255, 255, .018);
}

.sn-profile-private-icon {
    width: 52px;
    height: 52px;

    margin: 0 auto 12px;

    display: grid;
    place-items: center;

    border-radius: 16px;

    background: rgba(124, 58, 237, .12);
    color: #a78bfa;
}

/* -----------------------------------------------------------------------
   REWARDS
------------------------------------------------------------------------ */

.sn-profile-rewards {
    margin: 20px 0;
    padding: 22px;

    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;

    background: rgba(255, 255, 255, .018);
}

.sn-profile-rewards-head h2 {
    margin: 4px 0 3px;

    font-size: 1.3rem;
    line-height: 1.2;
}

.sn-profile-rewards-head p {
    margin: 0;

    color: #71717a;
    font-size: .78rem;
}

.sn-profile-reward-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;

    margin-top: 16px;
}

.sn-profile-reward-card {
    padding: 15px;

    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 15px;

    background: rgba(0, 0, 0, .1);
}

.sn-profile-reward-card h3 {
    margin: 0 0 11px;

    font-size: .85rem;
}

.sn-profile-badge-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.sn-earned-badge {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 10px;

    border: 1px solid
        color-mix(
            in srgb,
            var(--badge-color, #7c3aed) 30%,
            transparent
        );

    border-radius: 12px;

    background:
        color-mix(
            in srgb,
            var(--badge-color, #7c3aed) 7%,
            transparent
        );
}

.sn-earned-badge > b {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background:
        color-mix(
            in srgb,
            var(--badge-color, #7c3aed) 18%,
            transparent
        );

    color: var(--badge-color, #a78bfa);
}

.sn-earned-badge strong,
.sn-earned-achievement strong {
    display: block;

    font-size: .72rem;
}

.sn-earned-badge small,
.sn-earned-achievement small {
    display: block;
    margin-top: 3px;

    color: #71717a;
    font-size: .61rem;
    line-height: 1.35;
}

.sn-achievement-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sn-earned-achievement {
    display: flex;
    gap: 10px;

    padding: 9px;

    border-radius: 11px;

    background: rgba(124, 58, 237, .045);
}

.sn-earned-achievement > span {
    font-size: 20px;
}

.sn-earned-achievement em {
    display: block;
    margin-top: 4px;

    color: #a78bfa;
    font-size: .58rem;
    font-style: normal;
}

.sn-profile-reward-empty {
    padding: 15px;

    color: #71717a;
    font-size: .7rem;
}

/* -----------------------------------------------------------------------
   PROFILE PREVIEW MODAL
------------------------------------------------------------------------ */

html.sn-profile-preview-open,
body.sn-profile-preview-open {
    overflow: hidden;
}

.sn-profile-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(3, 3, 7, .78);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sn-profile-preview-modal[hidden] {
    display: none !important;
}

.sn-profile-preview-dialog {
    width: min(94vw, 820px);
    max-height: 90vh;

    overflow: hidden auto;

    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 24px;

    background:
        linear-gradient(
            180deg,
            rgba(25, 25, 34, .98),
            rgba(13, 13, 18, .99)
        );

    box-shadow:
        0 30px 100px rgba(0, 0, 0, .55);
}

.sn-profile-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 20px 22px 14px;
}

.sn-profile-preview-header h2 {
    margin: 0;

    font-size: 1.35rem;
}

.sn-profile-preview-header p {
    margin: 5px 0 0;

    color: #71717a;
    font-size: .75rem;
}

.sn-profile-preview-avatar-stage,
.sn-profile-ring-live {
    min-height: 390px;

    display: grid;
    place-items: center;

    padding: 30px;

    background:
        radial-gradient(
            circle at center,
            rgba(124, 58, 237, .13),
            transparent 55%
        );
}

.sn-profile-preview-avatar {
    width: 260px;
    height: 260px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 50%;
    border: 6px solid #101018;

    background: #18181b;

    font-size: 72px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, .5);
}

.sn-profile-preview-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: inherit;
}

.sn-profile-preview-cover {
    height: 380px;
    margin: 20px;

    border-radius: 18px;

    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .07);
}

.sn-profile-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    padding: 14px 20px 20px;
}

.sn-profile-preview-primary,
.sn-profile-preview-secondary {
    min-height: 42px;
    padding: 0 16px;

    border-radius: 11px;

    font-size: .75rem;
    font-weight: 700;
}

/* -----------------------------------------------------------------------
   RINGS
------------------------------------------------------------------------ */

.sn-profile-ring-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 10px;

    padding: 20px;
}

.sn-profile-ring-option {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    padding: 12px 7px;

    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 15px;

    background: rgba(255, 255, 255, .025);

    color: #a1a1aa;

    cursor: pointer;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.sn-profile-ring-option:hover {
    transform: translateY(-2px);

    border-color: rgba(124, 58, 237, .35);
    background: rgba(124, 58, 237, .08);
}

.sn-profile-ring-option.is-selected {
    border-color: rgba(124, 58, 237, .65);
    background: rgba(124, 58, 237, .12);
    color: #ddd6fe;
}

.sn-profile-ring-option:disabled {
    opacity: .55;
    cursor: wait;
}

.sn-profile-ring-option-avatar {
    width: 64px;
    height: 64px;

    display: grid;
    place-items: center;

    overflow: visible;

    border-radius: 50%;

    background: #18181b;

    font-size: 1rem;
}

.sn-profile-ring-option-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 50%;
}

.sn-profile-ring-option-name {
    max-width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: .63rem;
}

.sn-profile-ring-loading {
    grid-column: 1 / -1;

    padding: 30px;

    text-align: center;

    color: #71717a;
    font-size: .75rem;
}

.sn-profile-ring-loading.is-error {
    color: #fca5a5;
}

.sn-profile-ring-message {
    margin: 0 20px 15px;
    padding: 10px 12px;

    border-radius: 10px;

    font-size: .72rem;
}

.sn-profile-ring-message[hidden] {
    display: none !important;
}

.sn-profile-ring-message.is-success {
    background: rgba(34, 197, 94, .09);
    color: #86efac;
}

.sn-profile-ring-message.is-error {
    background: rgba(239, 68, 68, .09);
    color: #fca5a5;
}

/* -----------------------------------------------------------------------
   LIGHT MODE
------------------------------------------------------------------------ */

html[data-theme="light"] .sn-profile-hero,
body.sn-light .sn-profile-hero {
    border-color: rgba(24, 24, 27, .08);
    background: #fff;
    box-shadow: 0 20px 60px rgba(24, 24, 27, .08);
}

html[data-theme="light"] .sn-profile-name,
body.sn-light .sn-profile-name,
html[data-theme="light"] .sn-profile-stat strong,
body.sn-light .sn-profile-stat strong {
    color: #18181b;
}

html[data-theme="light"] .sn-profile-bio,
body.sn-light .sn-profile-bio {
    color: #52525b;
}

html[data-theme="light"] .sn-profile-stats,
body.sn-light .sn-profile-stats {
    border-color: rgba(24, 24, 27, .08);
}

html[data-theme="light"] .sn-profile-preview-dialog,
body.sn-light .sn-profile-preview-dialog {
    background: #fff;
    color: #18181b;
    border-color: rgba(24, 24, 27, .08);
}

html[data-theme="light"] .sn-profile-ring-option,
body.sn-light .sn-profile-ring-option {
    border-color: rgba(24, 24, 27, .08);
    background: rgba(24, 24, 27, .025);
}

/* -----------------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------------------ */

@media (max-width: 900px) {

    .sn-profile-page {
        width: min(100% - 20px, 760px);
        padding-top: 10px;
    }

    .sn-profile-cover {
        height: 270px;
        min-height: 270px;
    }

    .sn-profile-main {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 14px;

        margin-top: -50px;

        padding:
            0 16px 18px;
    }

    .sn-profile-avatar-wrap {
        width: 110px;
        height: 110px;
    }

    .sn-profile-avatar,
    .sn-author-avatar,
    .profile-avatar {
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
    }

    .sn-profile-actions {
        grid-column: 1 / -1;
        padding: 0;
    }

    .sn-profile-actions > * {
        flex: 1;
    }

    .sn-profile-stats {
        margin-left: 16px;
        margin-right: 16px;
        gap: 24px;
    }

    .sn-profile-ring-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {

    .sn-profile-page {
        width: 100%;
        padding:
            8px 8px 60px;
    }

    .sn-profile-hero {
        border-radius: 17px;
    }

    .sn-profile-cover {
        height: 210px;
        min-height: 210px;

        border-radius:
            16px 16px 0 0;
    }

    .sn-profile-main {
        grid-template-columns: 82px minmax(0, 1fr);

        margin-top: -38px;

        padding:
            0 12px 15px;

        gap: 11px;
    }

    .sn-profile-avatar-wrap {
        width: 82px;
        height: 82px;
    }

    .sn-profile-avatar,
    .sn-author-avatar,
    .profile-avatar {
        width: 82px;
        height: 82px;
        min-width: 82px;
        min-height: 82px;

        border-width: 4px;
    }

    .sn-profile-name {
        font-size: 1.3rem;
    }

    .sn-profile-username {
        margin-top: 3px;
        font-size: .72rem;
    }

    .sn-profile-bio {
        margin-top: 6px;
        font-size: .75rem;
        line-height: 1.5;
    }

    .sn-profile-actions {
        gap: 6px;
    }

    .sn-profile-stats {
        margin:
            0 12px 16px;

        gap: 18px;

        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .sn-profile-stat {
        min-width: 62px;
    }

    .sn-profile-stat strong {
        font-size: 1.05rem;
    }

    .sn-profile-stat-label {
        font-size: .58rem;
    }

    .sn-profile-rewards {
        padding: 15px;
        border-radius: 16px;
    }

    .sn-profile-reward-grid,
    .sn-profile-badge-row {
        grid-template-columns: 1fr;
    }

    /* Preview becomes a mobile bottom sheet. */

    .sn-profile-preview-modal {
        place-items: end center;
        padding: 0;
    }

    .sn-profile-preview-dialog {
        width: 100%;
        max-height: 94vh;

        border-radius:
            22px 22px 0 0;
    }

    .sn-profile-preview-avatar-stage,
    .sn-profile-ring-live {
        min-height: 300px;
    }

    .sn-profile-preview-avatar {
        width: 210px;
        height: 210px;

        font-size: 58px;
    }

    .sn-profile-preview-cover {
        height: 260px;
        margin: 14px;
    }

    .sn-profile-ring-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        padding: 14px;
    }
}

@media (max-width: 420px) {

    .sn-profile-main {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .sn-profile-avatar-wrap {
        width: 72px;
        height: 72px;
    }

    .sn-profile-avatar,
    .sn-author-avatar,
    .profile-avatar {
        width: 72px;
        height: 72px;
        min-width: 72px;
        min-height: 72px;
    }

    .sn-profile-cover {
        height: 190px;
        min-height: 190px;
    }

    .sn-profile-name {
        font-size: 1.15rem;
    }

    .sn-profile-actions {
        flex-direction: column;
    }

    .sn-profile-actions > * {
        width: 100%;
    }

    .sn-profile-preview-avatar {
        width: 185px;
        height: 185px;
    }

    .sn-profile-ring-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

/* -----------------------------------------------------------------------
   REDUCED MOTION
------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .sn-profile-ring-option {
        transition: none;
    }
}

/* =========================================================
   PROFILE SOCIAL ACTIONS
========================================================= */

.sn-profile-social-actions {
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
}

.sn-profile-follow-button,
.sn-profile-say-hi-button {
    min-height:36px!important;
    height:36px!important;
    padding:0 14px!important;
    border-radius:10px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    font-size:.76rem!important;
    font-weight:700!important;
    line-height:1!important;
    text-decoration:none!important;
    cursor:pointer;
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease,
        opacity .18s ease;
}

.sn-profile-follow-button {
    border:1px solid #7c3aed!important;
    background:#7c3aed!important;
    color:#fff!important;
}

.sn-profile-follow-button:hover {
    transform:translateY(-1px);
}

.sn-profile-follow-button.is-following {
    background:rgba(124,58,237,.10)!important;
    color:#c4b5fd!important;
    border-color:rgba(124,58,237,.45)!important;
}

.sn-profile-follow-button.is-loading {
    opacity:.65;
    pointer-events:none;
}

.sn-profile-say-hi-button {
    border:1px solid rgba(255,255,255,.10)!important;
    background:rgba(255,255,255,.045)!important;
    color:#e4e4e7!important;
}

.sn-profile-say-hi-button:hover {
    transform:translateY(-1px);
    background:rgba(124,58,237,.10)!important;
    border-color:rgba(124,58,237,.35)!important;
    color:#c4b5fd!important;
}

.sn-profile-say-hi-button[hidden] {
    display:none!important;
}

.sn-profile-social-actions
.sn-profile-follow-button,
.sn-profile-social-actions
.sn-profile-say-hi-button {
    flex:0 0 auto!important;
    width:auto!important;
}

.sn-profile-online {
    width:9px;
    height:9px;
    display:inline-block;
    flex:0 0 9px;
    border-radius:50%;
    background:#22c55e;
    box-shadow:
        0 0 0 3px rgba(34,197,94,.10),
        0 0 12px rgba(34,197,94,.55);
}

.sn-profile-side-status {
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.sn-profile-side-status i {
    width:7px;
    height:7px;
    border-radius:50%;
    background:#71717a;
}

.sn-profile-side-status.is-online i {
    background:#22c55e;
    box-shadow:0 0 8px rgba(34,197,94,.6);
}

@media(max-width:700px) {

    .sn-profile-social-actions {
        width:100%;
        justify-content:flex-start;
    }

    .sn-profile-follow-button,
    .sn-profile-say-hi-button {
        min-height:34px!important;
        height:34px!important;
        padding:0 12px!important;
        font-size:.72rem!important;
    }

}