/* Messenger Pro - Fixed UI/UX v6 */

/* --- فونت‌ها --- */
@font-face { font-family: 'Mahoor'; src: url('../fonts/Mahoor-Regular-FD-ELC.woff2') format('woff2'); font-weight: normal; }
@font-face { font-family: 'Mahoor'; src: url('../fonts/Mahoor-Medium-FD-ELC.woff2') format('woff2'); font-weight: 500; }
@font-face { font-family: 'Mahoor'; src: url('../fonts/Mahoor-FD-Bold.woff2') format('woff2'); font-weight: bold; }

:root {
    --bg-main: #050505;
    --bg-sidebar: #101010;
    --bg-header: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --accent: #d4af37;
    --border: #333;
    --input-bg: #222;
}

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

body {
    font-family: 'Mahoor', sans-serif !important;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0; padding: 0;
    /* حل مشکل اسکرول و کیبورد در موبایل */
    height: 100dvh; 
    overflow: hidden;
    direction: rtl;
}

/* --- فونت ادمین (مورد 6) --- */
.admin-body, .admin-body * {
    font-family: 'Mahoor', sans-serif !important;
}

/* --- دراپ‌داون منو (مورد 2) --- */
.dropdown-menu {
    background-color: #252525 !important;
    border: 1px solid var(--border) !important;
}
.dropdown-item {
    color: #fff !important;
    transition: 0.2s;
    text-align: right;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--accent) !important;
    color: #000 !important; /* متن تیره روی زمینه طلایی */
}

/* --- تب‌ها (مورد 5) --- */
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link {
    color: #888 !important;
    border: none !important;
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: 0.3s;
    cursor: pointer;
}
.nav-tabs .nav-link.active {
    background: transparent !important;
    color: var(--accent) !important;
    font-weight: bold;
    border-bottom: 2px solid var(--accent) !important; /* خط طلایی */
}

/* --- چیدمان چت (مورد 4 - ریسپانسیو) --- */
.chat-container { display: flex; height: 100dvh; width: 100%; position: relative; } /* 100dvh مهم است */
.chat-sidebar { width: 360px; height: 100%; background: var(--bg-sidebar); border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; }
.chat-main { flex: 1; height: 100%; background: #000 url('https://web.telegram.org/img/bg_1.png'); display: flex; flex-direction: column; position: relative; z-index: 10; }

.chat-header {
    height: 65px; background: var(--bg-header); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 15px; flex-shrink: 0;
}

#messages-container {
    flex: 1; /* پر کردن فضای خالی */
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ورودی پیام (فیکس شده پایین) */
.chat-input-area {
    background: var(--bg-header);
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* جلوگیری از جمع شدن */
    position: relative;
    z-index: 50;
}
.chat-input-area textarea {
    background: #2c2c2c !important; color: #fff !important;
    border: 1px solid #444; border-radius: 20px; padding: 10px 15px;
}

/* --- پیام‌ها --- */
.message { max-width: 80%; padding: 10px 15px; border-radius: 15px; font-size: 0.95rem; color: #fff; position: relative; }
.message.sent { background: #2b5278; align-self: flex-start; }
.message.received { background: #252525; align-self: flex-end; }

/* --- موبایل --- */
@media (max-width: 768px) {
    .chat-sidebar { width: 100%; position: absolute; padding-bottom: 80px; height: 100%; }
    .chat-main { width: 100%; position: absolute; transform: translateX(-100%); transition: transform 0.3s ease; z-index: 50; height: 100%; }
    .chat-container.chat-active .chat-main { transform: translateX(0); }
    .chat-container.chat-active .bottom-nav { display: none; }
    .bottom-nav { display: flex; }
    .desktop-tabs { display: none !important; }
    .back-btn { display: inline-block !important; }
}

/* نوار پایین */
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 75px;
    background: #111; border-top: 1px solid var(--accent); z-index: 9999;
    justify-content: space-around; align-items: center; padding-bottom: 10px;
}
.nav-item-mobile { display: flex; flex-direction: column; align-items: center; color: #666; text-decoration: none; font-size: 0.7rem; width: 20%; cursor: pointer; }
.nav-item-mobile.active { color: var(--accent); }
.nav-item-mobile i { font-size: 1.6rem; margin-bottom: 5px; }

/* پلاس وسط */
.nav-plus-wrapper { position: relative; top: -30px; }
.nav-plus-btn {
    width: 60px; height: 60px; background: var(--accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #000;
    font-size: 2rem; border: 5px solid var(--bg-main); box-shadow: 0 0 15px rgba(212,175,55,0.4);
}

/* آواتار */
.avatar-wrapper { position: relative; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; }
.avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); padding: 2px; }
.icon-btn { background: none; border: none; color: #aaa; font-size: 1.3rem; padding: 5px; cursor: pointer; transition:0.2s; }
.icon-btn:hover { color: var(--accent); }