/**
 * Всплывающая карточка автора (public/js/userinfo.js).
 *
 * Стили не зависят от темы: модалка выглядит одинаково в ENews-day,
 * ENews-bs5 и мобильной. Классы с префиксом upm- (user profile modal),
 * чтобы не пересекаться со стилями DLE-скинов.
 */

.upm[hidden] { display: none !important; }

.upm {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.upm-backdrop {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
}

body.upm-open { overflow: hidden; }

.upm-dialog {
    position: relative;
    width: 100%;
    max-width: 660px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    color: #333;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
    font: 14px/1.45 Arial, Helvetica, sans-serif;
    text-align: left;
}

/* ---------- Заголовок ---------- */

.upm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    background: #f3f4f6;
    border-bottom: 1px solid #dfe1e5;
    font-size: 18px;
    color: #4a4a4a;
}

.upm-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Красная кнопка закрытия. Явно перекрываем глобальные стили кнопок тем
   (в ENews-day это button:not([class*="mpro-"]) { height: 40px ... }). */
body .upm .upm-x {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 3px;
    background: #e04b4b;
    color: #fff;
    font: 700 18px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
    box-shadow: none;
}

body .upm .upm-x:hover,
body .upm .upm-x:focus {
    background: #c93c3c;
    color: #fff;
}

/* ---------- Тело ---------- */

.upm-body {
    display: flex;
    gap: 20px;
    padding: 18px 16px 6px;
}

.upm-left {
    flex: 0 0 150px;
    text-align: center;
}

.upm-ava {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    overflow: hidden;
    background: #eef0f2;
}

.upm-ava img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.upm-state {
    display: block;
    width: 140px;
    margin: 10px auto 0;
    padding: 4px 8px;
    border-radius: 3px;
    background: #6f7780;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.upm-state.upm-online { background: #4caf50; }

.upm-right {
    flex: 1 1 auto;
    min-width: 0;
}

.upm-row {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.upm-row:last-child { border-bottom: 0; }

.upm-k {
    flex: 0 0 145px;
    color: #555;
}

.upm-v {
    flex: 1 1 auto;
    min-width: 0;
    color: #333;
    overflow-wrap: anywhere;
}

.upm-link {
    color: #398dd8;
    text-decoration: none;
}

.upm-link:hover { text-decoration: underline; }

.upm-loading { padding: 20px 0; color: #777; }
.upm-error { padding: 20px 0; color: #c00; }

/* ---------- Кнопки ---------- */

.upm-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 14px 16px 16px;
    border-top: 1px solid #e6e6e6;
}

.upm-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 3px;
    background: #398dd8;
    color: #fff !important;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.upm-btn:hover {
    background: #2f7cbf;
    color: #fff !important;
    text-decoration: none;
}

/* ---------- Узкие экраны ---------- */

@media (max-width: 560px) {
    .upm { padding: 8px; }

    .upm-dialog { max-height: calc(100vh - 16px); }

    .upm-body {
        flex-direction: column;
        align-items: center;
    }

    .upm-left { flex: 0 0 auto; }

    .upm-right { width: 100%; }

    .upm-row {
        flex-direction: column;
        gap: 0;
    }

    .upm-k { flex: none; }

    .upm-foot { flex-direction: column; }
}
