/* أحوال الطرق - التصميم الرئيسي */

/* خط القاهرة */
* {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* الحاوي الرئيسي */
.road-conditions-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8f5e8 100%);
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* رأس الصفحة */
.road-conditions-header {
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,96,100,0.25);
    position: relative;
    overflow: hidden;
}

.road-conditions-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="40" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
}

.main-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
}

.last-update {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.update-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.update-date {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.update-separator {
    font-weight: 300;
    font-size: 1.5rem;
    opacity: 0.7;
}

.update-time {
    font-size: 1rem;
    font-weight: 500;
}

/* قسم البحث والتصفية */
.search-filter-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #e1e8ed;
}

/* مربع البحث */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

#region-search {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#region-search:focus {
    border-color: #006064;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 96, 100, 0.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

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

.suggestion-item:last-child {
    border-bottom: none;
}

/* رسائل البحث */
.no-suggestions {
    padding: 12px 20px;
    color: #666;
    font-style: italic;
    text-align: center;
    background-color: #f8f9fa;
}

.search-results-message {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* أزرار التصفية - تصميم عصري */
.filter-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* زر "كل المحافظات" - يبقى بالتصميم الأصلي */
.filter-btn[data-filter="all"] {
    padding: 15px 25px;
    border: none;
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 96, 100, 0.3);
    margin-bottom: 10px;
}

.filter-btn[data-filter="all"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 96, 100, 0.4);
    background: linear-gradient(135deg, #00838f 0%, #006064 100%);
}

.filter-btn[data-filter="all"].active {
    background: linear-gradient(135deg, #004d40 0%, #00695c 100%);
    box-shadow: 0 6px 20px rgba(0, 77, 64, 0.5);
}

/* أزرار المحافظات - تصميم مربعات عصري */
.filter-btn[data-filter="north"],
.filter-btn[data-filter="center"],
.filter-btn[data-filter="south"] {
    position: relative;
    border: none;
    border-radius: 16px;
    min-height: 80px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* تأثير الخلفية المتحركة */
.filter-btn[data-filter="north"]::before,
.filter-btn[data-filter="center"]::before,
.filter-btn[data-filter="south"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 1;
}

.filter-btn[data-filter="north"]:hover::before,
.filter-btn[data-filter="center"]:hover::before,
.filter-btn[data-filter="south"]:hover::before {
    transform: translateX(100%);
}

/* ألوان مميزة لكل محافظة */
.filter-btn[data-filter="north"] {
    background: linear-gradient(135deg, #2196f3 0%, #64b5f6 100%);
    color: white;
}

.filter-btn[data-filter="center"] {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
}

.filter-btn[data-filter="south"] {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    color: white;
}

/* تأثيرات الـ hover */
.filter-btn[data-filter="north"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
}

.filter-btn[data-filter="center"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);
}

.filter-btn[data-filter="south"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #388e3c 0%, #66bb6a 100%);
}

/* حالة النشط */
.filter-btn[data-filter="north"].active {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.5);
    transform: translateY(-2px);
}

.filter-btn[data-filter="center"].active {
    background: linear-gradient(135deg, #ef6c00 0%, #f57c00 100%);
    box-shadow: 0 6px 20px rgba(239, 108, 0, 0.5);
    transform: translateY(-2px);
}

.filter-btn[data-filter="south"].active {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.5);
    transform: translateY(-2px);
}

/* الأيقونات */
.filter-btn[data-filter="north"] i,
.filter-btn[data-filter="center"] i,
.filter-btn[data-filter="south"] i {
    font-size: 1.8rem;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* النصوص */
.filter-btn[data-filter="north"] span,
.filter-btn[data-filter="center"] span,
.filter-btn[data-filter="south"] span {
    font-size: 0.95rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover {
    border-color: #006064;
    color: #006064;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 96, 100, 0.2);
}

.filter-btn.active {
    background: #006064;
    border-color: #006064;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 96, 100, 0.3);
}

.filter-btn i {
    font-size: 1.1rem;
}

/* مكان الإعلانات */
.ads-container {
    margin: 20px 0;
    text-align: center;
    border-radius: 10px;
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.ads-container:empty {
    display: none !important;
}

.ads-container:not(:empty) {
    display: block;
    margin: 20px 0;
}

/* عرض مكان الإعلانات في لوحة التحكم فقط */
.admin-page-road-conditions .ads-container:empty {
    display: flex;
    min-height: 50px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.admin-page-road-conditions .ads-container:empty::before {
    content: "مكان مخصص للإعلانات - أضف كود الإعلانات من الإعدادات";
    opacity: 0.7;
}

.advertisement-wrapper {
    max-width: 100%;
    overflow: hidden;
}

/* إعلانات AdSense */
.adsense-ad {
    margin: 0 auto;
    max-width: 100%;
}

/* إعلانات الصور */
.image-ad {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.ad-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ad-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* إعلانات مخصصة */
.custom-ad {
    margin: 0 auto;
    max-width: 100%;
}

/* تجاوب الإعلانات */
@media (max-width: 768px) {
    .ads-container {
        margin: 15px 0;
        padding: 10px;
    }

    .ad-image {
        border-radius: 5px;
    }
}

/* جدول أحوال الطرق */
.conditions-table-wrapper {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 96, 100, 0.15);
    border: 1px solid #e0f2f1;
    position: relative;
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
}

.conditions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2rem;
    table-layout: auto;
    min-width: 100%;
}

.conditions-table th {
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: white;
    padding: 18px 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    width: auto;
}

.conditions-table th:nth-child(1) { width: 33.33%; text-align: right; }
.conditions-table th:nth-child(2) { width: 33.33%; text-align: center; }
.conditions-table th:nth-child(3) { width: 33.33%; text-align: center; }

.conditions-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* تلوين صفوف الجدول حسب الحالة */
.condition-row.status-open {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-left: 4px solid #4caf50;
}

.condition-row.status-traffic {
    background: linear-gradient(135deg, #fff8e1 0%, #fffbf0 100%);
    border-left: 4px solid #ff9800;
}

.condition-row.status-closed {
    background: linear-gradient(135deg, #ffebee 0%, #fdf2f2 100%);
    border-left: 4px solid #f44336;
}

.condition-row.status-checkpoint {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-left: 4px solid #2196f3;
}

.condition-row.status-warning {
    background: linear-gradient(135deg, #fce4ec 0%, #fef7f7 100%);
    border-left: 4px solid #e91e63;
}

.condition-row.status-accident {
    background: linear-gradient(135deg, #f3e5f5 0%, #faf8fb 100%);
    border-left: 4px solid #9c27b0;
}

.condition-row.status-police {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-left: 4px solid #4caf50;
}

.condition-row.status-unknown {
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border-left: 4px solid #9e9e9e;
}

.condition-row:hover {
    cursor: pointer;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 96, 100, 0.15);
    filter: brightness(0.98);
}

.condition-row.active {
    border-left: 4px solid #006064;
    box-shadow: 0 4px 12px rgba(0, 96, 100, 0.2);
}

/* صفوف التفاصيل المخفية */
.details-row {
    background-color: #f8f9fa;
    border-top: none !important;
}

.details-content {
    padding: 20px !important;
    border-top: 1px solid #e1e8ed;
}

.region-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-details,
.custom-details {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.status-details {
    background: #e0f7fa;
    border-left: 4px solid #006064;
    color: #004d40;
}

.custom-details {
    background: #f1f8e9;
    border-left: 4px solid #388e3c;
    color: #1b5e20;
}

.region-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.region-actions .btn-report {
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* تأثير الانتقال للصفوف */
.details-row {
    transition: all 0.3s ease;
}

.details-row.show {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.region-name {
    font-weight: 600;
}

.region-link {
    background: none;
    border: none;
    color: #006064;
    cursor: pointer;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: underline;
    padding: 0;
    transition: all 0.3s ease;
    text-align: right;
    width: 100%;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.region-link:hover {
    color: #00838f;
    text-decoration: none;
}

/* شارات الحالة */
.status-badge {
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.status-open {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    color: #004d40;
    border: 1px solid #4db6ac;
}

/* الأيقونات تُضاف الآن من PHP مباشرة */

.status-traffic {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    color: #e65100;
    border: 1px solid #ffb74d;
}

.status-closed {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #b71c1c;
    border: 1px solid #e57373;
}

.status-checkpoint {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #0d47a1;
    border: 1px solid #42a5f5;
}

.status-warning {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #880e4f;
    border: 1px solid #f06292;
}

.status-accident {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #4a148c;
    border: 1px solid #ba68c8;
}

.status-police {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #1b5e20;
    border: 1px solid #4caf50;
}

.status-unknown {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    color: #424242;
    border: 1px solid #bdbdbd;
}

/* تفاصيل الحالة */
.status-details {
    font-size: 0.9rem;
    color: #6c757d;
    display: block;
    margin-bottom: 5px;
}

.custom-details {
    font-size: 0.85rem;
    color: #495057;
    font-style: italic;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: 5px;
}

/* أزرار الإجراءات */
.actions-cell {
    text-align: center;
}

.btn-report {
    background: #006064;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-report:hover {
    background: #00838f;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 96, 100, 0.3);
}

/* أزرار الإجراءات - التبليغ والتحديث */
.action-buttons-section {
    text-align: center;
    margin: 25px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.main-report-btn,
.refresh-btn {
    border: none;
    padding: 14px 28px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    min-height: 50px;
    text-decoration: none;
}

/* تأثير الخلفية المتحركة للأزرار */
.main-report-btn::before,
.refresh-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 1;
}

.main-report-btn:hover::before,
.refresh-btn:hover::before {
    transform: translateX(100%);
}

/* زر التبليغ - يبقى بشكل مستطيل مدور (كبسولة) */
.main-report-btn {
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: white;
}

/* زر التحديث */
.refresh-btn {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.main-report-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 96, 100, 0.4);
    background: linear-gradient(135deg, #00838f 0%, #006064 100%);
}

.refresh-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
}

.main-report-btn i,
.refresh-btn i {
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.main-report-btn span,
.refresh-btn span {
    position: relative;
    z-index: 2;
}

/* تأثير دوران لأيقونة التحديث */
.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* النوافذ المنبثقة */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255,255,255,0.2);
}

/* نموذج التبليغ */
.report-form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #006064;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 96, 100, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* مربع البحث في النموذج */
.region-search-container {
    position: relative;
}

#region-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

#region-search-input:focus {
    outline: none;
    border-color: #006064;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 96, 100, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 600;
    color: #495057;
}

.search-result-area {
    font-size: 0.9rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.btn-submit {
    background: #006064;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #00838f;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 96, 100, 0.3);
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* سجل التحديثات */
.history-content {
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.region-history h4 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.no-history {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-time {
    font-size: 0.9rem;
    color: #6c757d;
}

.unverified-badge {
    background: #ffc107;
    color: #212529;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.history-details,
.history-custom {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #495057;
}

.history-custom {
    background: white;
    padding: 8px 12px;
    border-radius: 5px;
    border-left: 3px solid #006064;
}

/* التحديثات المدمجة */
.region-history-header h4 {
    margin: 0 0 15px 0;
    color: #006064;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #e0f2f1;
    padding-bottom: 10px;
}

.compact-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.compact-history-item {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.compact-history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 96, 100, 0.1);
}

/* قسم التقييم */
.rating-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.rating-stats {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
}

.rating-correct {
    color: #28a745;
    font-weight: bold;
}

.rating-incorrect {
    color: #dc3545;
    font-weight: bold;
}

.rating-buttons {
    display: flex;
    gap: 5px;
}

.rating-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.correct-btn {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.correct-btn:hover {
    background: #c3e6cb;
    transform: translateY(-1px);
}

.incorrect-btn {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.incorrect-btn:hover {
    background: #f5c6cb;
    transform: translateY(-1px);
}

.rating-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rating-btn.rated {
    background: #006064;
    color: white;
    border-color: #006064;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-details-compact {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.4;
}

.details-text {
    display: block;
    margin-bottom: 4px;
    color: #006064;
    font-weight: 500;
}

.custom-text {
    display: block;
    font-style: italic;
    color: #6c757d;
}

.no-history {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.error {
    text-align: center;
    color: #dc3545;
    padding: 20px;
}

.history-actions {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
}

.btn-update-status {
    background: #006064;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-update-status:hover {
    background: #00838f;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 96, 100, 0.3);
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .road-conditions-wrapper {
        padding: 10px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .update-info {
        flex-direction: column;
        gap: 8px;
    }

    .update-separator {
        display: none;
    }

    .update-date {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    /* أزرار التصفية للجوال - تصميم محسن */
    .filter-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        max-width: 320px;
        padding: 0 5px;
    }

    /* زر "كل المحافظات" يأخذ العرض الكامل */
    .filter-btn[data-filter="all"] {
        grid-column: 1 / -1;
        padding: 10px 15px;
        font-size: 0.95rem;
        margin-bottom: 3px;
        min-height: 45px;
    }

    /* أزرار المحافظات في الجوال */
    .filter-btn[data-filter="north"],
    .filter-btn[data-filter="center"],
    .filter-btn[data-filter="south"] {
        min-height: 65px;
        padding: 12px 8px;
        border-radius: 12px;
    }

    /* زر الجنوب يأخذ العرض الكامل */
    .filter-btn[data-filter="south"] {
        grid-column: 1 / -1;
    }

    .filter-btn[data-filter="north"] i,
    .filter-btn[data-filter="center"] i,
    .filter-btn[data-filter="south"] i {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }

    .filter-btn[data-filter="north"] span,
    .filter-btn[data-filter="center"] span,
    .filter-btn[data-filter="south"] span {
        font-size: 0.8rem;
    }

    /* تقليل التأثيرات في الجوال لتحسين الأداء */
    .filter-btn[data-filter="north"]:hover,
    .filter-btn[data-filter="center"]:hover,
    .filter-btn[data-filter="south"]:hover {
        transform: translateY(-1px) scale(1.01);
    }
}

/* تصميم للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .filter-buttons {
        grid-template-columns: 1fr;
        gap: 6px;
        max-width: 280px;
    }

    .filter-btn[data-filter="all"] {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 40px;
    }

    .filter-btn[data-filter="north"],
    .filter-btn[data-filter="center"],
    .filter-btn[data-filter="south"] {
        grid-column: 1;
        min-height: 55px;
        padding: 10px 6px;
        border-radius: 10px;
    }

    .filter-btn[data-filter="north"] i,
    .filter-btn[data-filter="center"] i,
    .filter-btn[data-filter="south"] i {
        font-size: 1.2rem;
    }

    .filter-btn[data-filter="north"] span,
    .filter-btn[data-filter="center"] span,
    .filter-btn[data-filter="south"] span {
        font-size: 0.75rem;
    }
    }

    /* تحسين الجدول للجوال */
    .conditions-table-wrapper {
        margin: 0 -10px;
        border-radius: 10px;
        max-width: calc(100vw - 20px);
        overflow: hidden;
    }

    .conditions-table {
        font-size: 0.95rem;
        width: 100%;
        table-layout: fixed;
    }

    .conditions-table th,
    .conditions-table td {
        padding: 8px 4px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* تحديد عرض الأعمدة للجوال */
    .conditions-table th:nth-child(1),
    .conditions-table td:nth-child(1) {
        width: 33.33%;
        text-align: right;
    }

    .conditions-table th:nth-child(2),
    .conditions-table td:nth-child(2) {
        width: 33.33%;
        text-align: center;
    }

    .conditions-table th:nth-child(3),
    .conditions-table td:nth-child(3) {
        width: 33.33%;
        text-align: center;
        font-size: 0.85rem;
    }

    /* تحسين أسماء المناطق */
    .region-link {
        font-size: 0.85rem;
        line-height: 1.2;
        display: block;
        text-align: right;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* تحسين شارات الحالة */
    .status-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-width: auto;
        border-radius: 15px;
    }

    /* تحسين التفاصيل */
    .region-details {
        gap: 8px;
    }

    .status-details,
    .custom-details {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .region-actions .btn-report {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .main-report-btn,
    .refresh-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .action-buttons-section {
        gap: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-submit,
    .btn-cancel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .road-conditions-wrapper {
        padding: 5px;
    }

    .road-conditions-header {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .search-filter-section {
        padding: 10px;
    }

    .filter-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .filter-btn {
        width: 100%;
        padding: 8px;
        font-size: 0.8rem;
    }

    /* جدول مضغوط للشاشات الصغيرة جداً */
    .conditions-table-wrapper {
        margin: 0 -5px;
        max-width: calc(100vw - 10px);
        overflow: hidden;
    }

    .conditions-table {
        font-size: 0.85rem;
    }

    .conditions-table th,
    .conditions-table td {
        padding: 6px 2px;
    }

    /* أعمدة متساوية للشاشات الصغيرة */
    .conditions-table th:nth-child(1),
    .conditions-table td:nth-child(1) {
        width: 33.33%;
    }

    .conditions-table th:nth-child(2),
    .conditions-table td:nth-child(2) {
        width: 33.33%;
    }

    .conditions-table th:nth-child(3),
    .conditions-table td:nth-child(3) {
        width: 33.33%;
        font-size: 0.8rem;
    }

    .region-link {
        font-size: 0.75rem;
        line-height: 1.1;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .status-badge {
        padding: 2px 6px;
        font-size: 0.7rem;
        border-radius: 10px;
    }

    .main-report-btn span,
    .refresh-btn span {
        display: none;
    }

    .main-report-btn,
    .refresh-btn {
        padding: 10px;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        justify-content: center;
    }

    .action-buttons-section {
        gap: 8px;
    }

    .compact-history-list {
        max-height: 150px;
    }

    .compact-history-item {
        padding: 8px;
    }

    .search-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 10px;
    }

    .modal-content {
        width: 98%;
        margin: 2% auto;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* منع التكبير في iOS */
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 360px) {
    .road-conditions-wrapper {
        padding: 2px;
    }

    .road-conditions-header {
        padding: 15px 10px;
        margin-bottom: 10px;
    }

    .main-title {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    .conditions-table-wrapper {
        margin: 0 -2px;
        border-radius: 8px;
        max-width: calc(100vw - 4px);
        overflow: hidden;
    }

    .conditions-table {
        font-size: 0.8rem;
    }

    .conditions-table th,
    .conditions-table td {
        padding: 4px 1px;
    }

    .conditions-table th:nth-child(1),
    .conditions-table td:nth-child(1) {
        width: 33.33%;
        padding-right: 3px;
    }

    .conditions-table th:nth-child(2),
    .conditions-table td:nth-child(2) {
        width: 33.33%;
    }

    .conditions-table th:nth-child(3),
    .conditions-table td:nth-child(3) {
        width: 33.33%;
        font-size: 0.75rem;
        padding-left: 1px;
    }

    .region-link {
        font-size: 0.7rem;
        line-height: 1.1;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .status-badge {
        padding: 1px 4px;
        font-size: 0.65rem;
        border-radius: 8px;
        min-width: auto;
    }

    .filter-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .main-report-btn,
    .refresh-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
}

/* تحسينات إضافية */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسينات الطباعة */
@media print {
    .main-report-btn,
    .refresh-btn,
    .search-filter-section,
    .action-buttons-section {
        display: none !important;
    }
    
    .road-conditions-wrapper {
        max-width: none;
        padding: 0;
    }
    
    .conditions-table {
        font-size: 12px;
    }
}
