﻿/* public/css/main.css - تم تنظيفه ليدعم تعدد اللغات بشكل أفضل */
/* public/css/main.css */

/* تنسيقات الـ Boxed Layout */
.boxed-layout {
    max-width: 1200px; /* أو أي عرض تفضله لتصميم الموقع المحصور */
    margin: 0 auto; /* توسيط المحتوى */
    background-color: #ffffff; /* خلفية بيضاء للمحتوى المحصور */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* ظل خفيف حول المحتوى */
    min-height: 100vh; /* لضمان أن الخلفية البيضاء تغطي كامل الارتفاع */
    display: flex;
    flex-direction: column;
}

body {
    background-color: #e9ecef; /* لون خلفية خارجي للموقع كله */
}

/* ... باقي التنسيقات الموجودة في main.css ... */

/* تأكد أن كل الأكواد التي قدمتها لك سابقاً في هذا الملف موجودة كما هي بعد هذا الكود */

/* مثال:
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}
... إلخ
*/
/* تنسيقات عامة للجسم والخطوط */
body {
    font-family: 'Arial', sans-serif; /* خط افتراضي */
    color: #333;
    background-color: #6d91b6; /* خلفية فاتحة للموقع */
    line-height: 1.6;
}

/* تنسيقات الشريط العلوي */
.top-bar {
    background-color: #343a40;
    color: #ffffff;
    font-size: 0.9em;
}
.top-bar .contact-info span,
.top-bar .social-links a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}
.top-bar .contact-info span {
    margin-right: 15px; /* هامش بين عناصر معلومات الاتصال */
}
.top-bar .social-links a {
    margin-left: 10px; /* هامش بين أيقونات التواصل الاجتماعي */
}
.top-bar .social-links a:hover {
    color: #007bff;
}
.top-bar .contact-info i {
    margin-right: 5px; /* هامش بين الأيقونة والنص */
}
/* تنسيقات مبدل اللغة */
.language-switcher .lang-btn {
    padding: 5px 8px;
    border: 1px solid #ffffff;
    border-radius: 5px;
    color: #ffffff;
    background-color: transparent;
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.language-switcher .lang-btn:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}
.language-switcher .lang-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: bold;
}

/* رأس الموقع وقائمة التنقل */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.navbar-brand {
    font-weight: bold;
    color: #333 !important;
}
.navbar-brand img {
    margin-left: 10px;
}
.navbar-nav .nav-item .nav-link {
    color: #555 !important;
    font-weight: 500;
    padding: 7px 11px;

}
.navbar-nav .nav-item .nav-link:hover,
.navbar-nav .nav-item.active .nav-link {
    color: #007bff !important;
    background-color: #e9f5ff; /* خلفية خفيفة للرابط النشط/المحوم عليه */
    border-radius: 5px;
}
/* تعديلات القائمة المنسدلة */
.dropdown-menu {
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: none;
}
.dropdown-item {
    padding: 10px 20px;
    color: #333;
}
.dropdown-item:hover {
    background-color: #007bff;
    color: white;
}

/* تنسيقات عامة للمحتوى */
.section-title {
    font-size: 2.2em;
    font-weight: bold;
    color: #343a40;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #007bff;
    margin-top: 10px;
    /* محاذاة في المنتصف */
    margin-left: auto;
    margin-right: auto;
}

/* تنسيقات البطاقات العامة */
.card {
    border: none;
    border-radius: 8px;
    overflow: hidden; /* لضمان عدم تجاوز الصور للحواف الدائرية */
}
.card-img-top {
    height: 180px;
    object-fit: cover;
}
.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #007bff;
    white-space: nowrap;
}
.card-text {
    font-size: 0.9em;
    color: #666;
}
.btn {
    border-radius: 5px;
}
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}
.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}
.btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
}
.alert {
    border-radius: 8px;
}

/* سلايدر الأخبار */
.news-slider-section .swiper-slide img {
    height: 350px; /* ارتفاع ثابت للسلايدر */
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-in-out;
}
.news-slider-section .swiper-slide.swiper-slide-active img {
    transform: scale(1.03);
}
.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 0 0 8px 8px;
}
.slider-caption h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
}
.slider-caption p {
    color: #eee;
    font-size: 0.9em;
    margin-bottom: 15px;
}
.swiper-pagination-bullet-active {
    background-color: #007bff !important;
}
.swiper-button-next, .swiper-button-prev {
    color: white !important;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 10px;
    width: 40px;
    height: 40px;
    top: 50%; /* توسيط عمودي */
    transform: translateY(-50%);
}

/* ركن أسماء في حياتنا (صور متقلبة) */
.names-in-lives-section .card-body {
    min-height: 280px; /* لضمان ارتفاع مناسب للبطاقة */
    position: relative;
    overflow: hidden;
}
.names-in-lives-section .rotating-image-item {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
    transition: opacity 0.5s ease-in-out; /* لتأثير التلاشي */
    text-decoration: none; /* إزالة خط تحت الرابط */
}
.names-in-lives-section .rotating-image-item img {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.names-in-lives-section .rotating-image-item h6 {
    color: #333; /* لون نص اسم الراحل */
    font-weight: bold;
    font-size: 1.1em;
}

/* شريط التنويهات المتناوبة */
.top-alert-banner {
    background-color: #e2f3fe; /* خلفية فاتحة للإشعارات */
    color: #004085; /* نص أزرق داكن */
    padding: 8px 0;
    overflow: hidden;
    position: relative;
    border-radius: 8px; /* حواف دائرية */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px; /* مسافة بين البانر وأول قسم */
    display: flex; /* لضمان توسيط المحتوى */
    justify-content: center;
    align-items: center;
    min-height: 50px; /* ارتفاع أدنى للبانر */
}
.top-alert-banner .alert {
    margin-bottom: 0 !important; /* إزالة هامش الـ alert الافتراضي */
    background-color: transparent !important; /* خلفية شفافة */
    border: none !important; /* إزالة الحدود */
    padding: 0 20px; /* مسافة داخلية */
    text-align: center;
    width: 100%;
    position: absolute; /* لجعلهم فوق بعض */
    top: 0;
    left: 0;
    height: 100%;
    display: flex; /* لتوسيط المحتوى داخل الـ alert */
    align-items: center;
    justify-content: center;
    opacity: 0; /* مخفي افتراضياً */
    transition: opacity 0.5s ease-in-out; /* تأثير التلاشي */
}
.top-alert-banner .alert.active {
    opacity: 1; /* إظهار النشط */
}
.top-alert-banner .alert .close {
    position: absolute;
    /* تعتمد على الاتجاه */
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    font-size: 1.5rem;
    color: inherit; /* ليكون نفس لون نص الإشعار */
}
html[dir=rtl] .top-alert-banner .alert .close {
    left: 10px; /* في RTL، زر الإغلاق على اليسار */
    right: auto;
}
html[dir=ltr] .top-alert-banner .alert .close {
    right: 10px; /* في LTR، زر الإغلاق على اليمين */
    left: auto;
}


/* بطاقات الأخبار الحديثة */
.news-card-hover {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.news-card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15) !important;
}
.news-snippet {
    height: 4.5em; /* تحديد ارتفاع لـ 3 أسطر تقريبا */
    overflow: hidden;
    line-height: 1.5em;
    text-overflow: ellipsis; /* إضافة نقاط لو النص طويل */
}

/* تنسيقات ركن الحارات */
.district-card {
    min-height: 300px; /* ارتفاع ثابت لبطاقة الحارة */
}
.district-card .card-body {
    padding: 15px;
}
.district-card .card-title {
    font-size: 1.3em;
}

/* استطلاع الرأي */
.poll-widget {
    min-height: 300px; /* ارتفاع ثابت لبطاقة الاستطلاع */
}
.poll-widget .progress {
    background-color: #e9ecef;
}

/* Responsive adjustments */
@media (max-width: 991.98px) { /* Medium devices (tablets) */
    .news-slider-section .swiper-slide img {
        height: 250px; /* تصغير ارتفاع السلايدر في التابلت */
    }
    .slider-caption {
        padding: 15px;
    }
    .slider-caption h3 {
        font-size: 1.2em;
    }
    .slider-caption p {
        font-size: 0.8em;
    }
    .names-in-lives-section .card-body {
        min-height: 250px;
    }
    .names-in-lives-section .rotating-image-item img {
        width: 100px;
        height: 100px;
    }
    .names-in-lives-section .rotating-image-item h6 {
        font-size: 1em;
    }
}

@media (max-width: 767.98px) { /* Small devices (phones) */
    .top-bar .d-flex {
        flex-direction: column; /* تكديس العناصر عمودياً */
        align-items: center;
    }
    .top-bar .contact-info,
    .top-bar .social-links,
    .top-bar .language-switcher {
        margin-bottom: 10px; /* مسافة بين العناصر المكدسة */
    }
    .news-slider-section .swiper-slide img {
        height: 200px; /* تصغير ارتفاع السلايدر في الجوال */
    }
    .slider-caption {
        padding: 10px;
    }
    .slider-caption h3 {
        font-size: 1.1em;
    }
    .slider-caption p {
        font-size: 0.8em;
        display: none; /* إخفاء الوصف في الشاشات الصغيرة جداً */
    }
    .news-card-hover {
        margin-bottom: 20px; /* مسافة بين البطاقات في الجوال */
    }
    .district-card {
        min-height: auto; /* إلغاء الارتفاع الثابت للسماح بالتكيف */
    }
    .poll-widget {
        min-height: auto;
    }
    /* عكس ترتيب الأعمدة في بعض الصفوف لـ RTL */
    html[dir=rtl] .row {
        flex-direction: column; /* جعل الأعمدة تتكدس عموديا في RTL في الجوال */
    }
}

@media (max-width: 575.98px) { /* Extra small devices */
    .site-header .navbar-brand img {
        height: 40px;
    }
    .navbar-brand {
        font-size: 1.1em;
    }
    .navbar-nav .nav-link {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    .top-bar {
        font-size: 0.8em;
    }
}