/* style.css */

/* تنظیمات عمومی و فونت */


:root {
    --primary-color: #007bff; 
    --sidebar-bg: #2c3e50; 
    --sidebar-text: #ecf0f1;
    --active-bg: #34495e; 
    --sidebar-width: 240px; /* متغیر عرض نوار کناری */
    --navbar-height: 56px;
}

body {
   
    background-color: #f4f7f6;
    /* فضای خالی زیر Navbar را به body می‌دهیم */
    padding-top: var(--navbar-height); 
    width: 100%; 
    overflow-x: hidden; /* جلوگیری از اسکرول افقی در موبایل */
}

/* استایل‌دهی صفحه ورود */
.login-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* نوار کناری (Sidebar) */
.sidebar {
    height: 100vh;
    position: fixed;
    /* شروع سایدبار از زیر Navbar */
    top: 0;
    right: 0;
    z-index: 1020; 
    background-color: var(--sidebar-bg);
    /* padding-top: 0; چون به body منتقل شده است. */
    padding-top: var(--navbar-height); 
    transition: margin-right 0.3s;
    width: var(--sidebar-width); 
}

.sidebar a {
    color: var(--sidebar-text);
    padding: 15px 20px;
    text-decoration: none;
    display: block;
    font-size: 1.05rem;
    border-right: 5px solid transparent; 
    transition: all 0.2s;
}

.sidebar a:hover {
    background-color: var(--active-bg);
    color: white;
}

.sidebar a.active {
    background-color: var(--active-bg);
    color: white;
    font-weight: bold;
    border-right-color: var(--primary-color); 
}

/* محتوای اصلی (Main Content) */
.main-content {
    /* Padding پیش‌فرض برای موبایل و تبلت */
    padding-right: 15px; 
    padding-left: 15px; 
    transition: padding-right 0.3s;
}

/* **اصلاح قطعی** - حالت دسکتاپ (زمانی که عرض صفحه 992px و بزرگتر است) */
@media (min-width: 992px) { 
      .main-content {
        margin-right: var(--sidebar-width);   /* جابه‌جایی کل محتوا */
        padding-right: 30px;                  /* فاصله داخلی دلخواه */
        width: calc(100% - var(--sidebar-width));
    }
    /* دکمه Navbar Toggler در دسکتاپ ناپدید می‌شود */
    .navbar-toggler {
        display: none;
    }
}

/* حالت موبایل (زمانی که عرض صفحه کوچکتر از 992px است) */
@media (max-width: 991.98px) { 
    
    /* پنهان کردن سایدبار به صورت پیش فرض */
    .sidebar {
        margin-right: calc(0px - var(--sidebar-width)); 
    }
    .sidebar.active {
        margin-right: 0; 
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    }
    
    /* دکمه Navbar Toggler در موبایل نمایش داده می‌شود */
    .navbar-toggler {
        display: block;
    }
}

/* استایل‌دهی بخش‌های محتوا */
.content-section h2 {
    color: #34495e;
    border-bottom: 2px solid #bdc3c7;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card-custom {
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}