/* vir-chat profile photo gallery (custom module) */

/* In the profile: the first photo big, the rest below it */
body .main .info_panel > .content .field .icons.vc_gallery ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body .main .info_panel > .content .field .icons.vc_gallery ul li {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(127, 127, 140, .14);
    transition: filter .2s;
}

body .main .info_panel > .content .field .icons.vc_gallery ul li:hover {
    filter: brightness(1.06);
}

body .main .info_panel > .content .field .icons.vc_gallery ul li:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(40, 16, 60, .18);
}

/* how many photos there are, on the big one */
body .main .info_panel > .content .field .icons.vc_gallery ul li[data-count]::after {
    content: attr(data-count);
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
}

body .main .info_panel > .content .field .icons.vc_gallery ul li img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center 20%;
    box-shadow: none;
}

body .main .info_panel > .content .field .icons.vc_gallery ul li.vc_gallery_hidden img {
    opacity: .35;
}

/* Full-screen viewer and the upload dialog */
.vc_viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 12, .94);
    color: #fff;
}

.vc_viewer.open {
    display: flex;
}

.vc_viewer_img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

.vc_viewer_close,
.vc_viewer_nav {
    position: absolute;
    border: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    background: rgba(255, 255, 255, .16);
    cursor: pointer;
}

.vc_viewer_close {
    top: 12px;
    right: 12px;
}

.vc_viewer_nav {
    top: 50%;
    transform: translateY(-50%);
}

.vc_viewer_prev {
    left: 12px;
}

.vc_viewer_next {
    right: 12px;
}

.vc_viewer_bar {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 14px;
    white-space: nowrap;
    background: rgba(0, 0, 0, .55);
}

.vc_viewer_action {
    border: 0;
    border-radius: 10px;
    padding: 6px 12px;
    color: #fff;
    font-size: 13px;
    background: rgba(255, 255, 255, .16);
    cursor: pointer;
}

.vc_viewer_action.vc_viewer_delete {
    font-weight: 700;
    background: #d32f2f;
}

/* phones: the address bar must not cover the buttons */
@supports (height: 100dvh) {
    .vc_viewer {
        bottom: auto;
        height: 100dvh;
    }
}

.vc_manage_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.vc_manage_card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
}

.vc_manage_delete {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 6px 2px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    background: #d32f2f;
    cursor: pointer;
}

.vc_manage_delete:disabled {
    opacity: .5;
}

.vc_viewer_note {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 64px;
    text-align: center;
    font-size: 14px;
    text-shadow: 0 1px 3px #000;
}

.vc_upload_card {
    width: min(420px, calc(100vw - 32px));
    padding: 18px;
    border-radius: 16px;
    color: #222;
    background: #fff;
}

.vc_upload_title {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.vc_upload_rules {
    margin: 0 0 10px;
    padding-left: 18px;
    font-size: 14px;
}

.vc_upload_status {
    min-height: 20px;
    margin-bottom: 10px;
    font-size: 14px;
}

.vc_upload_status.error {
    color: #d32f2f;
}

.vc_upload_buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.vc_upload_buttons button {
    border: 0;
    border-radius: 12px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
}

.vc_upload_cancel {
    color: #444;
    background: rgba(127, 127, 140, .16);
}

.vc_upload_pick {
    color: #fff;
    background: linear-gradient(135deg, #FF5C9D, #8E5CFF);
}

.vc_upload_buttons button:disabled {
    opacity: .5;
}

body.dark_mode .vc_upload_card {
    color: #e8e8e8;
    background: #1f2329;
}

body.dark_mode .vc_upload_cancel {
    color: #e8e8e8;
}

/* Administrators' review window */
.vc_gallery_menu_icon {
    font-size: 18px;
    line-height: 1;
}

.vc_gallery_more {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    color: inherit;
    background: rgba(127, 127, 140, .16);
}

.vc_gallery_admin_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.vc_gallery_admin_card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    background: rgba(127, 127, 140, .1);
}

.vc_gallery_admin_card.reported {
    border-color: #d32f2f;
}

.vc_gallery_admin_card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
}

.vc_gallery_admin_user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.vc_gallery_admin_flag {
    color: #d32f2f;
    font-weight: 700;
}

.vc_gallery_admin_buttons {
    display: flex;
    gap: 4px;
}

.vc_gallery_admin_buttons button {
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(127, 127, 140, .2);
    color: inherit;
}

.vc_gallery_admin_buttons button.vc_gallery_admin_delete {
    color: #fff;
    background: #d32f2f;
}

.vc_gallery_admin_note {
    font-size: 11px;
    line-height: 1.3;
    opacity: .65;
}

body.dark_mode .vc_gift_tab:not(.active) {
    color: #c9c9d2;
}
