:root {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

:root {
    /* Default Dark Theme Variables */
    --bg-primary: #36393f;
    --bg-secondary: #2f3136;
    --bg-tertiary: #202225;
    --text-normal: #dcddde;
    --text-muted: #72767d;
    --brand: #5865f2;
    --brand-hover: #4752c4;
    --brand-gradient: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    --scrollbar-width: 8px;
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
    --border-color: rgba(255, 255, 255, 0.05);
    --modal-bg: linear-gradient(145deg, #2f3136, #202225);
    --input-bg: rgba(0, 0, 0, 0.2);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover: rgba(255, 255, 255, 0.06);
    --danger: #ed4245;
    --success: #3ba55d;
    --mod-tag: #ffaa00;
    --avatar-male: #5865f2;
    --avatar-female: #f06595;
    --avatar-fallback-bg: #4f545c;
}

/* User Avatar Styles */
.user-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--avatar-fallback-bg);
    color: white;
    font-weight: 600;
    user-select: none;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.user-avatar.avatar-male {
    border: 2px solid var(--avatar-male);
    box-shadow: 0 0 8px rgba(88, 101, 242, 0.4);
}

.user-avatar.avatar-female {
    border: 2px solid var(--avatar-female);
    box-shadow: 0 0 8px rgba(240, 101, 149, 0.4);
}

.user-avatar.avatar-male .avatar-fallback {
    background-color: var(--avatar-male);
}

.user-avatar.avatar-female .avatar-fallback {
    background-color: var(--avatar-female);
}

.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-transform: uppercase;
}

.user-avatar.avatar-mini {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

.user-avatar.avatar-small {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.user-avatar.avatar-medium {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}

.user-avatar.avatar-large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.user-avatar.avatar-xl {
    width: 120px;
    height: 120px;
    font-size: 3rem;
}

.video-feed-item.gender-male {
    border: 2px solid var(--avatar-male);
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
}

.video-feed-item.gender-female {
    border: 2px solid var(--avatar-female);
    box-shadow: 0 0 15px rgba(240, 101, 149, 0.4);
}

.video-feed-item.local-video {
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.4) !important;
}

.video-feed-item.gender-male .video-label {
    color: var(--avatar-male);
    font-weight: 600;
}

.video-feed-item.gender-female .video-label {
    color: var(--avatar-female);
    font-weight: 600;
}

[data-theme='light'] {
    --bg-primary: #e8e9eb;
    --bg-secondary: #dadde1;
    --bg-tertiary: #ccd0d5;
    --text-normal: #2e3338;
    --text-muted: #4f5660;
    --scrollbar-track: #dadde1;
    --scrollbar-thumb: rgba(0, 0, 0, 0.15);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);
    --border-color: rgba(0, 0, 0, 0.1);
    --modal-bg: #f9fafa;
    --input-bg: #ccd0d5;
    --card-bg: #f0f1f3;
    --card-hover: #dadde1;
}

[data-theme='ocean'] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #020617;
    --text-normal: #f1f5f9;
    --text-muted: #94a3b8;
    --brand: #0ea5e9;
    --brand-hover: #0284c7;
    --brand-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(14, 165, 233, 0.2);
    --scrollbar-thumb-hover: rgba(14, 165, 233, 0.3);
    --border-color: rgba(14, 165, 233, 0.1);
    --modal-bg: linear-gradient(145deg, #1e293b, #0f172a);
    --input-bg: rgba(0, 0, 0, 0.3);
    --card-bg: rgba(14, 165, 233, 0.05);
    --card-hover: rgba(14, 165, 233, 0.1);
    --danger: #ef4444;
    --success: #10b981;
}

[data-theme='rose'] {
    --bg-primary: #fff0f6;
    --bg-secondary: #ffdeeb;
    --bg-tertiary: #fcc2d7;
    --text-normal: #a61e4d;
    --text-muted: #c2255c;
    --brand: #f06595;
    --brand-hover: #e64980;
    --brand-gradient: linear-gradient(135deg, #f06595 0%, #d6336c 100%);
    --scrollbar-track: #fff0f6;
    --scrollbar-thumb: rgba(240, 101, 149, 0.2);
    --scrollbar-thumb-hover: rgba(240, 101, 149, 0.3);
    --border-color: rgba(240, 101, 149, 0.15);
    --modal-bg: #fff0f6;
    --input-bg: #f8e1eb;
    --card-bg: #ffffff;
    --card-hover: #ffdeeb;
    --danger: #fa5252;
    --success: #51cf66;
}

[data-theme='forest'] {
    --bg-primary: #0d1a10;
    --bg-secondary: #162a1a;
    --bg-tertiary: #050a06;
    --text-normal: #e0f2e1;
    --text-muted: #8ba38e;
    --brand: #2ecc71;
    --brand-hover: #27ae60;
    --brand-gradient: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(46, 204, 113, 0.2);
    --scrollbar-thumb-hover: rgba(46, 204, 113, 0.3);
    --border-color: rgba(46, 204, 113, 0.1);
    --modal-bg: linear-gradient(145deg, #162a1a, #0d1a10);
    --input-bg: rgba(0, 0, 0, 0.3);
    --card-bg: rgba(46, 204, 113, 0.05);
    --card-hover: rgba(46, 204, 113, 0.1);
    --danger: #ff4d4d;
    --success: #2ecc71;
}

[data-theme='nebula'] {
    --bg-primary: #1a1b26;
    --bg-secondary: #24283b;
    --bg-tertiary: #16161e;
    --text-normal: #c0caf5;
    --text-muted: #7982a9;
    --brand: #7aa2f7;
    --brand-hover: #89ddff;
    --brand-gradient: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(122, 162, 247, 0.2);
    --scrollbar-thumb-hover: rgba(122, 162, 247, 0.3);
    --border-color: rgba(122, 162, 247, 0.1);
    --modal-bg: linear-gradient(145deg, #24283b, #1a1b26);
    --input-bg: rgba(0, 0, 0, 0.3);
    --card-bg: rgba(122, 162, 247, 0.05);
    --card-hover: rgba(122, 162, 247, 0.1);
    --danger: #f7768e;
    --success: #9ece6a;
}

[data-theme='midnight'] {
    --bg-primary: #0a0b10;
    --bg-secondary: #14151f;
    --bg-tertiary: #05060a;
    --text-normal: #e0e0e0;
    --text-muted: #909090;
    --brand: #9d50bb;
    --brand-hover: #bc4e9c;
    --brand-gradient: linear-gradient(135deg, #9d50bb 0%, #6e48aa 100%);
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(157, 80, 187, 0.2);
    --scrollbar-thumb-hover: rgba(157, 80, 187, 0.3);
    --border-color: rgba(157, 80, 187, 0.1);
    --modal-bg: linear-gradient(145deg, #14151f, #0a0b10);
    --input-bg: rgba(0, 0, 0, 0.4);
    --card-bg: rgba(157, 80, 187, 0.05);
    --card-hover: rgba(157, 80, 187, 0.1);
    --danger: #ff4d4d;
    --success: #00ff88;
}

[data-theme='sunset'] {
    --bg-primary: #1a1212;
    --bg-secondary: #2d1b1b;
    --bg-tertiary: #140d0d;
    --text-normal: #ffd8d8;
    --text-muted: #a67c7c;
    --brand: #e66a4c;
    --brand-hover: #e6a06c;
    --brand-gradient: linear-gradient(135deg, #e66a4c 0%, #e6a06c 100%);
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(230, 106, 76, 0.2);
    --scrollbar-thumb-hover: rgba(230, 106, 76, 0.3);
    --border-color: rgba(230, 106, 76, 0.1);
    --modal-bg: linear-gradient(145deg, #2d1b1b, #1a1212);
    --input-bg: rgba(0, 0, 0, 0.4);
    --card-bg: rgba(230, 106, 76, 0.05);
    --card-hover: rgba(230, 106, 76, 0.1);
    --danger: #ff4b2b;
    --success: #ffb88c;
}

[data-theme='matrix'] {
    --bg-primary: #000000;
    --bg-secondary: #0d0d0d;
    --bg-tertiary: #050505;
    --text-normal: #00ff41;
    --text-muted: #008f11;
    --brand: #00ff41;
    --brand-hover: #00ce33;
    --brand-gradient: linear-gradient(135deg, #00ff41 0%, #008f11 100%);
    --scrollbar-track: #000000;
    --scrollbar-thumb: rgba(0, 255, 65, 0.2);
    --scrollbar-thumb-hover: rgba(0, 255, 65, 0.3);
    --border-color: rgba(0, 255, 65, 0.2);
    --modal-bg: #000000;
    --input-bg: #0a0a0a;
    --card-bg: rgba(0, 255, 65, 0.05);
    --card-hover: rgba(0, 255, 65, 0.1);
    --danger: #ff0000;
    --success: #00ff41;
}

[data-theme='matrix'] .owned-room-item .room-name-text,
[data-theme='matrix'] .favorite-room-item span:first-child,
[data-theme='matrix'] .room-item.active span:first-child,
[data-theme='matrix'] .active-room-item .active-room-name,
[data-theme='matrix'] .room-user-count-sidebar {
    color: var(--text-muted);
}

/* Global Scrollbar Styles */
* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(230, 106, 76, 0.4) transparent;
}

::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(230, 106, 76, 0.4);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 106, 76, 0.6);
    background-clip: content-box;
}

/* Background Animated Shapes */
.bg-shape-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
    /* Layered on top of background but behind content */
    pointer-events: none;
    background: transparent;
}

.bg-shape {
    position: absolute;
    filter: blur(5px);
    opacity: 0.08;
    transition: all 1s ease-in-out;
    animation: float 20s infinite alternate ease-in-out;
    pointer-events: none;
    user-select: none;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: 5%;
    right: 5%;
    animation-duration: 25s;
}

.shape-2 {
    width: 180px;
    height: 180px;
    bottom: 5%;
    left: 5%;
    animation-delay: -5s;
    animation-duration: 30s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    right: 8%;
    animation-delay: -10s;
    animation-duration: 22s;
}

.shape-4 {
    width: 220px;
    height: 220px;
    bottom: 30%;
    left: 12%;
    opacity: 0.1;
    animation-delay: -15s;
    animation-duration: 28s;
}

.shape-5 {
    width: 150px;
    height: 150px;
    top: 15%;
    left: 18%;
    animation-delay: -3s;
    animation-duration: 35s;
}

.shape-6 {
    width: 180px;
    height: 180px;
    bottom: 45%;
    right: 22%;
    animation-delay: -7s;
    animation-duration: 24s;
}

.shape-7 {
    width: 120px;
    height: 120px;
    top: 55%;
    left: 8%;
    animation-delay: -12s;
    animation-duration: 32s;
}

.shape-8 {
    width: 160px;
    height: 160px;
    top: 12%;
    right: 35%;
    animation-delay: -18s;
    animation-duration: 27s;
}

.shape-9 {
    width: 140px;
    height: 140px;
    top: 75%;
    right: 15%;
    animation-delay: -2s;
    animation-duration: 29s;
}

.shape-10 {
    width: 190px;
    height: 190px;
    top: 30%;
    left: 40%;
    opacity: 0.05;
    animation-delay: -8s;
    animation-duration: 33s;
}

.shape-11 {
    width: 130px;
    height: 130px;
    bottom: 15%;
    right: 30%;
    animation-delay: -14s;
    animation-duration: 26s;
}

.shape-12 {
    width: 170px;
    height: 170px;
    top: 60%;
    right: 45%;
    animation-delay: -20s;
    animation-duration: 31s;
}

.shape-13 {
    width: 210px;
    height: 210px;
    bottom: 40%;
    left: 35%;
    opacity: 0.06;
    animation-delay: -6s;
    animation-duration: 23s;
}

.shape-14 {
    width: 125px;
    height: 125px;
    top: 45%;
    left: 55%;
    animation-delay: -11s;
    animation-duration: 34s;
}

.shape-15 {
    width: 155px;
    height: 155px;
    bottom: 25%;
    right: 55%;
    animation-delay: -17s;
    animation-duration: 28s;
}

.shape-16 {
    width: 145px;
    height: 145px;
    top: 85%;
    left: 45%;
    animation-delay: -4s;
    animation-duration: 25s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(30px, 50px) rotate(10deg) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg) scale(0.9);
    }

    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

/* Theme specific adjustments for shapes */
[data-theme='light'] .bg-shape {
    opacity: 0.08;
    filter: blur(100px);
}

[data-theme='ocean'] .bg-shape {
    opacity: 0.2;
}

[data-theme='matrix'] .bg-shape {
    opacity: 0.1;
    filter: blur(120px);
}


body {
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-normal);
    height: 100vh;
    overflow: hidden;
}

#root {
    height: 100%;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #9c3c24 0%, #e6a06c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.auth-card {
    background: rgba(0, 0, 0, 0.4);
    /* Glassmorphism dark */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    animation: authFadeIn 0.5s ease-out;
    position: relative;
    z-index: 10;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
    color: white;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
}

.auth-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    transition: all 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.auth-button {
    background: #9c3c24;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    box-shadow: 0 4px 10px rgba(156, 60, 36, 0.3);
}

.auth-button:hover {
    background: #86331f;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(156, 60, 36, 0.4);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.auth-link {
    color: white;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-error {
    background: #fff5f5;
    color: #c53030;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #feb2b2;
    margin-bottom: 12px;
}

/* Landing Page Styles - Warmer and more welcoming */
.landing-container {
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(to right, #9c3c24 0%, #e6a06c 100%);
    scroll-behavior: smooth;
    color: #fff;
    position: relative;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 80px;
    position: sticky;
    top: 0;
    background: rgba(45, 55, 72, 0.1);
    backdrop-filter: blur(20px);
    z-index: 1001;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.landing-hero,
.landing-features,
.landing-showcase,
.landing-footer {
    position: relative;
    z-index: 10;
}

.landing-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

.sidebar-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.landing-nav-btn {
    background: #9c3c24;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.landing-nav-btn:hover {
    background: #86331f;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.landing-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 80px;
    min-height: 80vh;
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 24px;
    line-height: 1.1;
    color: white;
}

.hero-content h1 span {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.hero-cta-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.hero-cta-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero-secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero-image-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    z-index: 1;
    position: relative;
    animation: floating 6s ease-in-out infinite;
    border: 5px solid white;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.hero-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: white;
    filter: blur(100px);
    opacity: 0.2;
    border-radius: 50%;
    z-index: 0;
}

.landing-features {
    padding: 100px 80px;
    background: rgba(0, 0, 0, 0.05);
    /* Very subtle overlay */
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

.section-title p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 24px;
    transition: all 0.3s;
    color: white;
}

.feature-card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: white;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.landing-showcase {
    display: flex;
    align-items: center;
    padding: 100px 80px;
    gap: 80px;
    background: rgba(0, 0, 0, 0.1);
    /* Darker section for contrast */
    color: white;
}

.showcase-content {
    flex: 1;
}

.showcase-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 32px;
    color: white;
}

.showcase-list {
    list-style: none;
    padding: 0;
}

.showcase-list li {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.showcase-list li span {
    color: white;
    font-weight: 900;
}

.showcase-image-container {
    flex: 1.2;
}

.showcase-image {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 8px solid white;
}

.landing-footer {
    padding: 60px 80px 40px;
    border-top: 1px solid rgba(230, 106, 76, 0.1);
    background: #2d3748;
    color: #edf2f7;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .landing-header {
        padding: 20px 40px;
    }

    .landing-hero {
        flex-direction: column;
        padding: 60px 40px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .landing-features {
        padding: 60px 40px;
    }

    .landing-showcase {
        flex-direction: column;
        padding: 60px 40px;
        text-align: center;
    }

    .showcase-list li {
        justify-content: center;
    }

    .footer-top {
        flex-direction: column;
        gap: 30px;
    }
}


.main-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 190px !important;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    padding: 8px;
    height: 100%;
    box-sizing: border-box;
}

.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.user-view {
    width: 180px;
    border-left: 1px solid var(--bg-secondary);
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-item {
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    width: 100% !important;
    min-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.message-avatar-container {
    flex-shrink: 0;
    padding-top: 2px;
}

.message-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.message-text+.message-text {
    margin-top: 4px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--brand);
}

.message-item.user-gender-female .message-sender {
    color: var(--avatar-female);
}

.message-item.user-gender-male .message-sender {
    color: var(--avatar-male);
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-image-container {
    max-width: 100%;
    margin-bottom: 4px;
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.message-image:hover {
    opacity: 0.9;
}

.message-text {
    word-break: break-word;
}

.chat-input-area {
    padding: 16px;
    background: var(--bg-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.image-preview-container {
    width: 100%;
    margin-bottom: 8px;
    display: flex;
}

.preview-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    max-height: 150px;
    border: 2px solid var(--brand);
}

.image-preview {
    height: 100px;
    width: auto;
    display: block;
}

.remove-preview-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.remove-preview-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}



.chat-input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-normal);
    box-sizing: border-box;
}

.chat-input:focus {
    outline: none;
}

.header {
    height: auto;
    min-height: 40px;
    padding: 2px;
    background-color: var(--bg-tertiary);
    z-index: 10;
    border-bottom: 2px solid var(--bg-secondary);
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.header-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    height: 36px;
}

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

.sidebar-title {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.settings-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.settings-btn:hover {
    color: var(--text-normal);
    background: var(--card-hover);
}

.settings-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.settings-btn:hover .settings-icon {
    transform: rotate(45deg);
}

.device-controls {
    display: flex;
    gap: 10px;
}

.device-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-normal);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    max-width: 200px;
}

.device-select:hover {
    background: var(--card-hover);
    border-color: var(--brand);
}

.device-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

.device-select option {
    background: var(--bg-tertiary);
    color: var(--text-normal);
}

.device-select.full-width {
    width: 100%;
    max-width: none;
    margin-top: 5px;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.grid-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-normal);
    width: 100%;
    box-sizing: border-box;
}

.custom-number-input {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.custom-number-input input {
    background: transparent;
    border: none;
    color: var(--text-normal);
    width: 30px;
    padding: 4px 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

.custom-number-input input::-webkit-outer-spin-button,
.custom-number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-btn {
    background: var(--brand);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.2s;
}

.number-input-btn:hover:not(:disabled) {
    background: var(--brand-hover);
}

.number-input-btn:disabled {
    background: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
}

.video-strip {
    display: grid;
    grid-template-columns: repeat(var(--cams-per-row, 4), 1fr);
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.video-strip.vertical {
    display: grid;
    flex: none;
    /* Do not grow, do not shrink */
    width: auto;
    min-width: 280px;
    height: 100%;

    /* Logic: Fill vertical column (N rows), then move to next column. */
    /* Reset columns from base class */
    grid-template-columns: none;
    /* Define rows based on "Cams per length" */
    grid-template-rows: repeat(var(--cams-per-row, 4), 1fr);

    /* Flow into new columns */
    grid-auto-flow: column;
    grid-auto-columns: 280px;

    gap: 12px;
    padding: 10px;
    box-sizing: border-box;
    overflow-x: auto;
    /* Scroll horizontally if needed */
    overflow-y: hidden;

    border-right: 1px solid var(--bg-secondary);
    border-left: 1px solid var(--bg-secondary);
    background-color: var(--bg-tertiary);
}

.video-strip.vertical .video-feed-item {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    min-height: 0;
}

.video-feed-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.video-feed-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-feed-item.info-box,
.video-feed-item.audio-only-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.audio-avatar {
    width: 60px;
    height: 60px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    box-shadow: 0 0 20px rgba(114, 137, 218, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.status-header {
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.status-text {
    font-size: 0.75rem;
    line-height: 1.4;
}

.video-feed-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fff;
    pointer-events: none;
}

.room-list {
    margin-top: 10px;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0;
    padding: 2px 2px 2px 8px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.room-item:hover {
    background-color: var(--card-hover);
    color: var(--text-normal);
}

.room-item.active {
    background-color: var(--brand);
    color: #fff;
}

.active-room-item {
    padding: 6px 10px;
    margin: 4px 4px 15px;
    background-color: var(--brand);
    color: #fff;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-room-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-region-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-left: 8px;
    color: var(--text-muted);
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-user-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-room-item:hover .room-user-count {
    color: var(--text-normal);
    background: rgba(0, 0, 0, 0.4);
}

.modal-room-item:hover .room-region-badge {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-normal);
}

.close-room-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-room-btn:hover {
    color: #fff;
}

.sidebar-section-label {
    padding: 0 10px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.create-room-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background-color: transparent;
    border: 1px dashed var(--text-muted);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.create-room-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background-color: var(--card-hover);
}

.user-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.user-list-count {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.sound-control-area {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.sound-control-header {
    font-weight: bold;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mic-btn {
    width: 100%;
    padding: 8px;
    /* Reduced from 10px */
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mic-btn.claim {
    background-color: var(--brand);
    color: white;
}

.mic-btn.release {
    background-color: var(--danger);
    color: white;
}

.mic-btn.release:hover {
    opacity: 0.9;
}

.mic-status {
    background-color: var(--input-bg);
    padding: 8px;
    /* Reduced from 12px */
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-normal);
    text-align: left;
    /* Changed from center to accommodate volume slider better */
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.mic-holder-name {
    color: var(--brand);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.mic-holder-name:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.mic-holder-name.user-gender-female {
    color: var(--avatar-female);
}

.mic-holder-name.user-gender-male {
    color: var(--avatar-male);
}

.user-card {
    background-color: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.user-card:hover {
    transform: translateY(-2px);
    background-color: var(--card-hover);
}

.user-card.viewing {
    border: 1px solid var(--brand);
    /* Highlight border */
    background-color: rgba(88, 101, 242, 0.1);
    /* Subtle brand background tint */
    box-shadow: 0 0 5px rgba(88, 101, 242, 0.2);
    /* Soft glow */
}



.user-name {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-normal);
}

.user-gender-female .user-name {
    color: var(--avatar-female);
    font-weight: 600;
}

.user-gender-male .user-name {
    color: var(--avatar-male);
    font-weight: 600;
}

.user-card.self {
    cursor: default;
    background-color: var(--card-bg);
}

.user-card.self:hover {
    background-color: var(--card-bg);
}

/* Legacy video styles removed */

.video-feed-item.placeholder {
    background: linear-gradient(135deg, #202225 0%, #2f3136 100%);
    border: 1px dashed var(--text-muted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    position: relative;
    opacity: 0.8;
}

.placeholder-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.close-cam-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s, transform 0.2s;
}

.close-cam-btn:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.video-feed-item:hover .close-cam-btn {
    opacity: 1;
}

@keyframes pulse-slow {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.9;
    }

    100% {
        opacity: 0.6;
    }
}

.placeholder-text {
    font-size: 0.75rem;
    animation: pulse-slow 2s infinite;
}

.viewer-indicator-badge {
    color: #2ecc71;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

/* Find Room Modal - Premium Design */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--modal-bg);
    padding: 25px;
    border-radius: 12px;
    width: 450px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #b9bbbe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.modal-close {
    background: var(--card-bg);
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}

.modal-search {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-normal);
    margin-bottom: 20px;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.modal-search:focus {
    border-color: #5865F2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.modal-room-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}


.modal-room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.modal-room-item:hover {
    background: var(--card-hover);
    transform: translateX(4px);
    border-color: var(--border-color);
}

.modal-room-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-room-name::before {
    content: "#";
    color: #b9bbbe;
    font-size: 1.2rem;
    opacity: 0.6;
}

.favorite-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: #4f545c;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    background: var(--card-hover);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #f1c40f;
    /* Gold for favorite */
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.favorite-btn.active:hover {
    transform: scale(1.2) rotate(15deg);
}

/* Sidebar Layout Updates moved to main .sidebar class */

.room-list-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Takes fast available space */
    min-height: 0;
    /* Crucial for scrolling inside flex */
    margin-bottom: 10px;
}

.room-list-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    /* Space for scrollbar */
    flex: 1;
}


.sidebar-fixed-bottom {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.find-room-btn {
    width: 100%;
    margin-top: 0;
    /* Managed by parent gap */
    background: var(--card-bg);
    color: var(--success);
    border: 1px solid var(--success);
    /* Solid but subtle */
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.find-room-btn:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 165, 93, 0.3);
}

.user-profile-summary {
    padding: 8px 2px !important;
    background: var(--card-bg);
    border-radius: 0px 8px 8px 0px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 0;
}

.user-profile-summary:hover {
    background: var(--card-hover);
    border-color: var(--border-color);
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(237, 66, 69, 0.15);
    color: var(--danger);
    transform: scale(1.1);
}

/* user-profile-avatar is replaced by .user-avatar.avatar-small */

.user-profile-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.user-profile-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0px;
}

.user-profile-name {
    font-weight: 600;
    color: var(--text-normal);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Settings Modal Refactor */
.modal-content.settings-modal {
    max-width: 700px;
    width: 90%;
    min-height: 450px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.settings-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.settings-sidebar {
    width: 180px;
    background: rgba(0, 0, 0, 0.1);
    padding: 20px 10px;
    border-right: 1px solid var(--border-color);
}

.settings-nav-item {
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.settings-nav-item:hover {
    background: var(--card-hover);
    color: var(--text-normal);
}

.settings-nav-item.active {
    background: var(--brand);
    color: white;
}

.settings-main {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.settings-tab-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-textarea {
    width: 100%;
    min-height: 120px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-normal);
    padding: 12px;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.feedback-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-normal);
}

.feedback-msg {
    margin-top: 10px;
    font-size: 0.85rem;
    padding: 8px;
    border-radius: 4px;
}

.feedback-msg.success {
    background: rgba(59, 165, 93, 0.1);
    color: var(--success);
}

.feedback-msg.error {
    background: rgba(237, 66, 69, 0.1);
    color: var(--danger);
}

/* Room Finder Modal Tabs */
.room-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.room-modal-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.room-modal-tab:hover {
    color: var(--text-normal);
    background: rgba(255, 255, 255, 0.05);
}

.room-modal-tab.active {
    color: white;
    background: var(--brand);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.create-room-tab-content {
    animation: fadeIn 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.create-room-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.create-room-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
    filter: brightness(1.1);
}

.create-room-submit-btn:active {
    transform: translateY(0);
}

/* System Messages */
.message-system {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 4px 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.message-system.system-info {
    opacity: 1;
    color: var(--text-normal);
    background: rgba(88, 101, 242, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    border: 1px solid rgba(88, 101, 242, 0.2);
    margin: 12px 0;
    max-width: 90%;
    align-self: center;
}

.system-text-content {
    flex: 1;
    text-align: center;
}

.message-system .system-icon {
    font-weight: bold;
    font-size: 1rem;
    color: var(--brand);
    flex-shrink: 0;
}

.message-system .system-icon.pulse {
    animation: systemPulse 2s infinite;
}

@keyframes systemPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.15);
        filter: brightness(1.3);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.message-system .system-time {
    font-size: 0.65rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px;
    border: 2px solid var(--bg-secondary);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* User Menu Modal */
.user-menu-modal {
    width: 900px !important;
    max-width: 95vw !important;
    height: 600px;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.user-menu-modal .modal-header {
    margin-bottom: 0;
    padding: 15px 25px;
}

.user-menu-modal .modal-title {
    padding-left: 220px;
    /* Align with content area, not sidebar */
    flex: 1;
}

.user-menu-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.user-menu-tabs {
    width: 220px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 10px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.user-menu-tab {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu-tab:hover {
    color: var(--text-normal);
    background: var(--card-hover);
    transform: translateX(4px);
}

.user-menu-tab.active {
    color: white;
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2);
}

/* Specific indicator for active tab */
.user-menu-tab.active::after {
    content: '';
    position: absolute;
    right: -11px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--brand);
    border-radius: 4px 0 0 4px;
    display: none;
    /* Hide if we use full background highlight */
}

.user-menu-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: rgba(255, 255, 255, 0.01);
}

.friends-list,
.user-search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-item,
.search-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    transition: background 0.2s;
}

.friend-item:hover,
.search-user-item:hover {
    background: var(--card-hover);
}

/* friend-avatar and search-user-avatar are replaced by .user-avatar */

.friend-info,
.search-user-info {
    flex: 1;
}

.friend-name,
.search-user-name {
    font-weight: 600;
}

.user-gender-female .friend-name,
.user-gender-female .search-user-name,
.profile-tab-content.user-gender-female h2 {
    color: var(--avatar-female);
}

.user-gender-male .friend-name,
.user-gender-male .search-user-name,
.profile-tab-content.user-gender-male h2 {
    color: var(--avatar-male);
}

.friend-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.friend-status.online {
    color: var(--success);
}

.friend-actions,
.search-user-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-normal);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.action-btn.active-male {
    background: var(--avatar-male) !important;
    color: white !important;
}

.action-btn.active-female {
    background: var(--avatar-female) !important;
    color: white !important;
}

.action-btn:hover {
    background: var(--brand);
}

.pm-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.pm-back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-messages-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.pm-message-item {
    max-width: fit-content;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.95rem;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    width: fit-content;
    box-sizing: border-box;
    line-height: 1.4;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.pm-message-bubble-content {
    display: flex;
    flex-direction: column;
}

.pm-message-text {
    margin-bottom: 2px;
}

.pm-message-timestamp {
    font-size: 0.65rem;
    opacity: 0.6;
    align-self: flex-end;
    margin-top: 1px;
    user-select: none;
}

.pm-message-item.sent {
    align-self: flex-end;
    background: var(--brand);
    color: white;
    border-bottom-right-radius: 2px;
    flex-direction: row-reverse;
}

.pm-message-item.sent .pm-message-timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.pm-message-item.received {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-normal);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--border-color);
}

.pm-input-area {
    display: flex;
    gap: 10px;
}

.pm-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-normal);
    padding: 12px;
    border-radius: 12px;
    outline: none;
}

.pm-input:focus {
    border-color: var(--brand);
}

.pm-send-btn {
    background: var(--brand);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.pm-send-btn:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
}

.friend-requests-section {
    padding: 10px;
    background: rgba(88, 101, 242, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
}

.friend-room-label {
    font-size: 0.7rem;
    color: var(--brand);
    font-weight: 600;
    margin-top: 2px;
    background: rgba(88, 101, 242, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
    transition: all 0.2s ease;
}

.clickable-room {
    cursor: pointer;
}

.clickable-room:hover {
    background: var(--brand);
    color: white;
}

.unread-badge {
    position: absolute;
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border: 2px solid var(--modal-bg);
}

.friends-sub-nav {
    display: flex;
    gap: 20px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.friends-sub-tab {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding-bottom: 8px;
    transition: all 0.2s;
}

.friends-sub-tab:hover {
    color: var(--text-normal);
}

.friends-sub-tab.active {
    color: var(--brand);
}

.friends-sub-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand);
}

.request-count-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: middle;
}

.small-block-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.user-card:hover .small-block-btn {
    opacity: 1;
}

.small-block-btn:hover {
    color: var(--danger) !important;
}

.blocked-list-container {
    padding: 10px;
}

/* Context Menu */
.custom-context-menu {
    position: fixed;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-normal);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: var(--brand);
    color: white;
}

.context-menu-item.danger:hover {
    background: var(--danger);
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.status-badges {
    display: flex;
    gap: 4px;
    margin-left: 4px;
}

.status-badge {
    font-size: 0.8rem;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-badge.owner {
    color: #ffcc00;
}

.status-badge.mod {
    color: #3498db;
}

.status-badge.friend {
    color: #e91e63;
}

.owned-room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-name-text {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
}

.room-settings-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 2px 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
    /* Make it slightly visible always, or use 0 and show on hover */
}

.room-item:hover .room-settings-btn {
    opacity: 1;
}

.room-settings-btn:hover {
    color: var(--text-normal);
    background: var(--card-hover);
}

.room-enhanced-settings {
    display: flex !important;
    flex-direction: row !important;
    max-width: 800px;
    width: 90%;
    height: 600px;
    padding: 0;
    overflow: hidden;
}

.modal-sidebar {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.modal-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-sidebar-header .modal-title {
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-sidebar-nav {
    flex: 1;
    padding: 10px;
}

.modal-sidebar-item {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.modal-sidebar-item:hover {
    background: var(--card-hover);
    color: var(--text-normal);
}

.modal-sidebar-item.active {
    background: var(--brand);
    color: white;
}

.modal-sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.modal-main-content .modal-header {
    padding: 20px 24px;
    margin-bottom: 0;
}

.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
}

.settings-content-pane {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.danger-zone {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.danger-room-delete-btn {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    width: fit-content;
}

.danger-room-delete-btn:hover {
    background: var(--danger);
    color: white;
}

.danger-confirm-area {
    background: rgba(237, 66, 69, 0.05);
    border: 1px solid rgba(237, 66, 69, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.danger-text {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--text-normal);
}

.danger-input {
    margin-bottom: 0 !important;
    border-color: rgba(237, 66, 69, 0.3) !important;
}

.danger-input:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(237, 66, 69, 0.2) !important;
}

.danger-room-delete-btn.final {
    background: var(--danger);
    color: white;
    border: none;
    opacity: 1;
}

.danger-room-delete-btn.final:disabled {
    opacity: 0.5;
    background: var(--text-muted);
    cursor: not-allowed;
}

.member-list {
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 10px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.member-item:last-child {
    border-bottom: none;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 32px;
    height: 32px;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.member-name {
    font-weight: 500;
    color: var(--text-normal);
}

.member-remove-btn {
    background: transparent;
    border: 2px solid #e66a4c;
    color: #ff4444;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.member-remove-btn:hover {
    background: #ff4444;
    color: white;
}

.settings-helper {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.empty-state {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.modal-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-tertiary);
    color: var(--text-normal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.mod-tag {
    color: #ffaa00;
    font-weight: 900;
    font-size: 0.9rem;
    margin-right: 6px;
}

.owner-tag {
    color: #ffffff;
    font-weight: 900;
    font-size: 0.9rem;
    margin-right: 6px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.friend-tag {
    color: #ff44aa;
    font-weight: 900;
    font-size: 0.9rem;
    margin-right: 6px;
}


.owned-rooms-list {
    flex: 0 0 auto;
    max-height: 30vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.room-list-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Persistent Private Chat UI */
.chat-bar {
    position: fixed;
    bottom: 0;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.chat-window {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 330px;
    height: 450px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    transition: height 0.3s;
    border: 1px solid var(--border-color);
}

.chat-window.call-connected {
    height: 650px;
}

.chat-window.collapsed {
    height: 20px;
    width: 132px;
}

.chat-window.collapsed .chat-window-header {
    padding: 2px 8px;
}

.chat-window.collapsed .chat-window-title {
    font-size: 0.75rem;
}

.chat-window.collapsed .friend-avatar-mini {
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
}

.chat-window.collapsed .unread-badge {
    width: 12px;
    height: 12px;
    min-width: 12px;
    font-size: 0.5rem;
    top: -4px;
    right: -4px;
}

.chat-window.collapsed .chat-action-btn {
    padding: 0 4px;
    font-size: 0.7rem;
}

.chat-window-header {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
}

.chat-window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-normal);
}

/* friend-avatar-mini is replaced by .user-avatar.avatar-mini */

.chat-window-actions {
    display: flex;
    gap: 4px;
}

.chat-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.chat-action-btn:hover {
    background: var(--card-hover);
    color: var(--text-normal);
}

.chat-action-btn.call {
    color: var(--success);
}

.chat-action-btn.call:hover {
    background: var(--success);
    color: white;
}

.chat-action-btn.hangup {
    color: var(--danger);
}

.chat-action-btn.hangup:hover {
    background: var(--danger);
    color: white;
}

.chat-window-messages {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-primary);
}

.pm-system-message {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 4px 0;
}

.private-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.chat-window-input {
    padding: 10px;
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-window-input input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--text-normal);
    font-size: 0.85rem;
}

.chat-window-input input:focus {
    outline: none;
    border-color: var(--brand);
}

.chat-window-input button {
    background: var(--brand);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}


/* Quick Friends Sidebar & panel */
.sidebar-user-area {
    display: flex;
    align-items: center;
    /* Baseline for height alignment */
    gap: 1px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}



.shortcut-btn {
    width: 30px;
    /* Keep it slim */
    height: 50px;
    /* Match calculated height of user-profile-summary */
    border-radius: 8px 0px 0px 8px;
    /* Match sibling border-radius */
    background: var(--card-bg);
    /* Always visible */
    border: 1px solid var(--border-color);
    /* Match sibling border */
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    box-sizing: border-box;
}

.shortcut-btn:hover,
.shortcut-btn.active {
    background: var(--card-hover);
    color: var(--text-normal);
    border-color: var(--border-color);
}

.shortcut-unread-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    /* Vibrant red */
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.quick-friends-panel {
    position: absolute;
    left: 100%;
    bottom: 0;
    margin-left: 10px;
    width: 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    animation: slideInLeft 0.2s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.quick-friends-header {
    padding: 12px 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.quick-friends-header button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.quick-friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quick-friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.quick-friend-item:hover {
    background: var(--card-hover);
}

.quick-friend-info {
    flex: 1;
    min-width: 0;
}

.quick-friend-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-friend-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-avatar.avatar-mini.online::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    background: #3ba55c;
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
    z-index: 2;
}

.private-video-container {
    margin-bottom: 15px;
    width: 100%;
}

.chat-bar {
    position: fixed;
    bottom: 0;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    z-index: 1000;
    pointer-events: none;
}

.chat-window-input {
    padding: 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-window-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-window-content .chat-window-messages {
    flex: 1;
    overflow-y: auto;
}

.chat-window-content .private-video-container {
    height: 320px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    flex-shrink: 0;
    padding: 0;
    /* Remove padding to maximize video size */
}

.chat-window-content .private-video-container .video-feed-item {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    /* Remove aspect-ratio since height is fixed */
}

/* Incoming Call UI */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes callFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.85);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.incoming-call-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;
    bottom: auto;
    background: transparent;
    backdrop-filter: none;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    z-index: 1000000;
    animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    pointer-events: none;
}

.incoming-call-card {
    background: rgba(32, 34, 37, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    width: 320px;
    max-width: 320px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    animation: none;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.call-avatar {
    width: 48px;
    height: 48px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    flex-sizing: border-box;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 900;
    color: white;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
    z-index: 10;
}

/* Pulsing rings - ensure they have size and display */
.call-avatar::before,
.call-avatar::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #5865f2;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.call-avatar::after {
    animation: pulse-ring 2s cubic-bezier(0.25, 0, 0.2, 1) infinite;
}

.call-avatar::before {
    animation: pulse-ring 2s cubic-bezier(0.25, 0, 0.2, 1) infinite;
    animation-delay: 1s;
}

.call-info {
    flex: 1;
}

.call-info h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
    font-weight: 700;
}

.call-info p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.call-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
    flex-shrink: 0;
}

.call-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: normal;
}

.call-btn.accept {
    background: var(--success);
    color: white;
}

.call-btn.accept:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.call-btn.decline {
    background: var(--danger);
    color: white;
}

.call-btn.decline:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 25px 50px rgba(237, 66, 69, 0.5);
    filter: brightness(1.2);
}

/* High-Visibility Pulse for Caller Placeholder */
.video-feed-item.placeholder.pulsing {
    --pulse-color: var(--brand);
    --pulse-glow: rgba(88, 101, 242, 0.4);
    border: 3px solid var(--pulse-color) !important;
    background: #1a1a1a !important;
    /* Dark solid background */
    box-shadow: inset 0 0 20px var(--pulse-glow);
    animation: border-vibrate 1s infinite alternate !important;
}

.video-feed-item.placeholder.pulsing.gender-male {
    --pulse-color: var(--avatar-male);
    --pulse-glow: rgba(74, 144, 226, 0.4);
}

.video-feed-item.placeholder.pulsing.gender-female {
    --pulse-color: var(--avatar-female);
    --pulse-glow: rgba(225, 112, 192, 0.4);
}

@keyframes border-vibrate {
    0% {
        border-color: var(--pulse-color);
        box-shadow: inset 0 0 20px var(--pulse-glow);
    }

    100% {
        border-color: var(--pulse-color);
        box-shadow: inset 0 0 40px var(--pulse-glow);
        filter: brightness(1.2);
    }
}

.video-feed-item.placeholder.pulsing .placeholder-spinner {
    position: relative;
    border-top-color: #ffffff !important;
}

.video-feed-item.placeholder.pulsing .placeholder-spinner::after {
    content: '';
    position: absolute;
    inset: -15px;
    border: 4px solid var(--pulse-color);
    border-radius: 50%;
    animation: spinner-pulse 1.5s ease-out infinite !important;
    opacity: 0;
}

@keyframes spinner-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.placeholder-text {
    color: white !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--pulse-color);
    animation: pulse-text 1s infinite alternate;
}

@keyframes pulse-text {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* Pulse for Incoming Call (Recipient Side) */
@keyframes pulse-ring-vivid {
    0% {
        transform: scale(0.8);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.8);
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
        box-shadow: 0 0 40px 20px rgba(88, 101, 242, 0);
    }
}

.call-avatar::before,
.call-avatar::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #5865f2 !important;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: pulse-ring-vivid 2s cubic-bezier(0.25, 0, 0.2, 1) infinite !important;
}

.call-avatar::after {
    animation-delay: 1s !important;
}

/* Audio Volume Controls */
.audio-control-overlay {
    position: absolute;
    bottom: 35px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 25;
    pointer-events: auto;
}

.video-feed-item:hover .audio-control-overlay {
    opacity: 1;
}

.volume-mute-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-slider {
    -webkit-appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--brand);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--brand);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Mic Toggle Button in Chat Window */
.chat-action-btn.mic-toggle {
    margin-right: 8px;
    font-size: 1rem;
    padding: 4px 8px;
}

.chat-action-btn.mic-toggle.muted {
    background-color: var(--danger);
}

.chat-action-btn.mic-toggle:hover {
    filter: brightness(1.2);
}

/* Audio-only Grid Boxes */
/* Sidebar Volume Control */
.sidebar-volume-control {
    margin-top: 4px;
    padding: 2px 0;
}

.sidebar-volume-control .audio-control-overlay {
    position: static;
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-volume-control .volume-slider {
    flex: 1;
}

/* Audio Blocked Style */
.audio-blocked-overlay {
    padding: 10px;
    text-align: center;
}

.audio-enable-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Custom Dialog Styles */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeIn 0.2s ease-out;
}

.custom-dialog-card {
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialog-icon {
    font-size: 3rem;
}

.dialog-content {
    text-align: center;
    color: var(--text-normal);
    font-size: 1.1rem;
    line-height: 1.5;
}

.dialog-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.dialog-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 100px;
}

.dialog-btn.confirm {
    background: var(--brand-gradient);
    color: white;
}

.dialog-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
}

.dialog-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-normal);
    border: 1px solid var(--border-color);
}

.dialog-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Editing Styles */
.message-text {
    position: relative;
    padding-bottom: 4px;
    padding-right: 40px;
    /* Make space for the absolute tag */
    min-height: 1.2em;
}

.message-edit-inline {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--brand);
}

.message-edit-input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-normal);
    padding: 8px 12px;
    border-radius: 4px;
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
}

.message-edit-input:focus {
    outline: none;
    border-color: var(--brand);
}

.message-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.message-edit-actions button {
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.message-edit-actions button:first-child {
    background: var(--brand);
    color: white;
    border: none;
}

.message-edit-actions button:last-child {
    background: transparent;
    color: var(--text-normal);
    border: 1px solid var(--border-color);
}

.message-edit-actions button:hover {
    opacity: 0.8;
}

.message-edited-tag {
    position: absolute;
    bottom: 1px;
    right: 5px;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.4;
    font-style: italic;
    pointer-events: none;
    user-select: none;
}

.context-menu-item.disabled {
    opacity: 0.5;
    cursor: default;
    background: transparent !important;
}

.pm-message-item {
    cursor: default;
}

.deleted-message {
    opacity: 0.6;
    font-style: italic;
}

.deleted-tag {
    color: var(--danger);
    font-weight: bold;
    font-style: normal;
    margin-right: 5px;
}

/* --- Mobile Responsiveness --- */
.mobile-toggle-btn {
    display: none;
}

@media (max-width: 700px) {

    body,
    #root,
    .app-container {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    .main-body {
        flex-direction: column;
        height: 100%;
        width: 100%;
        overflow: hidden;
        display: flex;
    }

    /* Mobile Toggle Buttons */
    .mobile-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        width: 30px;
        height: 30px;
        border-radius: 6px;
        font-size: 1rem;
        flex-shrink: 0;
        border: none;
        color: white;
    }

    .rooms-toggle {
        background: var(--brand) !important;
        box-shadow: 0 0 10px var(--brand-glow);
    }

    .users-toggle {
        background: var(--bg-tertiary);
    }

    /* Header */
    .header {
        padding: 4px 6px;
        gap: 6px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        min-height: 40px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Top Strip Portrait Cameras */
    .video-strip {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto;
        gap: 6px;
        padding: 6px 4px;
        width: 100%;
        scrollbar-width: none;
        height: auto;
        min-height: 80px;
        align-items: flex-start;
        background: var(--bg-tertiary);
    }

    .video-strip::-webkit-scrollbar {
        display: none;
    }

    .video-feed-item {
        flex: 0 0 calc((100% - 24px) / 4);
        /* Exactly 4 per row with 6px gap */
        height: 75px !important;
        max-height: 75px !important;
        aspect-ratio: 3/4;
        border-radius: 4px;
        border: 2px solid var(--border-color);
        background: #000;
        position: relative;
    }

    .video-feed-item.local-video {
        border-color: var(--brand);
        box-shadow: 0 0 8px var(--brand-glow);
    }

    .video-feed-item .video-label {
        font-size: 0.4rem;
        padding: 1px 2px;
        background: rgba(0, 0, 0, 0.6);
        border-radius: 2px;
    }

    /* Content Area */
    .content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        width: 100%;
    }

    .chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: var(--bg-primary);
    }

    .message-list {
        padding: 6px;
        gap: 5px;
        flex: 1;
        overflow-y: auto;
    }

    .message-item {
        padding: 4px 10px;
        border-radius: 10px;
        max-width: 98%;
        display: flex;
        gap: 20px;
        /* Increased gap as requested */
    }

    .message-avatar-container {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .avatar-mini {
        width: 22px;
        height: 22px;
    }

    .message-content {
        flex: 1;
    }

    .message-sender {
        font-size: 0.75rem;
        font-weight: 600;
    }

    .message-text {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .message-time {
        font-size: 0.55rem;
    }

    /* Fixed Input Area at Bottom */
    .chat-input-area {
        padding: 8px 10px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        display: flex;
        gap: 6px;
        width: 100%;
        flex-shrink: 0;
        z-index: 100;
        position: relative;
    }

    .chat-input {
        flex: 1;
        height: 36px;
        font-size: 14px;
        border-radius: 18px;
    }

    /* Drawers */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px !important;
        height: 100%;
        z-index: 2000;
        background: var(--bg-secondary);
        border-right: 2px solid var(--brand);
        padding: 20px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

    .show-sidebar .sidebar {
        transform: translateX(0);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .user-view {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px !important;
        height: 100%;
        z-index: 2000;
        background: var(--bg-tertiary);
        border-left: 2px solid var(--brand);
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        max-height: none !important;
    }

    .show-userlist .user-view {
        transform: translateX(0);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .mobile-drawer-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1500;
        animation: fadeIn 0.15s ease-out;
    }

    /* Modal Optimization */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        padding: 15px !important;
        margin: 10px auto;
    }

    .modal-header {
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
    }

    .modal-title {
        font-size: 1.2rem !important;
    }

    /* Settings Modal Specifics */
    .modal-content.settings-modal {
        min-height: 0 !important;
    }

    .settings-layout,
    .room-enhanced-settings {
        flex-direction: column !important;
        height: 90vh !important;
        max-height: 90vh !important;
    }

    .settings-sidebar,
    .modal-sidebar {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding: 10px !important;
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    .settings-sidebar::-webkit-scrollbar,
    .modal-sidebar::-webkit-scrollbar {
        display: none !important;
    }

    .settings-nav-item,
    .modal-sidebar-item {
        margin-bottom: 0 !important;
        margin-right: 8px !important;
        white-space: nowrap !important;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    .settings-main,
    .modal-main-content {
        padding: 15px !important;
        overflow-y: auto !important;
    }

    .modal-sidebar-header {
        display: none !important;
        /* Hide redundant headers in mobile settings */
    }

    .modal-sidebar-footer {
        display: block !important;
        padding: 15px !important;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        order: 3;
    }

    .modal-main-content {
        order: 2;
        flex: 1;
        overflow-y: auto;
    }

    .modal-sidebar {
        order: 1;
    }

    .settings-content-pane {
        padding: 10px 0 !important;
    }

    .danger-zone {
        padding-top: 15px !important;
        margin-top: 20px !important;
    }

    .danger-room-delete-btn {
        width: 100% !important;
        text-align: center !important;
    }

    .auth-card {
        padding: 30px 20px !important;
        width: 90% !important;
        max-width: 90% !important;
        border-radius: 16px !important;
        max-height: 85vh !important;
    }

    @media (max-width: 360px) {
        .header-title {
            font-size: 0.8rem;
        }
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}