/*
 * @file      Lawyer Dashboard Styles
 * @version   1.2.23
 * @author    Google Gemini (Finalized)
 * @copyright This CSS is a modification of an original file and is provided for improvement purposes.
 */

/* Font Awesome CDN - This is placed here for demonstration purposes. It's best practice to add it in header.php */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* Font Family - We use Tajawal for Arabic, with a sans-serif fallback. */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

/* --- Variable Definitions --- */
:root {
    --main-bg: #f5f7f9;
    --primary-color: #0073aa;
    --primary-dark: #005177;
    --secondary-color: #ffc107;
    --secondary-dark: #e0a800;
    --success-color: #28a745;
    --danger-color: #dc3232;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --light-bg: #f9f9f9;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease-in-out;
}

/* --- Base & Typography --- */
body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--main-bg);
    color: var(--text-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* --- Layout & Containers --- */
.content-area {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.entry-header {
    padding: 20px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.entry-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.entry-header h1 i {
    font-size: 1.8rem;
}

.entry-header p {
    color: var(--text-light);
}

.dashboard-info {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-info div {
    flex: 1 1 200px;
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
}

.dashboard-info h4 {
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dashboard-info h4 i {
    font-size: 1.1rem;
}

.dashboard-info p {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.dashboard-info span {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* اخفائها علي الموبايل */
@media (max-width: 768px) {
    .dashboard-info {
        display: none;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}

.section-header h2 {
    margin: 0;
    font-size: 1.8rem;
    border-right: 5px solid;
    padding-right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    font-size: 1.4rem;
}

/* Use var() for section header colors for better consistency */
.section-header h2.past-sessions-title {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.section-header h2.upcoming-sessions-title {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.section-header h2.in-progress-title {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.section-header h2.closed-title {
    border-color: var(--text-light);
    color: var(--text-light);
}

.section-header h2.admin-tasks-title {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* --- Buttons & Forms --- */
.button-primary,
.button-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff !important;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.button-primary:hover,
.button-link:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.button-ruling {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.button-ruling:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.add-task-btn,
.complete-admin-task-btn {
    background-color: var(--success-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.add-task-btn:hover,
.complete-admin-task-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    border: 1px solid var(--border-color);
}

.filter-item {
    flex: 1 1 200px;
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.filter-item input:focus,
.filter-item select:focus {
    border-color: var(--primary-color);
    outline: none;
    /* Using var() for box-shadow for consistency */
    box-shadow: 0 0 0 0.2rem rgba(0,115,170,.25); /* Adjusted to match primary-color */
}

.filter-container button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.filter-container button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-container button i {
    font-size: 1rem;
}

/* --- Tables --- */
.case-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.case-table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    text-align: right;
    padding: 15px;
    border-bottom: 2px solid var(--primary-dark);
}

.case-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.case-table tbody tr:hover {
    background-color: var(--light-bg);
}

.case-table td {
    padding: 15px;
    vertical-align: middle;
}

.case-table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.case-table a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Row Colors */
.upcoming-row { background-color: #e6f3fa; }
.past-row { background-color: #fae6e6; }
.in-progress-row { background-color: #fff9e6; }
.closed-row { background-color: #f1f1f1; }

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    padding-top: 60px;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: var(--card-hover-shadow);
    direction: rtl;
    text-align: right;
    border: 1px solid var(--border-color);
}

.close-modal {
    color: #aaa;
    float: left;
    font-size: 32px;
    font-weight: bold;
    transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.modal-content button[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 12px 25px;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.modal-content button[type="submit"]:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* --- Collapsible Sections --- */
.collapsible {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px 20px;
    width: 100%;
    border: none;
    text-align: right;
    outline: none;
    font-size: 1rem;
    transition: background-color 0.4s;
    margin-top: 20px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible.active, .collapsible:hover {
    background-color: var(--primary-dark);
}

.collapsible i {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.collapsible.active i {
    transform: rotate(180deg);
}

.collapsible-container {
    padding: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.collapsible-container.expanded {
    max-height: 1000px; /* قيمة كبيرة بما يكفي لإظهار المحتوى */
    padding: 15px;
}

/* --- Admin Tasks --- */
.admin-tasks-container {
    background-color: #fffaf0;
    border: 1px solid #ffcc80;
    padding: 20px;
    border-radius: var(--border-radius);
}

.admin-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-right: 5px solid var(--secondary-color);
    flex-wrap: wrap;
}

.admin-task-details {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-task-details p {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-task-details p i {
    color: var(--primary-color);
}

.admin-task-details strong {
    font-weight: bold;
    color: var(--text-color);
}

.admin-task-actions {
    margin-right: 20px;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- Print Styles --- */
@media print {
    body {
        background-color: #fff;
        margin: 20mm;
        font-size: 12pt;
        color: #000;
    }

    .no-print,
    .print-hide,
    .button-ruling,
    .button-link,
    .add-task-btn,
    .complete-admin-task-btn,
    .admin-task-actions,
    .new-case-section,
    .collapsible,
    .filter-container,
    .entry-header {
        display: none !important;
    }

    .content-area, main, .entry-content {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .case-table {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }

    .case-table thead th {
        background-color: #f1f1f1 !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        border: 1px solid #ddd;
    }

    .case-table tbody td {
        border: 1px solid #ddd;
    }

    h2, h3 {
        page-break-after: avoid;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .ruling-row-for-print {
        display: table-row !important;
        border-top: none;
    }

    .ruling-row-for-print td {
        border-top: none !important;
        padding-top: 0;
    }

    .admin-task-item {
        display: block;
        border: 1px solid #ddd;
        padding: 10px;
        margin-bottom: 10px;
        border-right: none;
        box-shadow: none;
    }

    .admin-task-details p {
        white-space: normal;
    }
}

.ruling-row-for-print {
    display: none;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px; /* تقليل الفراغ بين عناصر التصفية */
    }

    .filter-item {
        flex: none;
        width: 100%; /* خلي العناصر تاخد العرض بالكامل */
        margin-bottom: 0; /* إزالة أي فراغ إضافي */
    }

    .filter-item input,
    .filter-item select,
    .filter-container button {
        width: 100%; /* عناصر التصفية تملأ الصف */
    }
    
    .dashboard-info div {
        margin-bottom: 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .case-table {
        border: none;
        box-shadow: none;
    }

    .case-table thead {
        display: none;
    }
    
    .case-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: var(--card-shadow);
        overflow: hidden;
        padding: 15px;
        position: relative;
    }

    .case-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .case-table td {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        background: transparent;
        box-shadow: none;
        margin-bottom: 0;
        border-radius: 0;
    }
    
    /* NEW: All fields will have both the icon and the data-label text. */
    .case-table td::before {
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        margin-left: 8px;
        color: var(--primary-color);
        font-weight: bold;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    /* Rules for all fields to display the icon and the name */
    td[data-label="رقم الملف"]::before {
        content: "\f15c" " " attr(data-label) !important;
    }

    td[data-label="موضوع القضية"]::before {
        content: "\f0e3" " " attr(data-label) !important;
    }

    td[data-label="رقم القضية"]::before {
        content: "\f274" " " attr(data-label) !important;
    }
    
    td[data-label="المحكمة"]::before {
        content: "\f24e" " " attr(data-label) !important;
    }
    
    td[data-label="الموكل"]::before {
        content: "\f007" " " attr(data-label) !important;
    }
    
    td[data-label="الخصم"]::before {
        content: "\f507" " " attr(data-label) !important;
    }
    
    td[data-label="الحالة"]::before {
        content: "\f05a" " " attr(data-label) !important;
    }
    
    td[data-label="أحدث جلسة بدون قرار"]::before {
        content: "\f073" " " attr(data-label) !important;
    }
    
    td[data-label="أقرب جلسة"]::before {
        content: "\f073" " " attr(data-label) !important;
    }

    /* NEW rule for "آخر تحديث" (Last Update) */
    td[data-label="آخر تحديث"]::before {
        content: "\f017" " " attr(data-label) !important;
    }

    /* Hide the ruling field on mobile for past sessions using the provided class */
    .past-row.ruling-row-for-print {
        display: none !important;
    }

    .case-table td:last-child {
        padding-bottom: 0;
    }

    .case-table .button-link,
    .case-table .button-ruling {
        width: 100%;
        text-align: center;
        margin-top: 10px;
        display: block;
    }
    
    #printAdminTasksBtn,
    #printPastSessionsBtn,
    #printUpcomingSessionsBtn,
    #printInProgressBtn,
    #printClosedCasesBtn {
        display: none !important;
    }

    .admin-task-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        border-right: 5px solid var(--secondary-color);
        border-radius: var(--border-radius);
        box-shadow: var(--card-shadow);
        margin-bottom: 15px;
    }

    .admin-task-details {
        flex-grow: 1;
        width: 100%;
        gap: 10px;
    }

    .admin-task-details p {
        flex-basis: 100%;
    }

    .admin-task-actions {
        margin-right: 0;
        margin-top: 15px;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .admin-task-actions button {
        flex-grow: 1;
        width: 100%;
        justify-content: center;
    }
}

/* Adjustments for smaller font and better spacing */
.case-table thead th {
    font-size: 0.9rem;
    padding: 10px;
}

.case-table td {
    font-size: 0.85rem;
    padding: 10px;
}

/* Visual alert for very urgent tasks */
.urgent-task {
    background-color: #ffe6e6 !important;
    border: 2px solid #ff4d4d;
    animation: pulse 1.5s infinite;
}

/* Pulsing animation for urgent tasks */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4); }
    70% { transform: scale(1.01); box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* Visual alert for today's sessions - More prominent */
.today-session {
    background-color: #e6f7ff !important;
    border-right: 5px solid #007bff;
    font-weight: bold;
    box-shadow: 4px 0 8px rgba(0, 123, 255, 0.2);
    animation: bounceIn 0.8s;
}

/* Visual alert for tomorrow's sessions - More prominent */
.tomorrow-session {
    background-color: #fffde7 !important;
    border-right: 5px solid #ffc107;
    font-weight: 500;
    box-shadow: 4px 0 8px rgba(255, 193, 7, 0.2);
}

/* Keyframes for the bounce animation */
@keyframes bounceIn {
    from, 20%, 40%, 60%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }

    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }

    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }

    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }

    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }

    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }

    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}
/*
 * ----------------------------------------------------
 * تنسيقات حاوية الأزرار لتثبيت الإشعار
 * ----------------------------------------------------
 */
.button-with-badge {
    position: relative; /* ضروري جداً لتثبيت الإشعار داخله */
    display: inline-block; /* يجعل الحاوية بحجم محتوياتها */
}

/*
 * ----------------------------------------------------
 * تنسيقات الإشعار الدائري (البادج)
 * ----------------------------------------------------
 */
.task-count-badge {
    position: absolute;
    top: -10px; /* أعلى الزر */
    left: -10px; /* شمال الزر */
    background-color: var(--danger-color, #e74c3c); /* أحمر افتراضي */
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    height: 25px;
    width: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 2;
    border: 2px solid #fff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* ألوان مختلفة للإشعار */
.task-count-badge.yellow {
    background-color: #f1c40f;
    color: #000;
}

.task-count-badge.red {
    background-color: #e74c3c;
    color: #fff;
}

/* تأثير عند المرور */
.task-count-badge:hover {
    transform: scale(1.1);
}

/*
 * ----------------------------------------------------
 * تنسيقات القائمة المنسدلة (Dropdown)
 * ----------------------------------------------------
 */
.task-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 99;
}

/*
 * ----------------------------------------------------
 * تنسيقات المودال (النافذة المنبثقة) - محسّنة
 * ----------------------------------------------------
 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.tasks-modal-content {
    background: #fff;
    padding: 25px; /* زيادة بسيطة في المسافة الداخلية */
    border-radius: 12px;
    width: 450px; /* زيادة بسيطة في العرض */
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2); /* ظل أعمق */
    animation: fadeIn 0.3s ease-in-out; /* إضافة تحريك */
}

/* عنوان المودال في المنتصف */
.tasks-modal-content h3 {
    text-align: center;
    font-size: 1.5rem; /* استخدام وحدة قياس نسبية */
    margin-bottom: 20px;
    color: var(--primary-dark, #005177);
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    padding-bottom: 10px;
}
/* زر الإغلاق */
.close-modal-btn {
    position: absolute;
    top: 8px; /* تم تقليل المسافة العلوية */
    left: 8px; /* تم تقليل المسافة الجانبية */
    font-size: 18px; /* تم تصغير الحجم */
    font-weight: bold;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.close-modal-btn:hover {
    color: var(--danger-color, #e74c3c);
    transform: rotate(90deg) scale(1.1); /* تأثير التحريك بقي كما هو */
}
/* قائمة المهام */
#tasks-list-content ul {
    list-style: none; /* إزالة النقاط */
    padding: 0;
    margin: 0;
}

#tasks-list-content li {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    color: var(--text-color, #333);
    transition: background-color 0.2s ease-in-out;
}

#tasks-list-content li:hover {
    background-color: var(--light-bg, #f9f9f9);
}

/* تحريك بسيط للمودال عند الظهور */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =============================================== */
/* Collapsible Sections */
/* =============================================== */

/* Style the buttons that are used to open and close the collapsible content */
.collapsible-section {
    margin-bottom: 20px;
}

.collapsible {
    background-color: var(--primary-color, #0073aa);
    color: white;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: right;
    outline: none;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Add a background color to the button when it's hovered over or open */
.collapsible:hover,
.collapsible.active {
    background-color: var(--primary-dark, #005177);
}

/* Add a plus/minus icon */
.collapsible:after {
    content: '\2b'; /* Unicode for a plus sign */
    font-size: 1.2rem;
    color: white;
    font-weight: bold;
    margin-left: 10px; /* Adjust spacing for RTL layout */
    float: left;
}

/* Change the plus sign to a minus sign when the button is active (open) */
.collapsible.active:after {
    content: "\2212"; /* Unicode for a minus sign */
}

/* Style the collapsible content */
.collapsible-content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out; /* Add transition for a smooth effect */
    background-color: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -15px; /* Adjust to sit flush with the button */
    padding-top: 20px;
    padding-bottom: 20px;
}


/* --- شكل التصفية علي الموبايل --- */
.collapsible-section-mobile {
    margin-bottom: 20px;
}

.collapsible-mobile {
    display: none; /* Hide button by default */
    width: 100%;
    padding: 12px 15px;
    background-color: var(--primary-color, #0073aa);
    color: white;
    text-align: right;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.collapsible-mobile:hover {
    background-color: var(--primary-dark, #005177);
}

.collapsible-content-mobile {
    /* Show content by default on desktop */
    display: block; 
    padding: 0;
    overflow: hidden;
    max-height: 1000px; /* Large value to allow full content display */
    transition: max-height 0.3s ease-out;
}

/* Media Query for Mobile Devices */
@media (max-width: 768px) {
    .collapsible-mobile {
        display: block; /* Show button on mobile */
    }

    .collapsible-content-mobile {
        max-height: 0; /* Hide content by default on mobile */
        transition: max-height 0.3s ease-out;
    }
    
    /* When the .hidden class is removed by JS, show the content. */
    .collapsible-content-mobile:not(.hidden) {
        max-height: 1000px;
        transition: max-height 0.3s ease-in;
    }
}
/* Style for the new delete button for admin tasks */
.delete-admin-task-btn {
    background-color: var(--danger-color);
    color: #fff;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.delete-admin-task-btn:hover {
    background-color: #c82333;
}

/* Ensure the buttons are aligned properly */
.admin-task-actions {
    display: flex;
    gap: 10px; /* Space between buttons */
    align-items: center;
}