﻿:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* =======================
   Base
======================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding-top: 56px; /* ارتفاع navbar */
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    z-index: 1040;
}

/* =======================
   Sidebar (Overlay - RTL)
======================= */
#sidebar {
    position: fixed;
    top: 56px;
    right: -280px; /* مخفي خارج الشاشة */
    width: 260px;
    height: calc(100vh - 56px);
    background-color: #ffffff;
    box-shadow: -6px 0 15px rgba(0,0,0,.2);
    overflow-y: auto; /* مهم */
    padding: 15px;
    transition: right 0.35s ease;
    z-index: 1045;
}

    /* عند الفتح */
    #sidebar.open {
        right: 0;
    }

/* عناصر القائمة */
.sidebar .nav-link {
    color: #333;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    transition: background-color 0.25s ease;
}

    .sidebar .nav-link:hover {
        background-color: #f1f3f5;
        color: var(--primary-color);
    }

    .sidebar .nav-link.active {
        background-color: var(--primary-color);
        color: #fff;
    }

    .sidebar .nav-link i {
        width: 22px;
        margin-left: 10px;
    }

/* =======================
   Main Content (ثابت)
======================= */

.main-content {
    width: 100%;
    padding: 20px;
    margin-top: 38px; /* إزاحة المحتوى تحت زر إظهار القائمة */
}

/* =======================
   Toggle Bar (Full Width)
======================= */
#sidebarToggle {
    position: fixed;
    top: 56px; /* أسفل navbar */
    left: 0;
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: #ffffff; /* اللون الأساسي */
    border-bottom: 1px solid #ddd;
    transition: background-color 0.25s ease, transform 0.3s ease;
    z-index: 1035; /* أقل من navbar */
    user-select: none; /* منع تحديد النص عند الضغط */
    border-radius: 0; /* بدون زوايا */
}

    #sidebarToggle:hover {
        background-color: #f0f2f5; /* لون خفيف عند التحويم */
    }

    #sidebarToggle:active {
        background-color: #e1e5eb; /* لون ناعم عند الضغط */
    }

    #sidebarToggle i {
        font-size: 1.4rem;
        color: var(--primary-color);
        transition: transform 0.3s ease, color 0.25s ease;
    }

    #sidebarToggle.active i {
        transform: rotate(180deg);
    }


/* =======================
   Backdrop
======================= */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1040;
    display: none;
}

    .sidebar-backdrop.show {
        display: block;
    }

/* =======================
   Cards
======================= */
.card {
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: bold;
}

/* =======================
   Notifications
======================= */
.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

    .notification-item.unread {
        background-color: #e3f2fd;
    }

.badge-notification {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
}

.notification-link {
    display: block;
    padding: 8px 16px;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
}

    .notification-link:hover {
        background-color: #f1f1f1;
    }

/* =======================
   Loading Spinner
======================= */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* =======================
   Scrollbar (Sidebar)
======================= */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
}

/* =======================
   Print
======================= */
.print-only {
    display: none;
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background-color: #fff;
    }
}
