/* assets/style.css - نسخه حرفه‌ای و مدرن */

/* 1. تنظیمات فونت و متغیرها */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

:root {
    /* پالت رنگی */
    --primary: #2c3e50;       /* سرمه‌ای تیره */
    --primary-hover: #1a252f;
    --accent: #3498db;        /* آبی */
    --accent-hover: #2980b9;
    --success: #27ae60;       /* سبز */
    --success-hover: #219150;
    --danger: #e74c3c;        /* قرمز */
    --danger-hover: #c0392b;
    --warning: #f39c12;       /* نارنجی */
    --warning-hover: #d68910;
    
    /* رنگ‌های زمینه و متن */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
    
    /* تنظیمات ابعاد */
    --radius: 8px;
    --header-height: 65px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* 2. بازنشانی (Reset) و تنظیمات عمومی */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    line-height: 1.6;
    padding-top: var(--header-height);
    direction: rtl;
}

/* اعمال فونت اجباری روی تمام عناصر فرم */
input, select, textarea, button, .btn, table, th, td, h1, h2, h3, h4, h5, h6 {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
}

a {
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

ul {
    list-style: none;
}

/* 3. ساختار کلی (Layout) */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--accent);
    transition: transform 0.2s;
}

.card h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary);
    font-size: 1.4em;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.col {
    flex: 1;
    min-width: 250px;
}

/* 4. فرم‌ها (Forms) - بخش مهم برای زیبایی */
form {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95em;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px 15px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    background-color: #fff;
    transition: border 0.3s, box-shadow 0.3s;
    margin-bottom: 15px;
    color: var(--text-main);
}

/* فوکوس روی اینپوت‌ها */
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

/* استایل سلکت باکس */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 12px;
    appearance: none; /* حذف استایل پیش‌فرض مرورگر */
    -moz-appearance: none;
    -webkit-appearance: none;
}

/* چک باکس */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
    margin: 0 5px;
    accent-color: var(--accent); /* رنگ چک باکس در مرورگرهای جدید */
}

/* 5. دکمه‌ها (Buttons) */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.3s;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background-color: var(--accent); }
.btn-primary:hover { background-color: var(--accent-hover); }

.btn-success { background-color: var(--success); }
.btn-success:hover { background-color: var(--success-hover); }

.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: var(--danger-hover); }

.btn-warning { background-color: var(--warning); color: #333 !important; }
.btn-warning:hover { background-color: var(--warning-hover); }

.btn-secondary { background-color: #95a5a6; }
.btn-secondary:hover { background-color: #7f8c8d; }

.btn-sm { padding: 5px 10px; font-size: 0.85em; margin: 2px; }

/* 6. جداول (Tables) - زیبا و خوانا */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 600px; /* جلوگیری از له شدن در موبایل */
}

table.data-table th {
    background-color: #f1f2f6;
    color: var(--primary);
    font-weight: bold;
    padding: 15px;
    text-align: center;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

table.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
    color: #555;
}

/* رنگ‌بندی یک‌درمیان سطرها */
table.data-table tr:nth-child(even) { background-color: #f9f9f9; }
table.data-table tr:hover { background-color: #f1f8ff; }

/* 7. هدر (Header) - ساختار جدید */
.navbar {
    background-color: var(--primary);
    color: #fff;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-right, .nav-left {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 15px;
}

.brand {
    font-weight: 800;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    align-items: center;
    height: 100%;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* دراپ‌داون‌های هدر */
.dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.dropbtn {
    background: transparent; color: #ecf0f1; border: none; font-size: 0.9em;
    cursor: pointer; padding: 0 15px; height: 100%; display: flex; align-items: center; gap: 5px;
    box-shadow: none;
}
.dropbtn:hover, .dropbtn.active { background: rgba(255,255,255,0.1); color: #fff; }
.dropbtn::after { content: '▼'; font-size: 0.6em; opacity: 0.8; }

.dropdown-content {
    display: none;
    position: absolute;
    top: var(--header-height);
    right: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    border-top: 3px solid var(--accent);
}
.dropdown-content a {
    color: #333;
    padding: 12px 15px;
    display: block;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9em;
}
.dropdown-content a:hover { background: #f8f9fa; color: var(--accent); padding-right: 20px; }
.show { display: block; animation: slideDown 0.2s; }

/* دکمه‌های خاص هدر */
.btn-logout { background: var(--danger); padding: 5px 15px; font-size: 0.85em; height: 35px; border-radius: 20px; }
.btn-dashboard { background: var(--accent); padding: 0 15px; height: 40px; display: flex; align-items: center; border-radius: 4px; color: #fff; }
.btn-date-tool { background: var(--warning); border:none; height: 35px; width: 35px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.2em; box-shadow: none; padding: 0;}

.user-info {
    font-size: 0.9em;
    color: #bdc3c7;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 15px;
}

/* 8. المان‌های کمکی (Utilities) */
.alert-info {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}
.badge-info { background-color: var(--accent); }
.badge-warning { background-color: var(--warning); color: #333; }
.badge-success { background-color: var(--success); }
.badge-danger { background-color: var(--danger); }

/* مدال (Modal) */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 9999; justify-content: center; align-items: center;
}
.modal-box {
    background: #fff; padding: 25px; border-radius: var(--radius); width: 90%; max-width: 400px;
    position: relative; animation: fadeIn 0.3s;
}
.modal-close { position: absolute; left: 15px; top: 15px; font-size: 24px; color: #999; cursor: pointer; }

/* 9. ریسپانسیو (موبایل) */
@media (max-width: 992px) {
    .hamburger { display: block; }
    
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 280px;
        height: calc(100vh - var(--header-height));
        background: #2c3e50;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        overflow-y: auto;
    }
    
    .nav-menu.active { right: 0; }
    
    .dropdown { display: block; width: 100%; height: auto; margin-bottom: 5px; }
    .dropbtn { width: 100%; justify-content: space-between; background: rgba(255,255,255,0.05); border-radius: var(--radius); height: 45px; }
    .dropdown-content { position: static; box-shadow: none; border: none; background: rgba(0,0,0,0.2); width: 100%; }
    .dropdown-content a { color: #ddd; border-bottom: 1px solid rgba(255,255,255,0.05); padding-right: 30px; }
    
    .user-info { display: none; }
    .btn-dashboard { width: 100%; justify-content: center; margin-bottom: 10px; background: rgba(255,255,255,0.1); }
    
    .row { flex-direction: column; gap: 15px; }
    
    /* تنظیم دکمه تبدیل تاریخ در موبایل */
    .btn-date-tool { width: 30px; height: 30px; font-size: 1em; }
}

@keyframes slideDown { from {opacity: 0; transform: translateY(-10px);} to {opacity: 1; transform: translateY(0);} }
@keyframes fadeIn { from {opacity: 0; transform: translateY(-20px);} to {opacity: 1; transform: translateY(0);} }