/* =========================================================
   LIVBEN ROOM DESKTOP CSS
   View bazli temiz surum
   Mobil burada yok
   ========================================================= */

.room-page {
    --room-bg: #ffffff;
    --room-bg-soft: #f8fafc;
    --room-bg-muted: #f1f5f9;
    --room-text: #111827;
    --room-text-soft: #6b7280;
    --room-border: #e5e7eb;
    --room-border-strong: #d1d5db;
    --room-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    --room-shadow-strong: 0 22px 48px rgba(15, 23, 42, 0.18);
    --room-radius: 16px;
    --room-gap: 16px;
    --room-card-padding: 14px;
    --room-link: #111827;
    --room-link-hover: #2563eb;
    color: var(--room-text);
    padding-top: 14px;
    padding-bottom: 14px;
}

.room-page *,
.room-page *::before,
.room-page *::after {
    box-sizing: border-box;
}

.room-page .card {
    min-width: 0;
    background: var(--room-bg);
    border: 1px solid var(--room-border);
    border-radius: var(--room-radius);
    box-shadow: var(--room-shadow);
}

.room-page .simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.room-page .btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--room-border-strong);
    border-radius: 12px;
    background: #ffffff;
    color: var(--room-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.room-page .btn:hover,
.room-page .btn:focus-visible {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
    outline: none;
}

.room-page .btn.btn-secondary {
    background: var(--room-bg-soft);
}

/* =========================================================
   HERO
   ========================================================= */

.room-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: var(--room-gap);
    padding: 14px 18px;
    background: var(--room-bg);
    border: 1px solid var(--room-border);
    border-radius: var(--room-radius);
    box-shadow: var(--room-shadow);
}

.room-hero > div {
    min-width: 0;
    flex: 1 1 auto;
}

.room-hero h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--room-text);
}

.room-hero p {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--room-text-soft);
}

.room-hero > span {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid var(--room-border);
    border-radius: 999px;
    background: var(--room-bg-soft);
    font-size: 13px;
    font-weight: 600;
    color: var(--room-text);
}

/* =========================================================
   MAIN GRID
   ========================================================= */

.room-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas:
        "stage participants"
        "chat participants";
    column-gap: var(--room-gap);
    row-gap: var(--room-gap);
    align-items: start;
}

.room-stage-card {
    grid-area: stage;
    min-width: 0;
    padding: var(--room-card-padding);
    overflow: hidden;
}

.room-participants-card {
    grid-area: participants;
    min-width: 0;
    min-height: 0;
    padding: var(--room-card-padding);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.room-chat-card {
    grid-area: chat;
    min-width: 0;
    min-height: 0;
    padding: var(--room-card-padding);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

/* =========================================================
   STAGE / SLOT
   ========================================================= */

.camera-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.camera-slot {
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #0f172a;
    overflow: hidden;
}

.camera-slot__inner {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    text-align: center;
}

.camera-slot__inner span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--room-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.90);
    color: var(--room-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.camera-slot video,
.camera-slot canvas,
.camera-slot img,
.camera-slot iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    background: #0f172a;
}

/* =========================================================
   PARTICIPANTS HEAD
   ========================================================= */

.room-participants-card__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    flex: 0 0 auto;
}

.room-participants-card__title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.room-participants-card__title-wrap h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--room-text);
}

.room-participants-card__hint {
    white-space: nowrap;
    font-size: 12px;
    line-height: 1;
    color: var(--room-text-soft);
}

.room-participants-card__search {
    min-width: 0;
}

.room-participants-card__search-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--room-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--room-text);
    font-size: 14px;
    outline: none;
}

.room-participants-card__search-input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* =========================================================
   PARTICIPANTS LIST
   ========================================================= */

.room-participant-list {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
    overflow-y: auto;
    overflow-x: hidden;
}

.room-participant-list::-webkit-scrollbar {
    width: 8px;
}

.room-participant-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.room-participant-list::-webkit-scrollbar-track {
    background: transparent;
}

.room-participant-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--room-border);
    border-radius: 12px;
    background: #ffffff;
}

.room-participant-item:hover {
    border-color: #cbd5e1;
    background: #fcfcfd;
}

.room-participant-item--actionable {
    cursor: context-menu;
}

.room-participant-item__main {
    min-width: 0;
    overflow: hidden;
}

.room-participant-item__name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--room-text);
}

.room-user-badge {
    width: 18px;
    height: 18px;
    min-width: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.room-user-badge img,
.room-user-badge svg {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.room-participant-item__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.room-participant-item__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.room-participant-item__status[hidden] {
    display: none !important;
}

.room-participant-item__menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--room-link);
    font-size: 13px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.room-participant-item__menu-link:hover,
.room-participant-item__menu-link:focus-visible {
    color: var(--room-link-hover);
    outline: none;
}

/* =========================================================
   PARTICIPANT CONTEXT MENU
   ========================================================= */

.room-participant-menu,
[data-room-participant-menu="1"] {
    position: fixed;
    z-index: 9999;
    min-width: 220px;
    max-width: 280px;
    max-height: min(420px, calc(100vh - 32px));
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--room-shadow-strong);
}

.room-participant-menu::-webkit-scrollbar,
[data-room-participant-menu="1"]::-webkit-scrollbar {
    width: 8px;
}

.room-participant-menu::-webkit-scrollbar-thumb,
[data-room-participant-menu="1"]::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.room-participant-menu button,
.room-participant-menu [role="menuitem"],
[data-room-participant-menu="1"] button,
[data-room-participant-menu="1"] [role="menuitem"] {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--room-text);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.room-participant-menu button:hover,
.room-participant-menu [role="menuitem"]:hover,
[data-room-participant-menu="1"] button:hover,
[data-room-participant-menu="1"] [role="menuitem"]:hover {
    background: var(--room-bg-soft);
}

/* =========================================================
   CHAT BOX
   ========================================================= */

.chat-box {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: 340px;
    min-width: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: var(--room-bg-soft);
}

.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.room-chat-message {
    flex: 0 0 auto;
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--room-text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.room-chat-message__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 6px;
    color: var(--room-text);
}

/* =========================================================
   STAGE ACTIONS
   ========================================================= */

.room-stage-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================================================
   CHAT FORM
   Mesaj solda - Gonder sagda
   ========================================================= */

.room-chat-form {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin: 0;
}

.room-chat-form input[type="hidden"] {
    display: none;
}

.room-chat-gifts {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 20;
    padding: 12px;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #ffffff;
}

.room-chat-gifts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 8px;
}

.room-chat-gifts__item {
    appearance: none;
    min-height: 42px;
    border: 1px solid var(--room-border);
    border-radius: 10px;
    background: var(--room-bg-soft);
    cursor: pointer;
    font-size: 18px;
}

.room-chat-gifts__item:hover,
.room-chat-gifts__item:focus-visible {
    border-color: #94a3b8;
    outline: none;
}

.room-chat-form textarea {
    grid-column: 1 / 2;
    display: block;
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 12px 14px;
    resize: none;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--room-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    outline: none;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.room-chat-form textarea::-webkit-scrollbar {
    width: 8px;
}

.room-chat-form textarea::-webkit-scrollbar-track {
    background: transparent;
}

.room-chat-form textarea::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.room-chat-form textarea:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.room-chat-form > .btn[type="submit"] {
    grid-column: 2 / 3;
    align-self: stretch;
    min-width: 112px;
    height: 48px;
}

/* =========================================================
   PRIVATE MESSAGE MODAL
   room-private.js popup/modal akisina gore
   ========================================================= */

.room-private-modal[hidden] {
    display: none !important;
}

.room-private-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.room-private-modal[data-open="1"] {
    display: block;
}

.room-private-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.16);
}

.room-private-modal__dialog {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: min(390px, calc(100vw - 36px));
    max-height: min(560px, calc(100vh - 36px));
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--room-border);
    border-radius: 18px;
    box-shadow: var(--room-shadow-strong);
    overflow: hidden;
}

.room-private-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--room-border);
    background: #ffffff;
}

.room-private-modal__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--room-text);
}

.room-private-modal__meta {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--room-text-soft);
}

.room-private-modal__close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--room-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--room-text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.room-private-modal__close:hover,
.room-private-modal__close:focus-visible {
    border-color: #94a3b8;
    outline: none;
}

.room-private-modal__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    min-height: 0;
}

.room-private-modal__error {
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.4;
}

.room-private-modal__thread {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #f8fafc;
}

.room-private-modal__thread::-webkit-scrollbar {
    width: 8px;
}

.room-private-modal__thread::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.room-private-modal__thread [data-room-private-thread-item="1"] {
    display: flex;
    margin: 0 0 8px;
}

.room-private-modal__thread [data-room-private-thread-item="1"]:last-child {
    margin-bottom: 0;
}

.room-private-modal__thread [data-room-private-thread-item="1"][data-is-mine="1"] {
    justify-content: flex-end;
}

.room-private-modal__thread [data-room-private-thread-bubble="1"] {
    max-width: 82%;
    padding: 10px 12px;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.room-private-modal__thread [data-room-private-thread-item="1"][data-is-mine="1"] [data-room-private-thread-bubble="1"] {
    background: #eef4ff;
    border-color: #dbe7ff;
}

.room-private-modal__thread [data-room-private-thread-text="1"] {
    font-size: 14px;
    line-height: 1.5;
    color: var(--room-text);
    word-break: break-word;
}

.room-private-modal__thread [data-room-private-thread-meta="1"] {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--room-text-soft);
}

.room-private-modal__body form[data-room-private-form="1"] {
    display: grid;
    gap: 10px;
    margin: 0;
}

.room-private-modal__textarea {
    width: 100%;
    min-width: 0;
    min-height: 78px;
    max-height: 110px;
    padding: 12px 14px;
    resize: vertical;
    border: 1px solid var(--room-border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--room-text);
    font: inherit;
    line-height: 1.45;
    outline: none;
}

.room-private-modal__textarea:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.room-private-modal__foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.room-private-modal__button {
    min-width: 96px;
}

@keyframes livben-speaker-pulse {
    0% {
        opacity: .75;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 14px 2px rgba(34, 197, 94, .30);
    }
    100% {
        opacity: .85;
        box-shadow: 0 0 8px 1px rgba(34, 197, 94, .18);
    }
}

.room-stage-user[data-speaking="1"] .room-stage-user__media::after,
.room-stage-user.is-speaking .room-stage-user__media::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(34, 197, 94, .95);
    border-radius: inherit;
    pointer-events: none;
    box-sizing: border-box;
    animation: livben-speaker-pulse .9s ease-in-out infinite;
}