/* استایل‌های پایه */
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5; /* پس‌زمینه روشن برای حس اپلیکیشن */
    font-size: 16px; /* اندازه فونت پیش‌فرض برای موبایل */
    line-height: 1.5;
}

/* کانتینر اصلی */
.container {
    margin: 60px 10px 80px 10px; /* فاصله برای منوها در موبایل */
    padding: 15px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* سایه نرم */
}

/* سربرگ‌ها */
h2, h3 {
    color: #2c3e50; /* رنگ آبی تیره */
    font-size: 20px;
    margin-bottom: 15px;
}

/* فرم‌ها و ورودی‌ها */
form {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 500;
    color: #34495e;
    margin-bottom: 8px;
}

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    font-size: 14px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* دکمه‌ها */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #28a745; /* سبز اصلی */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
}

.btn:hover {
    background-color: #218838; /* سبز تیره‌تر */
}

/* دکمه‌های منو */
.nav-btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: #1abc9c; /* سبزآبی شیک */
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px; /* گوشه‌های گردتر */
    font-size: 14px;
    font-weight: 500;
    margin: 0 8px; /* فاصله بین دکمه‌ها */
    text-align: center;
}

.nav-btn:hover {
    background-color: #16a085; /* تیره‌تر */
}

/* دکمه به‌روزرسانی */
.update-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3498db; /* آبی */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 0 8px;
    text-align: center;
}

.update-btn:hover {
    background-color: #2980b9; /* آبی تیره‌تر */
}

/* دکمه کوچک */
.btn-small {
    padding: 6px 12px;
    background-color: #007bff; /* آبی روشن */
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px; /* فاصله از دکمه بعدی */
    text-align: center;
}

.btn-small:hover {
    background-color: #0056b3; /* آبی تیره */
}

/* دکمه حذف */
.delete-btn {
    padding: 8px 15px;
    background-color: #e74c3c; /* قرمز */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 0 8px;
    text-align: center;
}

.delete-btn:hover {
    background-color: #c0392b; /* قرمز تیره‌تر */
}

/* نوتیفیکیشن */
.notification {
    background-color: #f39c12; /* نارنجی */
    color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
}

.badge {
    background-color: #e74c3c; /* قرمز */
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 12px;
    margin-left: 8px;
}

/* خطا */
.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 15px;
}

/* جدول‌ها */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    min-width: 320px; /* حداقل عرض برای موبایل */
}

th, td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

th {
    background-color: #f5f5f5;
    font-weight: 500;
    color: #2c3e50;
}

tr:hover {
    background-color: #f9f9f9;
    cursor: pointer;
}

/* مودال */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #ffffff;
    margin: 20% auto;
    padding: 15px;
    border-radius: 10px;
    width: 90%;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: left;
    font-size: 24px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* فیلتر */
.filter-form {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.filter-form label {
    margin-top: 10px;
}

/* اولویت‌ها */
.priority-high {
    color: #e74c3c;
    font-weight: 500;
}

.priority-medium {
    color: #f39c12;
    font-weight: 500;
}

.priority-low {
    color: #2ecc71;
    font-weight: 500;
}

/* رنگ‌بندی بر اساس تاریخ */
tr.past-due {
    background-color: #ffebee; /* قرمز روشن */
}

tr.today {
    background-color: #fffde7; /* زرد روشن */
}

tr.future {
    background-color: #e8f5e9; /* سبز روشن */
}

/* وظایف تکمیل‌شده */
tr.completed {
    background-color: #f5f5f5;
    color: #7f8c8d;
}

/* تنظیمات برای موبایل (اولویت با موبایل) */
@media (max-width: 768px) {
    .container {
        margin: 50px 5px 70px 5px;
        padding: 10px;
    }

    h2, h3 {
        font-size: 18px;
    }

    .nav-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .btn, .update-btn, .delete-btn, button {
        padding: 8px 15px;
        font-size: 12px;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 10px;
    }

    table {
        min-width: 300px;
    }

    th, td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .filter-form {
        flex-direction: column;
    }

    .modal-content {
        margin: 30% auto;
        width: 80%;
        max-width: 250px;
    }
}

/* تنظیمات برای دسکتاپ */
@media (min-width: 769px) {
    .container {
        margin: 70px 20px 80px 20px;
        padding: 20px;
    }

    h2, h3 {
        font-size: 24px;
    }

    .nav-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .nav-btn2 {
        background: white;
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn, .update-btn, .delete-btn, button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-small {
        padding: 6px 12px;
        font-size: 12px;
    }

    th, td {
        padding: 12px 15px;
        font-size: 14px;
    }

    .filter-form {
        flex-direction: row;
        align-items: center;
    }

    .modal-content {
        margin: 15% auto;
        max-width: 400px;
    }
}