/* ===================================
   ملف التنسيقات الرئيسي
   Main Stylesheet
   =================================== */

/* الخطوط العربية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

* {
    font-family: 'Cairo', sans-serif;
}

body {
    background: #f5f7fa;
    direction: rtl;
    text-align: right;
}

/* تنسيقات Select2 */
.select2-container--bootstrap-5 .select2-selection {
    font-size: 14px;
    min-height: 31px;
    padding: 2px 10px;
    border: 2px solid #e0e6ed !important;
    border-radius: 10px !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15) !important;
}

.select2-selection__rendered {
    line-height: 27px !important;
    padding-right: 0 !important;
}

/* تحسين شكل الهيدر */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-weight: 700;
    font-size: 26px;
    margin: 0;
}

.app-header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* قسم الفلاتر */
.filters-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.filters-section h5 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-select,
.form-control {
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    padding: 10px 15px;
    transition: all 0.3s;
}

.form-select:focus,
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

/* أزرار */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
    border: 2px solid #e0e6ed;
    color: #4a5568;
}

.btn-outline-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
}

/* قسم النتائج */
.results-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* جدول النتائج */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #e0e6ed;
}

.table tbody tr:hover {
    background: #f7fafc;
}

.phone-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.phone-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* كروت النتائج (للموبايل) */
.provider-card {
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.provider-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.15);
}

.provider-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e6ed;
}

.provider-name {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.provider-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.provider-info {
    margin-bottom: 10px;
}

.provider-info-label {
    font-weight: 600;
    color: #4a5568;
    display: inline-block;
    min-width: 80px;
}

.provider-info-value {
    color: #2d3748;
}

.provider-phones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.phone-button {
    flex: 1;
    min-width: 140px;
}

/* حالة التحميل */
.loading-spinner {
    text-align: center;
    padding: 50px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* رسالة فارغة */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 18px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 24px;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .export-buttons {
        justify-content: stretch;
    }

    .export-buttons .btn {
        flex: 1;
    }

    .table-responsive {
        display: none;
    }

    .provider-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .provider-type {
        align-self: flex-start;
    }
}

@media (min-width: 769px) {
    .cards-view {
        display: none;
    }
}

/* تحسينات PWA */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1000;
}

.install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* تحسينات الطباعة */
@media print {

    .filters-section,
    .export-buttons,
    .app-header,
    .btn {
        display: none !important;
    }

    .results-section {
        box-shadow: none;
    }
}