:root {
    --bg-color: #17212b;
    --chat-bg: #0e1621;
    --panel-color: #17212b;
    --text-color: #ffffff;
    --text-muted: #7d8b99;
    --primary-color: #5288c1;
    --msg-in: #182533;
    --msg-out: #2b5278;
    --link-color: #4facfe;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Mahoor-Regular-FD-ELC.woff2') format('woff2');
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Vazir', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

.app-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* دسکتاپ */
@media (min-width: 769px) {
    .app-shell {
        height: 100vh;
    }
}

/* موبایل: ارتفاع واقعی صفحه */
@media (max-width: 768px) {
    .app-shell {
        height: 100dvh;
    }
}

/* --- سایدبار --- */
.sidebar {
    width: 350px;
    min-width: 350px;
    background: var(--panel-color);
    display: flex;
    flex-direction: column;
    border-left: 1px solid #000;
    z-index: 20;
}

.sidebar-top {
    padding: 10px;
}

.room-list {
    flex: 1;
    overflow-y: auto;
}

/* --- چت --- */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    position: relative;
    z-index: 10;
}

/* هدر ثابت */
.chat-header {
    height: 60px;
    min-height: 60px;
    flex-shrink: 0;
    background: var(--panel-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border-bottom: 1px solid #000;
}

/* ناحیه پیام‌ها تنها بخش اسکرول */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* فوتر تایپ همیشه پایین */
.composer {
    flex-shrink: 0;
    background: var(--panel-color);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #000;
}

#msgInput {
    flex: 1;
    background: var(--bg-color);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    height: 45px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
}

/* تنظیمات و ادمین */
.admin-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
}

/* موبایل */
#backToMenuBtn {
    display: none;
    font-size: 24px;
    color: white;
    background: none;
    border: none;
    margin-left: 10px;
}

@media (max-width: 768px) {

    .sidebar {
        width: 100%;
        position: absolute;
        height: 100%;
        transition: transform 0.3s ease;
        z-index: 20;
    }

    .chat {
        width: 100%;
        position: absolute;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 30;
    }

    .app-shell.view-chat .sidebar {
        transform: translateX(-100%);
    }

    .app-shell.view-chat .chat {
        transform: translateX(0);
    }

    .app-shell.view-list .sidebar {
        transform: translateX(0);
    }

    .app-shell.view-list .chat {
        transform: translateX(100%);
    }

    #backToMenuBtn {
        display: block;
    }
}
