/* أنماط صفحة الإدارة */
.stats-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 15px;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.table th {
    background-color: #343a40;
    color: white;
    border: none;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

.btn-group .btn {
    margin-right: 2px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* تحسين مظهر الفلاتر */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* تحسين مظهر الجدول */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* تحسين مظهر الأزرار */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* أنماط خاصة لأزرار النماذج */
form button[type="submit"] {
    min-width: 120px;
    position: relative;
    transition: all 0.3s ease;
}

form button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

form button[type="submit"]:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

form button[type="submit"] .fa-spinner {
    margin-right: 5px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تحسين مظهر الحقول المعطلة */
.form-control:disabled,
.form-select:disabled {
    background-color: #e9ecef;
    opacity: 0.7;
    cursor: not-allowed;
}

/* تحسين مظهر رسائل الخطأ */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* تحسين مظهر الحقول التي تحتوي على أخطاء */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* تحسين مظهر الحقول الصحيحة */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* تحسين مظهر رسائل النجاح */
.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* تحسين مظهر البطاقات */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0 !important;
}

/* تحسين مظهر التقييم */
.text-warning .fas.fa-star {
    color: #ffc107 !important;
}

.text-warning .fas.fa-star-half-alt {
    color: #ffc107 !important;
}

.text-warning .far.fa-star {
    color: #e9ecef !important;
}

/* تحسين مظهر الصور */
.rounded-circle {
    object-fit: cover;
}

/* تحسين مظهر الترقييم */
.pagination {
    justify-content: center;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* تحسين مظهر البحث */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 40px;
}

.search-box .fas {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* تحسين مظهر الإحصائيات */
.stats-row {
    margin-bottom: 2rem;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card i {
    opacity: 0.8;
}

/* تحسين مظهر الفلاتر */
.filters-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.filters-section .row {
    align-items: center;
}

/* تحسين مظهر الأزرار */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* تحسين مظهر الجدول على الشاشات الصغيرة */
@media (max-width: 768px) {
    .stats-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 2px;
    }

    .filters-section .col-md-2 {
        margin-bottom: 1rem;
    }
}

/* تخصيص حجم أيقونات تعدد الصفحات */
.pagination {
    font-size: 0.875rem;
}

.pagination .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* تصغير حجم النص في معلومات التعدد */
.pagination-info {
    font-size: 0.8rem;
    color: #6c757d;
}

/* تخصيص حجم الأزرار في تعدد الصفحات */
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    padding: 0.375rem 0.75rem;
}

/* تحسين مظهر أزرار التنقل */
.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* أنماط صفحة الخريطة */
.page-title-box {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.page-title {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
}

.header-title {
    color: #333;
    font-weight: 600;
    margin: 0;
}

/* أنماط الخريطة */
#map {
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* أنماط النماذج */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.form-control, .form-select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* أنماط البطاقات */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
}

.card-header h4 {
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* أنماط الأزرار */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
}

.btn-outline-success {
    border-color: #28a745;
    color: #28a745;
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
}

.btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-outline-warning {
    border-color: #ffc107;
    color: #ffc107;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* أنماط الجداول */
.table {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0;
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table td {
    padding: 15px;
    vertical-align: middle;
    border-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* أنماط الشارات */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
    color: #212529 !important;
}

.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%) !important;
}

/* أنماط Modal */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
}

/* أنماط التنبيهات */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* أنماط النص المساعد */
.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .page-title-box {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* حل مشكلة تموضع المحتوى في صفحة الخريطة */
.container-fluid {
    padding: 0;
    margin: 0;
}

.main-content {
    padding: 20px;
    margin-left: 0;
    margin-right: 0;
}

/* تأكد من أن المحتوى لا يظهر فوق الهيدر */
.page-title-box {
    margin-top: 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

/* تأكد من أن البطاقات تظهر في المكان الصحيح */
.card {
    position: relative;
    z-index: 1;
}

/* تأكد من أن النماذج تظهر بشكل صحيح */
form {
    position: relative;
    z-index: 1;
}

/* تأكد من أن الجداول تظهر بشكل صحيح */
.table-responsive {
    position: relative;
    z-index: 1;
}

/* تأكد من أن Modal يظهر فوق كل شيء */
.modal {
    z-index: 9999;
}

/* تأكد من أن الشريط الجانبي يظهر بشكل صحيح */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

/* تأكد من أن المحتوى الرئيسي لا يتداخل مع الشريط الجانبي */
.col-md-9.col-lg-10 {
    margin-right: 0;
    padding-right: 0;
}

/* تأكد من أن الهيدر يظهر بشكل صحيح */
.navbar {
    position: relative;
    z-index: 1001;
}

/* تأكد من أن المحتوى يبدأ بعد الهيدر */
.main-content {
    padding-top: 20px;
}

/* تأكد من أن الصفوف تظهر بشكل صحيح */
.row {
    margin-left: 0;
    margin-right: 0;
}

/* تأكد من أن الأعمدة تظهر بشكل صحيح */
.col-12, .col-lg-4, .col-lg-8 {
    padding-left: 15px;
    padding-right: 15px;
}

/* ضمان ظهور الخريطة */
#map {
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 400px;
    width: 100%;
    background-color: #f8f9fa;
    position: relative;
}

#map .mapboxgl-canvas {
    border-radius: 10px;
}

#map .mapboxgl-ctrl-top-right {
    top: 10px;
    right: 10px;
}

#map .mapboxgl-ctrl-top-left {
    top: 10px;
    left: 10px;
}

/* تحسين مظهر رسائل الخطأ في الخريطة */
#map .alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* تحسين مظهر رسائل التحميل */
#map .alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* تحسين مظهر رسائل الخطأ */
#map .alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
