/* تنظیمات عمومی بدنه و فونت */
body {
    background-color: #f8f9fa; /* رنگ پس‌زمینه روشن */
    font-family: 'Vazir', Tahoma, sans-serif; /* فرض بر وجود فونت وزیر */
    min-height: 100vh; /* حداقل ارتفاع برای چسبیدن فوتر به پایین صفحه */
    display: flex;
    flex-direction: column;
}

/* تنظیمات نوار ناوبری (Navbar) و لینک‌ها */
/* Make the navbar slightly taller and add subtle shadow */
#main-navbar {
    padding-top: 0.75rem; /* Increased padding */
    padding-bottom: 0.75rem; /* Increased padding */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Slightly more pronounced shadow */
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Subtle bottom border */
}

.navbar-brand {
    font-weight: 700; /* ضخامت بیشتر برای لوگو/عنوان */
    font-size: 1.5rem;
    color: #0d6efd; /* رنگ آبی Bootstrap primary */
    padding-right: 1rem; /* Add some padding to the right of the brand */
}

.nav-link {
    font-weight: 500; /* Slightly lighter font weight for links */
    color: #495057; /* Darker gray for better readability */
    transition: color 0.2s ease-in-out;
}

.nav-link:hover {
    color: #0d6efd; /* Hover color matches brand color */
}

/* Style for the date display in Navbar */
#current-date {
    font-size: 0.95rem;
    color: #6c757d; /* Muted gray color */
    font-weight: 400;
}

/* Style for user profile/logout links in Navbar */
.navbar-nav .nav-item .nav-link {
    padding-left: 1rem;
    padding-right: 1rem;
}

.navbar-nav .nav-item .btn-link {
    font-weight: 500;
    color: #dc3545 !important; /* Red for logout, keep it consistent */
}

.navbar-nav .nav-item .btn-link:hover {
    text-decoration: underline !important;
}


/* تنظیمات بخش اصلی محتوا */
main {
    flex: 1; /* محتوای اصلی تمام فضای موجود را اشغال می‌کند */
}

/* تنظیمات فوتر */
footer {
    background-color: #f0f2f5; /* Light gray background for elegance */
    color: #6c757d; /* Muted gray text color */
    padding: 15px 0; /* Slightly more padding */
    text-align: center;
    width: 100%;
    font-size: 0.85rem; /* Slightly smaller font size */
    margin-top: auto; /* فوتر را به پایین صفحه می‌چسباند */
    border-top: 1px solid rgba(0,0,0,0.05); /* Subtle top border */
}

/* --- کلاس‌های سفارشی برای تقویم شمسی (persian-datepicker) --- */
.jalali-datepicker {
    /* می‌توانید استایل‌های خاصی برای ورودی تقویم اینجا اضافه کنید */
    border-radius: 0.5rem; /* Soften corners */
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

/* کلاس برای نمایش تاریخ‌های شمسی در لیست‌ها (فقط برای اطمینال از خوانایی) */
.jalali-date {
    font-family: 'Vazir', Tahoma, sans-serif; /* اطمینان از نمایش ارقام فارسی با فونت مناسب */
    direction: ltr; /* برای نمایش صحیح اعداد فارسی در کنار متن انگلیسی */
    display: inline-block; /* برای کنترل بهتر فضای نمایش */
    color: #495057; /* Consistent text color */
}

/* --- کلاس‌های رنگ‌بندی برای پیام‌ها (Django Messages) و لیست‌ها --- */
.list-group-item-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c2c7 !important;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    border-radius: 0.5rem; /* Soften corners */
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
    border-radius: 0.5rem;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
    border-radius: 0.5rem;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #721c24;
    border-radius: 0.5rem;
}

/* General button styling for elegance */
.btn {
    border-radius: 0.5rem; /* Soften corners */
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0a58ca;
    border-color: #0a58ca;
}

/* Ensure form elements have rounded corners */
.form-control, .form-select {
    border-radius: 0.5rem;
}

/* Styling for the sidebar toggle button in the navbar */
.sidebar-toggle-button {
    color: #6c757d; /* Muted gray for the icon */
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem; /* Adjust padding for a better click/touch target */
    border-radius: 0.5rem;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.sidebar-toggle-button:hover {
    background-color: rgba(0,0,0,0.05); /* Subtle hover effect */
    color: #0d6efd; /* Primary color on hover */
}

.sidebar-toggle-button.btn-pinned {
    color: #0d6efd; /* Highlight when pinned */
}

/* --- Modern Tree View Styles --- */
.tree-container {
    background-color: #fff;
    border-radius: 0.5rem;
}

.tree, .tree ul {
    list-style: none;
    padding-right: 25px; /* Indentation for children */
    position: relative;
}

/* Remove padding from the root ul */
.tree-container > .tree {
    padding-right: 0;
}

.tree ul {
    margin-top: 5px;
}

.tree li {
    position: relative;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* Vertical line connecting all children */
.tree ul::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 1px;
    background-color: #dee2e6; /* Bootstrap border color */
}

/* Horizontal line for each item */
.tree li::before {
    content: '';
    position: absolute;
    top: 21px; /* Vertically center with the node */
    right: -25px; /* Connect to the parent's vertical line */
    width: 25px;
    height: 1px;
    background-color: #dee2e6;
}

.tree a {
    text-decoration: none;
    color: #212529; /* Bootstrap default text color */
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
    display: inline-block; /* To allow padding and hover effect */
}

.tree a:hover {
    background-color: #e9f5ff; /* A light blue hover */
    color: #0056b3;
}
