/* Модальное окно пользователя */
#user-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0; top: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(120deg, #f5f7fa 0%, #c3cfe2 100%);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(7px);
    overflow-y: auto; /* Добавлено: скролл если не влезает */
}

.user-modal-content {
    background: rgba(255,255,255,0.85);
        border-top-left-radius: 32px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 0;
    box-shadow: 0 24px 64px 0 rgba(78, 84, 200, 0.28), 0 2px 12px rgba(0,0,0,0.13);
    padding: 0;
    max-width: 420px;
    width: 97vw;
    max-height: 96vh;
    overflow-y: auto;
    box-sizing: border-box;
    /* --- Стилизация скроллбара (универсально) --- */
    scrollbar-width: thin !important;
    scrollbar-color: #ff6f91 #f5f7fa !important;
    /* --- УБРАНО: -webkit-mask-image, чтобы не было внутреннего скругления --- */
    /* overflow-y: overlay; оставляем для скролла поверх контента */
    overflow-y: overlay;
}
/* Для Chrome, Edge, Safari */
.user-modal-content::-webkit-scrollbar,
.user-modal-content.custom-scrollbar::-webkit-scrollbar {
    width: 8px !important;
    background: transparent !important;
    border-radius: 32px;
}
.user-modal-content::-webkit-scrollbar-thumb,
.user-modal-content.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6f91 0%, #ff9472 100%) !important;
    border-radius: 32px !important;
    margin: 16px 0;
    /* Градиент для прозрачности у краёв */
    box-shadow: 0 8px 16px 8px rgba(255,255,255,0.01) inset;
}
.user-modal-content::-webkit-scrollbar-corner,
.user-modal-content.custom-scrollbar::-webkit-scrollbar-corner {
    background: transparent !important;
}
.user-modal-header {
    background: transparent;
    padding: 0;
    text-align: right;
    color: #fff;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    position: relative;
    box-shadow: none;
    min-height: 0;
    margin-top: 0;
}

.user-modal-avatar {
    display: none;
}

.fade-transition {
  transition: opacity 0.3s ease;
}
.user-modal-content {
  opacity: 1;
}
.user-modal-avatar-status {
    border-radius: 50%;
    border: 4px solid #fff;
    width: 100%;
    max-width: 140px;
    height: 140px;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    box-shadow: 0 8px 32px rgba(78,84,200,0.18);
    margin-bottom: 0;
    margin-top: 0;
    /* border-color будет ниже */
}
.user-modal-avatar-status.online {
    border: 4px solid #00e676;
    box-shadow: 0 0 0 3px #b9f6ca, 0 8px 32px rgba(78,84,200,0.18);
}
.user-modal-avatar-status.offline {
    border: 4px solid #ff5252;
    box-shadow: 0 0 0 3px #ffcdd2, 0 8px 32px rgba(78,84,200,0.18);
}

.user-modal-online-label {
    font-size: 1em;
    font-weight: 700;
    margin-bottom: 6px;
    display: inline-block;
    padding: 2px 14px;
    border-radius: 12px;
    background: #fff;
    color: #00e676;
    box-shadow: 0 1px 4px rgba(78,84,200,0.04);
    position: relative;
    left: 0;
}
.user-modal-online-label.offline {
    color: #ff5252;
    background: #fff;
}

.user-modal-name,
.user-modal-age-city {
    display: none;
}

.user-modal-photo-area {
    position: relative;
    width: 100%;
    border-top-left-radius: 32px;
    overflow: hidden;
    background: #eee;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    min-height: 400px;
    background-size: cover;
    background-position: center;
}
.user-modal-photo-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1.15;
    min-height: 260px;
    background: #eee;
}
.user-modal-photo-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.user-modal-photo-info {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 24px 22px 18px 22px;
    background: linear-gradient(0deg, rgba(30,30,50,0.82) 70%, rgba(30,30,50,0.05) 100%);
    color: #fff;
}
.user-modal-photo-name {
    font-size: 2em;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin-bottom: 2px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.user-modal-photo-age-city {
    font-size: 1.15em;
    font-weight: 500;
    color: #e0e0ff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.13);
}

.user-modal-photo-thumbs {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 16px;
    bottom: 12px;
    z-index: 2;
}
.user-modal-photo-thumb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(78,84,200,0.13);
    border: 2px solid #fff;
    background: #fff;
    cursor: pointer;
    transition: transform 0.15s;
}
.user-modal-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.user-modal-photo-thumb:hover {
    transform: scale(1.08);
}

.user-modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(255,255,255,0.85);
    border: none;
    color: #ff6f91;
    font-size: 2.2em;
    cursor: pointer;
    z-index: 20;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(255,111,145,0.13);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.user-modal-close:hover {
    background: #ff6f91;
    color: #fff;
    transform: scale(1.12);
}

.user-modal-section {
    padding: 18px 22px 10px 22px;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #ececff;
    box-shadow: none;
    margin: 0;
    word-break: break-word;
}

.user-modal-section:first-of-type {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.user-modal-section:last-child {
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    border-bottom: none;
}

.user-modal-section-title {
    font-size: 1.08em;
    font-weight: 700;
    color: #4e54c8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.01em;
}

.user-modal-section-title i {
    color: #ff6f91;
    font-size: 1.15em;
}

.user-modal-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-modal-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 1em;
    color: #2c3e50;
    background: rgba(245,247,250,0.7);
    border-radius: 10px;
    padding: 7px 12px;
    transition: background 0.2s;
    word-break: break-word;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(78,84,200,0.04);
}

.user-modal-field i {
    color: #4e54c8;
    min-width: 20px;
    text-align: center;
    margin-top: 2px;
}

.user-modal-field span {
    font-weight: 500;
    color: #232043;
}

.user-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.user-modal-tag {
    background: linear-gradient(135deg, #ff9472 0%, #ff6f91 100%);
    color: #fff;
    border-radius: 16px;
    padding: 5px 14px;
    font-size: 0.98em;
    margin-bottom: 2px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(255,111,145,0.10);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.2s, transform 0.13s;
}
.user-modal-tag:hover {
    background: linear-gradient(135deg, #ff6f91 0%, #ff9472 100%);
    transform: scale(1.07);
}

.user-modal-bio {
    font-size: 1.08em;
    color: #444;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    padding: 10px 14px;
    line-height: 1.5;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(78,84,200,0.04);
    word-break: break-word;
    white-space: pre-line;
}

.user-modal-socials {
    display: flex;
    gap: 18px;
    margin-top: 18px;
    margin-bottom: 0;
    justify-content: center;
    position: relative;
    left: 0; right: 0;
    bottom: 0;
    z-index: 3;
}
.user-modal-socials a {
    color: #fff;
    font-size: 1.5em;
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(78,84,200,0.12);
    transition: background 0.2s, color 0.2s, transform 0.15s;
    position: relative;
}
.user-modal-socials a::after {
    content: attr(title);
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 110%;
    font-size: 0.75em;
    color: #4e54c8;
    background: rgba(255,255,255,0.85);
    border-radius: 8px;
    padding: 2px 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
    white-space: nowrap;
}
.user-modal-socials a:hover::after {
    opacity: 1;
}
.user-modal-socials a:hover {
    background: linear-gradient(135deg, #ff6f91 0%, #ff9472 100%);
    color: #fff;
    transform: scale(1.12);
}

.user-modal-gallery {
    display: flex;
    gap: 10px;
    padding: 18px 22px 0 22px;
    overflow-x: auto;
    margin-bottom: 10px;
}
.user-modal-gallery-item {
    flex: 0 0 90px;
    height: 90px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(78,84,200,0.10);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s;
}
.user-modal-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.user-modal-gallery-item:hover {
    transform: scale(1.06);
}

.user-modal-containers {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.user-modal-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(78,84,200,0.08);
    padding: 10px 16px;
    font-size: 1em;
    color: #232043;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: box-shadow 0.18s, background 0.18s;
    min-width: 120px;
    max-width: 100%;
    word-break: break-word;
}
.user-modal-container i {
    color: #ff6f91;
    font-size: 1.1em;
}
.user-modal-container:hover {
    background: linear-gradient(135deg, #ff9472 0%, #ff6f91 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,111,145,0.13);
}
.user-modal-container:hover i {
    color: #fff;
}

.user-modal-photo-dots {
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 4;
}
.user-modal-photo-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ff6f91;
    opacity: 0.5;
    cursor: pointer;
    display: inline-block;
    transition: opacity 0.2s, background 0.2s;
}
.user-modal-photo-dot.active,
.user-modal-photo-dot:hover {
    opacity: 1;
    background: #ff6f91;
}


@media (max-width: 600px) {
    .user-modal-content,
    .user-modal-content.custom-scrollbar {
        max-width: 99vw;
        width: 99vw;
        max-height: 98vh;
        overflow-y: auto;
        box-sizing: border-box;
        /* --- Стилизация скроллбара на мобильных --- */
        scrollbar-width: thin;
        scrollbar-color: #ff6f91 #f5f7fa;
        overflow-y: overlay;
        /* --- УБРАНО: -webkit-mask-image, чтобы не было внутреннего скругления --- */
    }
    .user-modal-content::-webkit-scrollbar,
    .user-modal-content.custom-scrollbar::-webkit-scrollbar {
        width: 8px;
        background: #f5f7fa;
        border-radius: 18px;
    }
    .user-modal-content::-webkit-scrollbar-thumb,
    .user-modal-content.custom-scrollbar::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #ff6f91 0%, #ff9472 100%);
        border-radius: 18px;
        margin: 6px 0;
    }
    .user-modal-content::-webkit-scrollbar-corner,
    .user-modal-content.custom-scrollbar::-webkit-scrollbar-corner {
        background: transparent !important;
    }
    .user-modal-header, .user-modal-section {
        padding-left: 6px;
        padding-right: 6px;
    }
    .user-modal-header {
        padding-top: 24px;
        padding-bottom: 8px;
    }
    .user-modal-avatar {
        width: 80px;
        height: 80px;
        margin-top: -40px;
    }
    .user-modal-name {
        margin-top: 60px;
    }
    .user-modal-section {
        padding: 8px 2vw 4px 2vw;
        font-size: 0.97em;
    }
    .user-modal-section:last-child {
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
    }
    .user-modal-gallery {
        padding: 10px 4px 0 4px;
        gap: 6px;
    }
    .user-modal-gallery-item {
        flex: 0 0 60px;
        height: 60px;
        border-radius: 10px;
    }
    .user-modal-containers {
        gap: 7px;
    }
    .user-modal-container {
        padding: 7px 10px;
        font-size: 0.95em;
        min-width: 80px;
    }
    .user-modal-photo-main {
        min-height: 160px;
        aspect-ratio: 1/1.2;
    }
    .user-modal-photo-info {
        padding: 16px 8px 10px 8px;
    }
    .user-modal-photo-thumb {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }
    .user-modal-photo-area {
        border-top-left-radius: 18px;
    }
    .user-modal-bio {
        font-size: 0.98em;
        padding: 7px 7px;
    }
    #user-modal {
        overflow-y: auto; /* На мобильных тоже */
    }
}

/* Анимации */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.93);}
    to { opacity: 1; transform: scale(1);}
}
@keyframes fadeIn {
    from { opacity: 0;}
    to { opacity: 1;}
}
    