/* ==========================================================================
   User Profile Modal
   ========================================================================== */

.wt-upm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 450;
    background: rgba(10, 5, 8, .6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: flex-end;
    justify-content: center;
}
.wt-upm-backdrop--open { display: flex; }

.wt-upm-modal {
    background: var(--white);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: wtUpmUp .28s cubic-bezier(.4, 0, .2, 1);
}

@keyframes wtUpmUp {
    from { transform: translateY(32px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Sliding panels ── */
.wt-upm-clip {
    overflow: hidden;
}

.wt-upm-track {
    display: flex;
    width: 200%;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.wt-upm-track--config {
    transform: translateX(-50%);
}

.wt-upm-panel {
    width: 50%;
    flex-shrink: 0;
    padding: 20px 20px 28px;
    box-sizing: border-box;
}

/* ── Close button ── */
.wt-upm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    margin-left: auto;
    margin-bottom: 16px;
    color: var(--gray-500);
    transition: background .15s, color .15s;
}
.wt-upm-close:hover { background: var(--gray-200); color: var(--gray-800); }
.wt-upm-close svg   { width: 16px; height: 16px; }

/* ── Header: avatar + info ── */
.wt-upm-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.wt-upm-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    width: 100px;
    height: 100px;
}

.wt-upm-avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--gray-100);
    display: block;
}

.wt-upm-avatar-edit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.wt-upm-avatar-wrap:hover .wt-upm-avatar-edit {
    opacity: 1;
}

.wt-upm-avatar-edit svg {
    width: 22px;
    height: 22px;
    color: var(--white);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

@media (hover: none) {
    .wt-upm-avatar-edit {
        opacity: 1;
        background: rgba(0, 0, 0, .3);
    }
}

.wt-upm-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.wt-upm-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-upm-login {
    font-size: .82rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Separator ── */
.wt-upm-sep {
    height: 1px;
    background: var(--gray-100);
    margin: 0 -20px 8px;
}

/* ── Menu list ── */
.wt-upm-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wt-upm-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    color: var(--gray-800);
    text-decoration: none;
    border-radius: 8px;
    transition: background .15s;
    box-sizing: border-box;
}
.wt-upm-item:hover { background: var(--gray-50); }

.wt-upm-item--danger         { color: #dc2626; }
.wt-upm-item--danger:hover   { background: #fff5f5; }

.wt-upm-item__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--gray-500);
}
.wt-upm-item--danger .wt-upm-item__icon { color: #ef4444; }

.wt-upm-item__label {
    flex: 1;
    text-align: left;
    font-size: .97rem;
    font-weight: 500;
}

.wt-upm-item__chev {
    width: 16px;
    height: 16px;
    color: var(--gray-300);
    flex-shrink: 0;
}

/* ── Config panel topbar ── */
.wt-upm-config-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.wt-upm-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-600);
    flex-shrink: 0;
    transition: background .15s;
}
.wt-upm-back:hover { background: var(--gray-100); }
.wt-upm-back svg   { width: 18px; height: 18px; }

.wt-upm-config-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ── Mobile: full screen ── */
@media (max-width: 620px) {
    .wt-upm-backdrop {
        align-items: flex-start;
    }

    .wt-upm-modal {
        position: fixed;
        inset: 0;
        border-radius: 0;
        max-width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wt-upm-clip { overflow: hidden; }

    .wt-upm-panel {
        padding: 28px 18px 32px;
    }

    .wt-upm-sep { margin: 0 -18px 8px; }
}

/* ── Desktop: centered card ── */
@media (min-width: 621px) {
    .wt-upm-backdrop {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .wt-upm-modal {
        border-radius: 16px;
        width: 380px;
        max-width: calc(100vw - 48px);
    }
}
