/* style.css - الثيم الأزرق والأبيض الجذاب والمصمم للهاتف */

/* -------------------- المتغيرات الأساسية -------------------- */
:root {
    --primary-blue: #007bff;     /* أزرق أساسي (للنقاط والأزرار النشطة) */
    --dark-blue: #004d99;        /* أزرق داكن (لخلفية الهيدر والقائمة الجانبية) */
    --light-gray: #f8f9fa;       /* خلفية فاتحة */
    --timeline-color: #ced4da;  /* لون الخط الزمني الرمادي الفاتح */
}

/* -------------------- إعداد Sticky Footer باستخدام Flexbox -------------------- */
html, body {
    height: 100%; /* ضروري لتطبيق الـ Flexbox */
}

body {
    background-color: var(--light-gray);
    font-family: 'Arial', sans-serif;
    color: #343a36;
    
    /* Sticky Footer Implementation */
    display: flex;
    flex-direction: column;
    
    /* **تعديل نهائي عالمي (لتصحيح التداخل):** حشو علوي لتعويض الشريط العاجل (40px) والهيدر (~50px) = 90px */
    padding-top: 90px;
}

/* -------------------- الهيدر والتنقل -------------------- */

.sticky-top {
    /* **التعديل الأول:** تأكيد التثبيت وجعله يبدأ أسفل الشريط العاجل */
    position: fixed !important;
    top: 40px; /* ليلتصق أسفل شريط الخبر العاجل (الذي ارتفاعه ~40px) */
    width: 100%;
    
    background-color: var(--dark-blue) !important;
    color: white;
    z-index: 1030; /* الهيدر يظل قوياً لكن أقل من الشريط */
}

/* **تنسيق الشعار النصي المُحدث (لون ذهبي جذاب ومُكبر)** */
.navbar-brand {
    font-size: 1.8rem !important; /* حجم أكبر */
    font-weight: 900;
    color: #FFD700 !important; /* لون ذهبي نقي */
    display: inline-block;
    letter-spacing: 1px;
    
    /* تأثير التوهج الذهبي */
    text-shadow: 
        0 0 5px #FFFFE0, /* توهج أبيض مصفر خفيف */
        0 0 10px #FFD700, /* توهج ذهبي متوسط */
        0 0 20px #FF8C00; /* توهج برتقالي داكن / نحاسي */
    
    /* الحركة البسيطة لجعلها أكثر جاذبية */
    animation: gold-glow 2s ease-in-out infinite alternate;
    /* إزالة تنسيقات التدرج اللوني القديمة */
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
}

@keyframes gold-glow {
    from {
        text-shadow: 0 0 5px #FFFFE0, 0 0 10px #FFD700;
        transform: scale(1);
    }
    to {
        text-shadow: 0 0 8px #FFFFE0, 0 0 15px #FFD700, 0 0 25px #FF8C00;
        transform: scale(1.02);
    }
}

/* تعديل لون أيقونة القائمة (الهمبرغر) إلى الأبيض */
.navbar-dark .navbar-toggler-icon {
    filter: invert(1) brightness(100%);
}

.btn-dark {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* -------------------- شريط التصنيفات (Tabs) -------------------- */

#category-tabs {
    white-space: nowrap; 
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px !important;
    background-color: var(--dark-blue);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#category-tabs .category-btn {
    margin: 0 4px;
    border-radius: 20px;
    flex-shrink: 0; 
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 6px 14px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: transparent;
}

#category-tabs .category-btn.active {
    background-color: white !important;
    border-color: white !important;
    color: var(--dark-blue); 
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* -------------------- القائمة الجانبية (Offcanvas) -------------------- */

.offcanvas {
    background-color: var(--dark-blue);
}

.offcanvas .offcanvas-title {
    color: white;
    font-weight: bold;
}

.offcanvas .btn-close {
    filter: invert(1);
}

/* تنسيق روابط القائمة الجانبية - محاكاة لأزرار التصنيفات */
.offcanvas .nav-link {
    color: white; 
    padding: 10px 15px;
    margin: 5px 0; 
    border-radius: 20px; 
    transition: background-color 0.2s, color 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2); 
    font-size: 1rem;
}

/* حالة الرابط عند التمرير أو النقر (Active/Hover) */
.offcanvas .nav-link:hover, 
.offcanvas .nav-link.active {
    background-color: white; 
    color: var(--dark-blue); 
    font-weight: bold;
    border-color: white; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); 
}

/* -------------------- الخبر العاجل (Fixed Top) -------------------- */

#breaking-news-bar {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    border-radius: 0;
    padding: 8px 15px;
    font-size: 0.95rem;
    cursor: pointer;
    
    /* **التثبيت:** يبقى في الأعلى */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1040 !important; /* أعلى من الهيدر */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); 
}

/* -------------------- قائمة الأخبار والتايم لاين -------------------- */

main {
    flex-grow: 1; 
    padding-bottom: 20px; 
}

.news-item {
    position: relative;
    padding-right: 25px; 
    padding-left: 10px;
    transition: background-color 0.2s;
}

.news-item:hover {
    cursor: pointer;
    background-color: #f1f1f1; 
}

/* الشريط الزمني (لشاشات العرض الكبيرة والمتوسطة فقط) */
.news-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background-color: var(--timeline-color);
}

/* النقطة الزرقاء على الشريط الزمني */
.news-item::before {
    content: '';
    position: absolute;
    right: -2px;
    top: 15px; 
    width: 10px;
    height: 10px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    z-index: 10;
    border: 2px solid var(--light-gray);
}

.news-item .text-secondary {
    color: #6c757d !important;
    font-size: 0.75rem;
}

.news-title {
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
}

.news-title-link {
    text-decoration: none;
    color: inherit;
}

.flex-shrink-0 {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flex-shrink-0 span {
    color: var(--primary-blue) !important;
    font-weight: bold;
    font-size: 0.8rem;
}

/* -------------------- تنسيق أزرار المشاركة داخل محتوى الخبر المفتوح -------------------- */
.share-buttons .btn-share {
    transition: all 0.3s;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 15px;
}

.share-buttons .btn-whatsapp { 
    background-color: #25d366; 
    border-color: #25d366; 
    color: white;
}
.share-buttons .btn-facebook { 
    background-color: #1877f2; 
    border-color: #1877f2; 
    color: white;
}
.share-buttons .btn-x { 
    background-color: #000000; 
    border-color: #000000; 
    color: white;
}
.share-buttons .btn-telegram { 
    background-color: #0088cc; 
    border-color: #0088cc; 
    color: white;
}
.share-buttons .btn-share:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* -------------------- شريط التذييل (Footer) المُحكم والمُحسن -------------------- */

footer {
    background-color: var(--dark-blue);
    color: #f8f9fa;
    border-top: 3px solid var(--primary-blue);
    padding-top: 10px; 
    padding-bottom: 10px;
    
    margin-top: 0 !important;
    width: 100%;
    flex-shrink: 0;
}

/* تنسيق حقوق النشر */
.copyright-text {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3px !important; 
}

/* تنسيق معلومات المصمم (القسم الجذاب والمميز) */
.designer-info {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 5px;
    margin-top: 0 !important;
}

/* تمييز اسم المصمم */
.designer-name {
    font-weight: 700;
    margin-right: 5px;
}

/* تنسيق أيقونة الواتساب */
.whatsapp-link {
    font-size: 1.3rem; 
    color: #25d366;
    margin-right: 10px;
    transition: transform 0.3s ease;
    text-decoration: none;
}

.whatsapp-link:hover {
    color: #128c7e;
    transform: scale(1.1);
}


/* -------------------- تحسين الأداء على شاشات الهاتف الصغيرة -------------------- */

@media (max-width: 576px) {
    /* تبسيط الشعار على أصغر الشاشات لتوفير موارد CPU/GPU */
    .navbar-brand {
        text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
        font-size: 1.3rem !important; /* حجم أقل قليلاً على الهاتف */
        animation: none; /* إيقاف الحركة على الهاتف */
    }
    
    /* إلغاء الشريط الزمني والنقاط على الهاتف (لأداء أفضل) */
    .news-item::after, 
    .news-item::before {
        display: none !important;
    }
    .news-item {
        padding-right: 15px !important;
    }
    .share-buttons .btn-share {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    /* تقليل حجم خط حقوق النشر في Footer على الهاتف */
    .designer-info {
        font-size: 0.9rem;
    }
    
    /* زيادة الحشو السفلي في main على الهاتف لمنع تداخل شريط الأخبار مع المحتوى */
    main {
        padding-bottom: 60px; 
    }
}