/* Profile media links — modal, profile icons, player */

.pml-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(.65rem, env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right)) max(.65rem, env(safe-area-inset-bottom)) max(.65rem, env(safe-area-inset-left));
    background: rgba(8, 12, 28, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: pmlFadeIn .22s ease;
    pointer-events: auto;
}

.pml-overlay--player {
    z-index: 200010;
}

@keyframes pmlFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pml-modal {
    position: relative;
    width: min(320px, 94vw);
    max-height: min(88vh, 520px);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .32), 0 0 0 1px rgba(255, 255, 255, .6) inset;
    overflow: hidden;
    animation: pmlSlideUp .26s ease;
    display: flex;
    flex-direction: column;
}

.pml-modal__banner {
    width: 100%;
    flex-shrink: 0;
    line-height: 0;
    background: #0f172a;
}

.pml-modal__banner img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.pml-modal__close--float {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.pml-modal__body {
    padding: .75rem .85rem .85rem;
    direction: rtl;
    overflow-y: auto;
    flex: 1 1 auto;
}

.pml-modal__title {
    margin: 0 0 .35rem;
    font-size: .88rem;
    font-weight: 800;
    color: #1e293b;
    text-align: center;
}

.pml-modal__hint {
    margin: 0 0 .65rem;
    font-size: .72rem;
    color: #64748b;
    line-height: 1.5;
    text-align: center;
}

.pml-field {
    margin-bottom: .55rem;
}

.pml-field label {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .28rem;
    font-size: .72rem;
    font-weight: 700;
    color: #334155;
}

.pml-field label img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.pml-field input {
    width: 100%;
    border: 1px solid #dbe3f0;
    border-radius: 8px;
    padding: .45rem .55rem;
    font-size: .72rem;
    background: #fff;
    color: #0f172a;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pml-field input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

.pml-modal__actions {
    display: flex;
    gap: .45rem;
    margin-top: .65rem;
}

.pml-modal__actions button {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: .48rem .6rem;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}

@keyframes pmlSlideUp {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pml-modal__close {
    border: none;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .pml-modal {
        width: min(340px, 42vw);
    }
}

.pml-btn-save {
    background: linear-gradient(120deg, #6366f1, #8b5cf6);
    color: #fff;
}

.pml-btn-cancel {
    background: #e2e8f0;
    color: #475569;
}

.pml-profile-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 6px;
    direction: ltr;
    width: 100%;
    position: relative;
    z-index: 3;
}

.pml-profile-icons--profile {
    padding: 4px 0 2px;
}

.pml-profile-icons__btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    opacity: .92;
    transition: transform .15s ease, opacity .15s ease;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.pml-profile-icons__btn:focus,
.pml-profile-icons__btn:active {
    outline: none;
    box-shadow: none;
    border: none;
}

.pml-profile-icons__btn::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.pml-profile-icons__btn:hover {
    opacity: 1;
    transform: scale(1.08);
}

.pml-profile-icons__btn img {
    width: 27px;
    height: 27px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* أيقونات قائمة المتواجدين — مكان العلم (وسط عمودي يمين) */
#chat__body__users-pane .chat_pane__user_item,
#online_users .chat_pane__user_item {
    position: relative;
}

.pml-list-icons {
    position: absolute;
    top: 50%;
    right: .05em;
    transform: translateY(-50%);
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    z-index: 3;
    direction: ltr;
    line-height: 0;
}

.pml-list-icons--readonly {
    pointer-events: none;
    cursor: default;
}

.pml-list-icons--readonly .pml-list-icons__btn {
    cursor: default;
    pointer-events: none;
}

.pml-list-icons__btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    opacity: .95;
    transition: transform .15s ease, opacity .15s ease;
}

.pml-list-icons__btn:focus,
.pml-list-icons__btn:active {
    outline: none;
    box-shadow: none;
    border: none;
}

.pml-list-icons__btn::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.pml-list-icons__btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pml-list-icons__btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.pml-player {
    width: 100%;
    max-width: 360px;
    border-radius: 16px;
    overflow: hidden;
    background: #0b1020;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}

.pml-player__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .75rem;
    background: linear-gradient(90deg, #1e293b, #0f172a);
    color: #e2e8f0;
    font-size: .75rem;
    font-weight: 700;
}

.pml-player--tiktok {
    max-width: 340px;
    overflow: visible;
}

.pml-player__frame-wrap {
    position: relative;
    width: 100%;
    background: #000;
}

.pml-player__frame-wrap--yt {
    padding-top: 56.25%;
}

.pml-player__frame-wrap--yt iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.pml-player__frame-wrap--tt {
    padding: 0;
    height: auto;
    overflow: hidden;
    background: #000;
    text-align: center;
}

.pml-player__frame-wrap--tt .pml-player__tt-iframe,
.pml-player__frame-wrap--tt .wall_post__tiktok-iframe {
    display: block;
    width: 100%;
    max-width: 325px;
    height: 435px;
    margin: 0 auto;
    border: 0;
    background: #000;
}

/* Profile cover — Saudi Top style */
#user_profile .modal-content,
#user_profile .user_profile__scroll_area,
#user_profile .user_profile__body {
    overflow: visible !important;
}

#user_profile .user_profile__cover-container {
    width: 100%;
    height: 130px;
    position: relative;
    overflow: visible !important;
    margin: 0 0 2.75rem;
    background: linear-gradient(180deg, #cfd4dc 0%, #b7bec8 100%);
    display: block;
    z-index: 2;
}

#user_profile .user_profile__cover-container .user_profile__body__cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

#user_profile .modal-dialog > .user_profile__cover-container,
#user_profile .user_profile__body > .user_profile__cover-container {
    margin-top: 0;
}

#user_profile .user_profile__cover-container--empty {
    background: linear-gradient(180deg, #d6dbe3 0%, #bcc4cf 100%);
}

#user_profile .user_profile__avatar-overlay {
    position: absolute;
    left: 0.55rem;
    bottom: 0;
    transform: translateY(50%);
    z-index: 4;
    border: 3px solid #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    background: #fff;
}

#user_profile .user_profile__avatar-overlay .user_profile__cover-avatar {
    width: 74px;
    height: 74px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

#user_profile:has(.user_profile__cover-container) #user_profile__body__avatar {
    display: none !important;
}

#user_profile .user_profile__cover-container--own {
    margin-bottom: 2.75rem;
}

#user_profile .user_profile__cover-camera-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 7;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 38px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-size: 18px;
    text-align: center;
}

#user_profile .user_profile__cover-container.is-loading .user_profile__cover-camera-btn {
    opacity: 0.65;
    pointer-events: none;
}

#user_profile .user_profile__cover-container.is-loading .user_profile__cover-camera-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    background: url(/images/loader.gif) center center / contain no-repeat;
}

#chat__body__settings_pane__container__button--change-profile-cover {
    cursor: pointer;
    margin-bottom: .2rem;
}

#chat__body__settings_pane__container__button--change-profile-cover .loader {
    display: none;
}

#chat__body__settings_pane__container__button--change-profile-cover.disabled .loader {
    display: inline;
}

.pml-cover-lightbox {
    position: fixed;
    inset: 0;
    z-index: 300000;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: zoom-out;
}

.pml-cover-lightbox img {
    max-width: min(96vw, 900px);
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
