/* ==============================================
   ROOM LIST & HALL DISCOVERY
   ============================================== */

.connection-badge {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 0.8rem;
    color: #ff4444;
}

.room-list-container {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: 12px;
    padding: 12px 24px 24px;
    max-width: 1920px;
    margin: 0 auto;
}

.room-list-container.active {
    display: flex;
}

.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 8px;
}

/* Room Grid */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px 16px;
    padding: 10px 0 60px;
}

.room-card-wrapper {
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
}

/* ============ Room Card ============ */
.room-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ---- Cover / Thumbnail ---- */
.room-card-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #1a1a1a;
}

.room-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.room-card:hover .room-card-cover img {
    transform: scale(1.04);
}

/* Gradient placeholder for sessions without a poster */
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg,
            hsl(30, 60%, 12%) 0%,
            hsl(25, 50%, 18%) 40%,
            hsl(20, 40%, 10%) 100%);
}

.cover-placeholder span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Duration badge (bottom-right of cover) */
.cover-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    font-feature-settings: 'tnum';
    line-height: 1.3;
}

/* LIVE badge (top-left of cover) */
.cover-live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e53e3e;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.06em;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.5);
}

.cover-live-badge .pulse-dot {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Video badge (top-right of cover) */
.cover-video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 0.6rem;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

/* ---- Card Body (below cover) ---- */
.room-card-body {
    padding: 10px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f0f0f0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Meta row: avatars · plays · date */
.room-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.room-avatars-stack {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.stacked-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #1a1a1a;
    margin-left: -6px;
    overflow: hidden;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
}

.stacked-avatar:first-child {
    margin-left: 0;
}

.stacked-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meta-item {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.meta-item i {
    font-size: 0.65rem;
}

/* More button — inline in meta row */
.room-card-more-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.room-card:hover .room-card-more-btn {
    opacity: 1;
}

.room-card-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Legacy compat — keep for management page */
.room-category-badge {
    display: none;
}

.room-summary {
    display: none;
}

.room-stats {
    display: none;
}

.room-footer {
    display: none;
}

.room-status-badge {
    display: none;
}

.room-card-poster {
    display: none;
}

/* ============ Dropdown Menu ============ */
.glass-dropdown {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    backdrop-filter: blur(20px);
    min-width: 160px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.dropdown-item.danger {
    color: #f87171;
}

.dropdown-item.danger:hover {
    background: rgba(248, 113, 113, 0.12);
}

/* Social btn (for share) */
.social-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Floating reaction */
.floating-reaction {
    position: fixed;
    pointer-events: none;
    font-size: 1.4rem;
    animation: float-up 2s ease-out forwards;
    z-index: 9999;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) translateX(var(--tx, 0));
    }
}

/* ==============================================
   ROOM PRESETS (ONE-CLICK START)
   ============================================== */

.preset-section {
    padding: 20px 24px;
    margin-bottom: 24px;
}

.preset-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-tabs-wrapper {
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.preset-tabs-wrapper::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.preset-tabs {
    display: flex;
    gap: 12px;
    min-width: max-content;
}

.preset-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.preset-tab.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.8), rgba(99, 102, 241, 0.8));
    border-color: rgba(167, 139, 250, 0.5);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.preset-grid-wrapper {
    /* Removed incomplete selector body if it was empty, or just close it properly */
}

/* ══════════════════════════════════════════
   NETFLIX STYLE CAROUSEL ROWS
   ══════════════════════════════════════════ */

.carousel-section {
    margin-bottom: 24px;
}

.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.carousel-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-header h3 i {
    color: var(--gold);
    font-size: 1rem;
}

.carousel-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
}

.carousel-row::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Show cards inside carousel must not stretch */
.carousel-row .show-card {
    flex: 0 0 180px !important;
    width: 180px !important;
    min-width: 0;
    max-width: 180px;
    overflow: hidden;
}

@media (min-width: 769px) {
    .carousel-row .show-card {
        flex: 0 0 260px !important;
        width: 260px !important;
        max-width: 260px;
    }
}

.preset-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    padding: 24px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    cursor: pointer;
}

.preset-card.has-cover {
    aspect-ratio: 16 / 9;
    padding: 12px !important;
    position: relative;
    background-size: cover;
    background-position: center;
}

@media (max-width: 768px) {
    .preset-card {
        flex: 0 0 220px;
        padding: 16px;
    }
}

.preset-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.preset-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.preset-card-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preset-mode-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #a78bfa;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    white-space: nowrap;
}

.preset-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preset-topic {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preset-chars {
    display: flex;
    align-items: center;
    margin-top: auto;
}
.preset-chars .mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #2a2a2a;
    margin-left: -10px;
    background: #444;
}
.preset-chars .mini-avatar:first-child {
    margin-left: 0;
}

.preset-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #c4b5fd;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: 50%;
}

.preset-start-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.preset-start-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    transform: scale(1.02);
}

.preset-start-btn.loading {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}