/**
 * ISSM — نظام الإدارة المشتركة — الأنماط المخصصة
 * المدارس الدولية في بنغازي
 */

/* ==========================================
   الخط العربي — Cairo
   ========================================== */
* {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ==========================================
   خلفية صفحة المصادقة
   ========================================== */
.auth-page.bg-gradient-primary {
    background: linear-gradient(135deg, #1a5276 0%, #2c3e50 50%, #1a5276 100%);
    min-height: 100vh;
}

/* ==========================================
   القائمة الجانبية
   ========================================== */
.sidebar-wrapper {
    min-height: 100vh;
    width: 260px;
    min-width: 260px;
    transition: margin 0.3s ease-in-out, width 0.3s ease-in-out;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-wrapper .list-group-item {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 0 !important;
    transition: all 0.2s;
}

.sidebar-wrapper .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    padding-right: 25px;
}

.sidebar-wrapper .list-group-item.active-nav {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-right: 3px solid #17a2b8;
    font-weight: 600;
}

.sidebar-section-title {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.72rem !important;
}

/* إخفاء القائمة على الشاشات الصغيرة */
@media (max-width: 768px) {
    .sidebar-wrapper {
        margin-right: -260px;
        position: fixed;
        z-index: 1050;
    }
    .sidebar-wrapper.show {
        margin-right: 0;
    }
    #page-content-wrapper {
        width: 100%;
    }
}

/* ==========================================
   التخطيط الرئيسي — Wrapper + Sticky Footer
   ========================================== */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

#page-content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
    width: 0; /* يمنع المحتوى من دفع العرض */
    overflow-x: hidden;
}

#page-content-wrapper > main {
    flex: 1 0 auto;
}

#page-content-wrapper > footer {
    flex-shrink: 0;
}

/* ==========================================
   الشريط العلوي
   ========================================== */
.navbar {
    z-index: 1000;
    position: sticky;
    top: 0;
}

/* ==========================================
   البطاقات
   ========================================== */
.card {
    border-radius: 12px !important;
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid #eee;
}

/* ==========================================
   الجداول
   ========================================== */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    color: #495057;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ==========================================
   الأزرار
   ========================================== */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 0 8px 8px 0;
}

.btn-group .btn:last-child {
    border-radius: 8px 0 0 8px;
}

/* ==========================================
   الشارات (Badges)
   ========================================== */
.badge {
    font-weight: 500;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ==========================================
   النماذج
   ========================================== */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: #dee2e6;
    padding: 8px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: #1a5276;
    box-shadow: 0 0 0 0.15rem rgba(26, 82, 118, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

/* ==========================================
   رسائل التنبيه
   ========================================== */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
}

/* ==========================================
   الترقيم
   ========================================== */
.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    color: #1a5276;
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #1a5276;
    border-color: #1a5276;
}

/* ==========================================
   الإسقاطات والقوائم المنسدلة
   ========================================== */
.dropdown-menu {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* ==========================================
   مجموعة القوائم
   ========================================== */
.list-group-item {
    border-color: #f0f0f0;
}

/* ==========================================
   شريط التمرير المخصص
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==========================================
   متنوعات
   ========================================== */
.opacity-50 {
    opacity: 0.5;
}

.rounded-3 {
    border-radius: 12px !important;
}

/* مؤشر الانتظار */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* الإشعار غير المقروء */
.bg-light {
    background-color: #f0f4ff !important;
}

/* تحسين حقول LTR في واجهة RTL */
input[dir="ltr"],
code {
    direction: ltr;
    text-align: left;
}

/* ==========================================
   طباعة
   ========================================== */
@media print {
    .sidebar-wrapper,
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    #page-content-wrapper {
        width: 100%;
    }
}
