@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    direction: rtl; 
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- سایدبار دسکتاپ --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 20px;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 25px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.nav-item.active {
    background: #eff6ff;
    color: var(--primary);
}

.logout-btn {
    margin-top: auto;
    color: #ef4444;
}

.logout-btn:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* --- کانتینر محتوا --- */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 25px;
    max-width: 1200px;
    box-sizing: border-box;
}

/* --- هدر موبایل (خلوت و مینیمال) --- */
.mobile-top-header {
    display: none; 
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.mobile-logo {
    font-size: 16px;
    font-weight: 900;
    color: var(--primary);
}

/* --- منوی پایین موبایل (۴ آیتم اصلی + دکمه بیشتر) --- */
.mobile-nav {
    display: none; 
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 8px 6px;
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
    gap: 3px;
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-item span {
    font-size: 20px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

/* --- صفحه مودال / پاپ‌آپ بخش "بیشتر" --- */
.more-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: flex-end; /* باز شدن از پایین صفحه مثل اکشن‌شیت موبایل */
    animation: fadeIn 0.2s ease-in-out;
}

.more-modal.active {
    display: flex;
}

.more-modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.15);
    animation: slideUp 0.3s ease-in-out;
}

.more-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 900;
    font-size: 15px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.more-item {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: 0.2s;
}

.more-item:hover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.more-item.logout {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fee2e2;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* --- واکنش‌گرایی برای موبایل --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-right: 0; padding: 8px; padding-bottom: 82px; }
    .mobile-top-header { margin-bottom: 10px; padding: 10px 14px; }
    .mobile-nav { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    .mobile-nav-item { min-height: 42px; }
    input, select, textarea, button { min-height: 40px; }
    textarea { line-height: 1.7; }
    .mobile-nav { display: flex; }
    .mobile-top-header { display: flex; }
}