/* * ScoreTank Header Styles - v3.0 (Modern & Dark Mode Fix) */

:root {
    --header-bg: #ffffff;
    --header-text: #333333;
    --topbar-bg: #1a1a1a;
    --topbar-text: #eeeeee;
    --main-nav-bg: #ffffff;
    --main-nav-text: #222222;
    --main-nav-hover: #0088ff;
    --border-color: #f0f0f0;
    --ticker-title-bg: #ff3e3e;
    --shadow-light: 0 5px 20px rgba(0,0,0,0.05);
}

/* =========================================
   1. General & Reset
   ========================================= */
.theme-header {
    direction: rtl;
    text-align: right;
    background-color: var(--header-bg);
    position: relative;
    z-index: 999;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
}

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
img { max-width: 100%; height: auto; }

/* =========================================
   2. Top Bar (الشريط العلوي)
   ========================================= */
#top-nav {
    background-color: var(--topbar-bg);
    color: var(--topbar-text);
    height: 40px;
    line-height: 40px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
#top-nav a { color: inherit; text-decoration: none; transition: 0.3s; }
#top-nav a:hover { color: #fff; }

/* اليمين: شريط الأخبار */
.top-area-right { flex-grow: 1; overflow: hidden; padding-left: 20px; }

/* تصميم عصري لشريط الأخبار (مثل جنة) */
.breaking-news-outer { display: flex; align-items: center; width: 100%; height: 40px; }

.breaking-title {
    background-color: var(--ticker-title-bg);
    color: #fff;
    padding: 0 15px;
    font-size: 12px;
    font-weight: bold;
    height: 40px; /* ملء الارتفاع */
    line-height: 40px;
    margin-left: 15px;
    position: relative;
    display: flex; align-items: center; gap: 5px;
    margin-left: 15px; /* مسافة بين العنوان والأخبار */
    padding: 0 15px;
}

.breaking-title i { margin-left: 5px; } /* مسافة بين الأيقونة وكلمة عاجل */

/* التأثير المائل للعنوان */
.breaking-title:after {
    content: '';
    position: absolute;
    left: -10px; top: 0;
    width: 0; height: 0;
    border-top: 40px solid var(--ticker-title-bg);
    border-left: 10px solid transparent;
}

.breaking-news-content { flex-grow: 1; height: 40px; position: relative; overflow: hidden; }
.breaking-news-content ul { margin: 0; padding: 0; list-style: none; height: 40px; }

.breaking-news-content { 
    flex-grow: 1; 
    height: 40px; 
    position: relative; 
    overflow: hidden; /* ضروري جداً لقص النص أثناء الانزلاق */
}

/* تحديث عناصر القائمة */
.breaking-news-content li {
    display: none; 
    position: absolute; /* ضروري للانزلاق */
    top: 0; 
    right: 0; 
    width: 100%;
    line-height: 40px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* العنصر النشط */
.breaking-news-content li.active { display: block; }

.breaking-news-content li a { color: #fff; font-weight: 500; font-size: 13px; }

/* اليسار: الأيقونات */
.top-area-left { display: flex; gap: 20px; align-items: center; }

/* تنسيق الأيقونات */
.tie-icon-calendar:before { content: "\f073"; font-family: "Font Awesome 5 Free"; font-weight: 900; margin-left: 5px; }
.tie-icon-moon:before { content: "\f186"; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.tie-icon-search:before { content: "\f002"; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.tie-icon-home:before { content: "\f015"; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.tie-icon-bolt:before { content: "\f0e7"; font-family: "Font Awesome 5 Free"; font-weight: 900; }

.social-component ul { margin: 0; padding: 0; list-style: none; display: flex; gap: 10px; }
.social-component a svg { fill: #cccccc; width: 14px; height: 14px; transition: 0.3s; vertical-align: middle; }
.social-component a:hover svg { fill: #ffffff; }

.skin-switcher-component a { font-size: 15px; color: #ccc; cursor: pointer; transition: 0.3s; }
.skin-switcher-component a:hover { color: #fff; }


/* =========================================
   3. Header Content (Logo & Ads) - Fix Dark Mode
   ========================================= */
.header-content-wrapper {
    background-color: var(--header-bg); /* هذا المتغير يتغير في الوضع الليلي */
    padding: 25px 0;
    transition: background-color 0.3s ease;
}

.logo-wrapper img { max-height: 90px; width: auto; display: block; }
.header-ads-wrapper { text-align: left; }


/* =========================================
   4. Main Nav (القائمة الرئيسية)
   ========================================= */
.main-nav-wrapper {
    background-color: var(--main-nav-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); /* ظل خفيف عصري */
    position: relative;
    z-index: 100;
}
.main-nav-wrapper.dark-skin-nav {
    background-color: #23282d;
    border-top: 1px solid #3a4047;
}
.main-nav-wrapper.scoretank-sticky {
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.main-menu-inner { height: 60px; display: flex; align-items: center; }

/* روابط القائمة */
ul.header-menu { margin: 0; padding: 0; list-style: none; display: flex; height: 100%; }
ul.header-menu > li { height: 100%; display: flex; align-items: center; position: relative; }
ul.header-menu > li > a {
    padding: 0 18px;
    color: var(--main-nav-text);
    font-weight: 700;
    font-size: 15px;
    height: 100%;
    display: flex; align-items: center;
    position: relative;
    transition: color 0.2s;
}
/* تأثير الخط الملون أسفل الرابط عند التحويم */
ul.header-menu > li > a:before {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px;
    background-color: var(--main-nav-hover);
    transform: scaleX(0); transition: transform 0.3s ease;
}
ul.header-menu > li:hover > a:before,
ul.header-menu > li.current-menu-item > a:before { transform: scaleX(1); }
ul.header-menu > li:hover > a { color: var(--main-nav-hover); }

/* القوائم المنسدلة */
ul.header-menu li ul {
    position: absolute; top: 100%; right: 0;
    background: var(--main-nav-bg);
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    opacity: 0; visibility: hidden; transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.2, 0.96, 0.34, 1);
    z-index: 1001; border-radius: 0 0 4px 4px;
    border-top: 3px solid var(--main-nav-hover);
}
ul.header-menu li:hover > ul { opacity: 1; visibility: visible; transform: translateY(0); }
ul.header-menu li ul li { border-bottom: 1px solid var(--border-color); }
ul.header-menu li ul li a {
    padding: 12px 20px; display: block; color: var(--main-nav-text); font-size: 14px; font-weight: 600;
}
ul.header-menu li ul li:hover > a { background: rgba(0,0,0,0.02); color: var(--main-nav-hover); padding-right: 25px; }

/* زر الرئيسية */
.main-nav-home-icon {
    background: var(--main-nav-hover); color: #fff !important;
    height: 60px; width: 60px; display: flex; align-items: center; justify-content: center;
    margin-left: 15px; font-size: 20px; transition: 0.3s;
}
.main-nav-home-icon:hover { background-color: #333; }

/* أيقونة البحث */
.main-nav-search {
    border-right: 1px solid var(--border-color);
    height: 100%; display: flex; align-items: center; padding-right: 20px; margin-right: auto;
}
.tie-search-trigger { font-size: 18px; color: var(--main-nav-text); cursor: pointer; transition: 0.3s; }
.tie-search-trigger:hover { color: var(--main-nav-hover); }


/* =========================================
   5. Layout Specifics (المخططات)
   ========================================= */
.header-layout-2 .header-content-area { text-align: center; }
.header-layout-2 .logo-wrapper { float: none; display: inline-block; width: auto; margin: 0 auto; }
.header-layout-2 .header-ads-wrapper { display: none; }
.header-layout-2 .main-menu-container { justify-content: center; display: flex; }

.nav-logo-inline { display: flex; align-items: center; height: 60px; margin-left: 20px; padding: 5px 0; }
.nav-logo-inline img { max-height: 50px; width: auto; }
.header-layout-4 .container-fluid { padding: 0 40px; }


/* --- ScoreTank Social Icons (Final Force) --- */

.scoretank-social-icons {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
}

.scoretank-social-icons li {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.scoretank-social-icons a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1 !important;
}

/* إجبار SVG على وراثة اللون من الرابط */
.scoretank-social-icons a svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important; /* هذا هو المفتاح */
    display: block;
}

/* --- الأشكال --- */

/* دائري */
.scoretank-social-icons.style-circle a {
    border-radius: 50% !important;
}

/* مربع */
.scoretank-social-icons.style-square a {
    border-radius: 3px !important;
}

/* أيقونة فقط */
.scoretank-social-icons.style-icon a {
    width: auto !important;
    height: auto !important;
    padding: 0 5px;
    background-color: transparent !important; /* تأكيد الشفافية */
}
.scoretank-social-icons.style-icon a svg {
    width: 18px !important;
    height: 18px !important;
}

/* تحويم */
.scoretank-social-icons a:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}





/* * ScoreTank Header Styles - v4.0 (Fix Logo & Ticker Animation) */



/* =========================================
   1. إصلاح مشكلة الشعار (ازدواج الصور)
   ========================================= */
/* الوضع الافتراضي (النهاري): إخفاء الليلي وإظهار الأصلي */
.logo-dark { display: none !important; }
.logo-original { display: block !important; }

/* الوضع الليلي: إخفاء الأصلي وإظهار الليلي */
body.dark-skin .logo-original { display: none !important; }
body.dark-skin .logo-dark { display: block !important; }

/* حالة خاصة: إذا كان الوضع ليلي ولكن لم يرفع المستخدم شعاراً ليلياً */
body.dark-skin .site-logo a:not(:has(.logo-dark)) .logo-original {
    display: block !important;
    filter: brightness(1.2) contrast(1.1); /* تفتيح الشعار الأصلي قليلاً */
}

/* تنسيق حاوية الشعار */
.logo-container img, .logo-wrapper img, .mobile-logo img {
    height: auto;
    display: block;
    /* الأبعاد يتم التحكم بها عبر PHP inline-style */
}


/* =========================================
   2. شريط الأخبار (تنسيقات الحركة)
   ========================================= */
.breaking-news-outer { display: flex; align-items: center; width: 100%; height: 40px; overflow: hidden; }

.breaking-title {
    background-color: var(--ticker-title-bg);
    color: #fff;
    padding: 0 15px;
    font-size: 12px;
    font-weight: bold;
    height: 40px;
    line-height: 40px;
    margin-left: 15px;
    position: relative;
    display: flex; align-items: center; gap: 5px;
}
.breaking-title:after {
    content: ''; position: absolute; left: -10px; top: 0;
    width: 0; height: 0;
    border-top: 40px solid var(--ticker-title-bg);
    border-left: 10px solid transparent;
}



/* =========================================
   3. باقي التنسيقات (الهيدر والألوان)
   ========================================= */
.theme-header { direction: rtl; background-color: var(--header-bg); position: relative; z-index: 999; border-bottom: 1px solid var(--border-color); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; position: relative; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }

/* Top Nav */
#top-nav { background-color: var(--topbar-bg); color: var(--topbar-text); height: 40px; line-height: 40px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.05); }
#top-nav a { color: inherit; transition: 0.3s; }
#top-nav a:hover { color: #fff; }
.top-area-left { display: flex; gap: 15px; align-items: center; }



/* Icons */
.tie-icon-calendar:before { content: "\f073"; font-family: "Font Awesome 5 Free"; font-weight: 900; margin-left: 5px; }
.tie-icon-moon:before { content: "\f186"; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.tie-icon-search:before { content: "\f002"; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.tie-icon-home:before { content: "\f015"; font-family: "Font Awesome 5 Free"; font-weight: 900; }
.tie-icon-menu:before { content: "\f0c9"; font-family: "Font Awesome 5 Free"; font-weight: 900; }

/* Main Nav */
.main-nav-wrapper { background-color: var(--main-nav-bg); border-top: 1px solid var(--border-color); box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.main-nav-wrapper.dark-skin-nav { background-color: #23282d; border-top: 1px solid #3a4047; }
.main-menu-inner { height: 60px; display: flex; align-items: center; }
ul.header-menu { margin: 0; padding: 0; list-style: none; display: flex; height: 100%; }
ul.header-menu > li > a { padding: 0 15px; color: var(--main-nav-text); font-weight: 700; font-size: 15px; height: 100%; display: flex; align-items: center; transition: color 0.2s; }
ul.header-menu > li:hover > a { color: var(--main-nav-hover); box-shadow: inset 0 -3px 0 var(--main-nav-hover); }

/* Layouts Specifics */
.header-layout-2 .header-content-area { text-align: center; }
.header-layout-2 .logo-wrapper { float: none; display: inline-block; margin: 0 auto; }
.header-layout-2 .main-menu-container { justify-content: center; display: flex; }
.nav-logo-inline { display: flex; align-items: center; height: 60px; margin-left: 20px; }
.header-layout-4 .container-fluid { padding: 0 40px; }

/* Dark Mode */
body.dark-skin {
    --header-bg: #23282d; --header-text: #fff; --topbar-bg: #151719; --topbar-text: #ccc;
    --main-nav-bg: #2d3339; --main-nav-text: #fff; --border-color: #3a4047;
}
body.dark-skin .header-content-wrapper,
body.dark-skin .header-content-area { background-color: #23282d !important; color: #fff; }



/* =========================================
   6. Dark Mode (الوضع الليلي) - FIX
   ========================================= */
body.dark-skin {
    --header-bg: #23282d;
    --header-text: #ffffff;
    --topbar-bg: #151719;
    --topbar-text: #cccccc;
    --main-nav-bg: #2d3339;
    --main-nav-text: #ffffff;
    --border-color: #3a4047;
    --ticker-bg: #1f2328;
}

/* ★★★ الحل الجذري لمشكلة الخلفية البيضاء في الكمبيوتر ★★★ */
body.dark-skin .header-content-wrapper,
body.dark-skin .header-content-area {
    background-color: #23282d !important; /* إجبار الخلفية الداكنة */
    color: #fff;
}

body.dark-skin .logo-wrapper img, 
body.dark-skin .nav-logo-inline img,
body.dark-skin .mobile-logo img {
    filter: brightness(1.1) contrast(1.1);
}

body.dark-skin .main-nav-wrapper { box-shadow: none; border-bottom: 1px solid #3a4047; }
body.dark-skin ul.header-menu li ul { background-color: #2d3339; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }
body.dark-skin ul.header-menu li ul li:hover > a { background-color: rgba(255,255,255,0.05); }

/* 1. إصلاح الشعار في الوضع الليلي */
.logo-dark { display: none; } /* إخفاء شعار الليل افتراضياً */

body.dark-skin .logo-original { display: none; } /* إخفاء الأصلي في الليل */
body.dark-skin .logo-dark { display: block; } /* إظهار شعار الليل */

/* إذا لم يرفع شعار ليلي، استخدم الأصلي مع فلتر */
body.dark-skin .site-logo a:not(:has(.logo-dark)) .logo-original {
    display: block;
    filter: brightness(1.2) contrast(1.1);
}

/* =========================================
   7. Mobile Design (تصميم الهاتف)
   ========================================= */
.mobile-header { display: none; background: var(--header-bg); }

@media (max-width: 991px) {
    .desktop-only { display: none !important; }
    .mobile-header { display: block; }
    
    /* توب بار الموبايل */
    .mobile-top-bar { background: var(--topbar-bg); height: 35px; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .mobile-top-bar .breaking-title { height: 35px; line-height: 35px; margin: 0; border-radius: 0; padding: 0 10px; font-size: 11px; }
    .mobile-top-bar .breaking-title:after { display: none; } /* إزالة السهم في الموبايل لتوفير المساحة */
    .mobile-top-bar .breaking-news-content li { line-height: 35px; font-size: 12px; }

    /* الهيدر الرئيسي للموبايل */
    .mobile-header-inner {
        display: flex; justify-content: space-between; align-items: center;
        height: 60px; padding: 0 15px; border-bottom: 1px solid var(--border-color);
        background-color: var(--header-bg); /* ضمان الخلفية الصحيحة */
    }
    .mobile-logo img { max-height: 40px; }
    .mobile-controls { display: flex; gap: 15px; align-items: center; }
    .mobile-icon { font-size: 22px; cursor: pointer; color: var(--header-text); }
    
    /* القائمة الجانبية */
    .mobile-menu-container {
        position: fixed; top: 0; right: -300px; width: 280px; height: 100vh;
        background: #fff; z-index: 10000; transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.2); display: flex; flex-direction: column;
    }
    .mobile-menu-container.is-active { right: 0; }
    
    .mobile-menu-header {
        background: #1a1a1a; color: #fff; padding: 15px 20px;
        display: flex; justify-content: space-between; align-items: center;
    }
    .mobile-menu-content { flex-grow: 1; padding: 20px 0; overflow-y: auto; }
    .mobile-menu-content li { border-bottom: 1px solid #eee; }
    .mobile-menu-content a { display: block; padding: 12px 20px; color: #333; font-weight: 600; font-size: 14px; }
    
    .mobile-menu-footer { padding: 20px; border-top: 1px solid #eee; text-align: center; }
    .mobile-social-icons ul { justify-content: center; display: flex; gap: 15px; }
    .mobile-social-icons a svg { fill: #333; width: 20px; height: 20px; }

    /* الوضع الليلي للموبايل */
    body.dark-skin .mobile-menu-container { background-color: #23282d; }
    body.dark-skin .mobile-menu-content a { color: #fff; }
    body.dark-skin .mobile-menu-content li, 
    body.dark-skin .mobile-menu-footer { border-color: #3a4047; }
    body.dark-skin .mobile-social-icons a svg { fill: #fff; }
}

/* --- إصلاح أيقونة الوضع الليلي (شمس/قمر) --- */

/* الأيقونة الافتراضية (قمر) */
.tie-icon-moon:before {
    content: "\f186"; /* Moon Icon code (FontAwesome) */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

/* عند تفعيل الوضع الليلي: تحويلها لشمس */
body.dark-skin .tie-icon-moon:before {
    content: "\f185"; /* Sun Icon code */
}

/* في الوضع الليلي، اجعل الأيقونة باللون الأبيض أو الأصفر */
body.dark-skin .skin-switcher-component a,
body.dark-skin .skin-switcher-mobile a {
    color: #fff !important; 
}
body.dark-skin .skin-switcher-component a:hover {
    color: #ffcc00 !important; /* لون أصفر عند التحويم */
}

/* التأكد من ظهور الأيقونة في الكمبيوتر */
.skin-switcher-component {
    display: block !important;
}

/* --- إصلاح ظهور زر الوضع الليلي في الكمبيوتر والموبايل --- */

/* 1. إظهار الحاوية في الشريط العلوي (Desktop) */
.skin-switcher-component {
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    width: 30px; /* ضمان وجود مساحة للنقر */
    height: 30px;
}

/* 2. تنسيق الأيقونة (لضمان ظهورها) */
.skin-switcher-component a,
.skin-switcher-mobile a {
    display: block;
    font-size: 16px !important;
    line-height: 1;
    color: #ccc !important; /* لون افتراضي فاتح للخلفية الداكنة */
    transition: 0.3s;
    cursor: pointer;
}

/* 3. تأثير التحويم */
.skin-switcher-component a:hover,
.skin-switcher-mobile a:hover {
    color: #ffffff !important;
}

/* 4. التأكد من خط الأيقونات (FontAwesome) */
.tie-icon-moon:before {
    content: "\f186"; 
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}
.tie-icon-sun:before {
    content: "\f185"; 
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

/* 5. التبديل في الوضع الليلي */
body.dark-skin .tie-icon-moon:before {
    content: "\f185"; /* تحويل الهلال لشمس */
    color: #ffeb3b !important; /* لون أصفر للشمس */
}