/**
 * user_profile_modal.css
 * BEM namespace: .user-profile-modal
 */

.user-profile-modal__backdrop {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--modal-backdrop);
}

.user-profile-modal__panel {
    width: min(680px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 32px));
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.user-profile-modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--hairline);
}

.user-profile-modal__head h2 {
    margin: 0;
    color: var(--text);
    font: 800 20px/1.1 'Inter Tight', 'Inter', sans-serif;
}

.user-profile-modal__head-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: var(--iris-tint);
    color: var(--iris);
    flex: 0 0 auto;
}

.user-profile-modal__head-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.user-profile-modal__head-copy span {
    color: var(--text-3);
    font: 650 12px 'Inter', sans-serif;
}

.user-profile-modal__posts-link {
    color: var(--text-3);
    text-decoration: none;
    font: 700 11px 'JetBrains Mono', monospace;
}

.user-profile-modal__posts-link:hover {
    color: var(--iris);
}

.user-profile-modal__close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.user-profile-modal__close::before,
.user-profile-modal__close::after {
    display: none;
}

.user-profile-modal__close:hover,
.user-profile-modal__close:focus-visible {
    transform: none;
    background: var(--surface);
    color: var(--text);
}

.user-profile-modal__body {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: 16px;
    padding: 18px;
}

.user-profile-modal__hero {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 14px;
    align-items: center;
}

.user-profile-modal__avatar {
    position: relative;
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    color: white;
    font: 800 24px 'Inter Tight', 'Inter', sans-serif;
}

.user-profile-modal__avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-modal__avatar:has(> .user-profile-modal__avatar-img:not([hidden])) > span:first-child {
    opacity: 0;
}

.user-profile-modal__identity {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.user-profile-modal__name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.user-profile-modal__name-row strong {
    color: var(--text);
    font: 800 22px/1.1 'Inter Tight', 'Inter', sans-serif;
}

.user-profile-modal__admin-badge,
.user-profile-modal__subscriber-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    font: 800 10px 'Inter Tight', 'Inter', sans-serif;
    text-transform: uppercase;
}

.user-profile-modal__admin-badge {
    background: var(--red-tint);
    color: var(--red);
}

.user-profile-modal__subscriber-badge {
    background: color-mix(in srgb, var(--amber) 14%, transparent);
    color: var(--amber);
}

.user-profile-modal__handle,
.user-profile-modal__joined {
    color: var(--text-3);
    font: 650 12px 'Inter', sans-serif;
}

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

.user-profile-modal__stat,
.user-profile-modal__section {
    padding: 12px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--surface-2);
}

.user-profile-modal__stat {
    display: grid;
    gap: 4px;
}

.user-profile-modal__stat span,
.user-profile-modal__section h3 {
    margin: 0;
    color: var(--text-3);
    font: 800 11px 'Inter Tight', 'Inter', sans-serif;
    text-transform: uppercase;
}

.user-profile-modal__section h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-profile-modal__stat strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font: 800 16px 'Inter Tight', 'Inter', sans-serif;
}

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

.user-profile-modal__top-tickers,
.user-profile-modal__chips {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-profile-modal__ticker,
.user-profile-modal__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--surface);
    text-decoration: none;
}

.user-profile-modal__ticker-logo {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    background: var(--surface);
}

.user-profile-modal__ticker-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.user-profile-modal__ticker-logo-fallback {
    color: currentColor;
    font: 900 9px 'Inter Tight', 'Inter', sans-serif;
}

.user-profile-modal__ticker strong,
.user-profile-modal__chip {
    color: var(--text);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
}

.user-profile-modal__ticker span {
    color: var(--text-3);
    font: 700 11px 'JetBrains Mono', monospace;
}

.user-profile-modal__chip--bullish {
    background: var(--green-tint);
    color: var(--green-2);
}

.user-profile-modal__chip--bearish {
    background: var(--red-tint);
    color: var(--red);
}

.user-profile-modal__pick-rows {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.user-profile-modal__pick-row {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface);
}

.user-profile-modal__pick-row--bullish {
    border-color: color-mix(in srgb, var(--green) 18%, var(--hairline));
}

.user-profile-modal__pick-row--bearish {
    border-color: color-mix(in srgb, var(--red) 18%, var(--hairline));
}

.user-profile-modal__pick-target {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 2px;
}

.user-profile-modal__pick-target strong {
    color: var(--text);
    font: 850 12px 'JetBrains Mono', monospace;
}

.user-profile-modal__pick-target small {
    color: var(--text-3);
    font: 750 12px 'JetBrains Mono', monospace;
}

.user-profile-modal__empty,
.user-profile-modal__loading {
    color: var(--text-3);
    font: 650 13px 'Inter', sans-serif;
}

.user-profile-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--hairline);
    background: var(--surface);
}

.user-profile-modal__btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font: 800 13px 'Inter Tight', 'Inter', sans-serif;
    cursor: pointer;
}

.user-profile-modal__btn--primary {
    border-color: transparent;
    background: var(--text);
    color: var(--surface);
}

.user-profile-modal__btn:hover {
    transform: none;
    filter: brightness(1.04);
}

@media (max-width: 640px) {
    .user-profile-modal__panel {
        max-height: calc(100vh - 20px);
    }

    .user-profile-modal__hero,
    .user-profile-modal__stats,
    .user-profile-modal__ticker-columns {
        grid-template-columns: 1fr;
    }

    .user-profile-modal__hero {
        justify-items: center;
        text-align: center;
    }

    .user-profile-modal__pick-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .user-profile-modal__name-row,
    .user-profile-modal__footer {
        justify-content: center;
    }
}
