/* ===== Elzem Match Schedule - Main Styles v9.5 ===== */
/* تصميم احترافي مع نيون وتوهج وأنيميشن */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0; padding: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--body-bg, #f0f2f5); color: #333;
    direction: rtl; min-height: 100vh;
    display: flex; flex-direction: column;
    transition: background var(--anim-speed, 0.3s) ease, color var(--anim-speed, 0.3s) ease;
}
a { color: inherit; text-decoration: none; }

/* ===== خلفية متدرجة للموقع ===== */
body.elzem-body {
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 255, 0.04) 0%, transparent 40%),
        var(--body-bg, #f0f2f5);
}
[data-theme="dark"] body.elzem-body {
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 255, 0.06) 0%, transparent 40%),
        var(--dark-body-bg, #0a0a12);
}

/* ===== Header ===== */
.site-header {
    color: #fff;
    padding: 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    position: sticky;
    top: 0; z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
body.neon-on .site-header {
    box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 calc(var(--neon-blur, 15px) * 0.3) rgba(0, 255, 255, 0.15);
}
.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 15px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-brand .logo-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    transition: all var(--anim-speed, 0.3s) ease;
}
body.neon-on .header-brand .logo-icon {
    border-color: var(--neon-color, #00ffff);
    box-shadow: 0 0 var(--neon-blur, 15px) var(--neon-color, #00ffff), inset 0 0 calc(var(--neon-blur, 15px) * 0.5) var(--neon-color, #00ffff);
    color: var(--neon-color, #00ffff);
}
body.anim-on .header-brand .logo-icon:hover {
    transform: rotate(360deg) scale(1.1);
}
.header-brand h1 {
    margin: 0; font-size: 22px; font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.neon-on .header-brand h1 {
    background: linear-gradient(135deg, var(--neon-color, #00ffff), #fff, var(--glow-color, #ff00ff));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 6px rgba(0, 255, 255, 0.3));
}
.header-brand .version { font-size: 11px; opacity: 0.6; font-weight: 400; }
.header-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.header-nav a {
    color: rgba(255,255,255,0.85); padding: 10px 18px; border-radius: 10px;
    font-size: 14px; font-weight: 600;
    transition: all var(--anim-speed, 0.3s) ease;
    display: flex; align-items: center; gap: 8px;
    border: 1.5px solid transparent;
    position: relative;
    overflow: hidden;
}
.header-nav a::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--anim-speed, 0.3s) ease;
}
.header-nav a:hover { background: rgba(255,255,255,0.12); color: #fff; transform: translateY(-2px); }
.header-nav a:hover::before { opacity: 1; }
.header-nav a.active {
    background: rgba(255,255,255,0.18); color: #fff;
    border-color: rgba(255,255,255,0.3);
}
body.neon-on .header-nav a.active {
    border-color: var(--neon-color, #00ffff);
    box-shadow: 0 0 calc(var(--neon-blur, 15px) * 0.4) var(--neon-color, #00ffff);
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    background: rgba(255,255,255,0.15); border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff; padding: 8px 12px; border-radius: 10px;
    cursor: pointer; font-size: 16px;
    transition: all var(--anim-speed, 0.3s) ease; display: flex;
    align-items: center; gap: 6px;
}
body.neon-on .theme-toggle {
    border-color: var(--neon-color, #00ffff);
    box-shadow: 0 0 calc(var(--neon-blur, 15px) * 0.4) var(--neon-color, #00ffff);
}
.theme-toggle:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }

@media (max-width: 768px) {
    .header-inner { flex-direction: column; text-align: center; }
    .header-nav { justify-content: center; }
    .header-nav a { padding: 8px 14px; font-size: 13px; }
}

/* ===== Main content ===== */
.site-main { flex: 1; max-width: var(--layout-width, 1200px); width: 100%; margin: 0 auto; padding: 25px 20px; }

/* ===== Footer ===== */
.site-footer {
    color: rgba(255,255,255,0.7);
    padding: 0; margin-top: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 25px 20px; }
.footer-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 30px; padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}
.footer-brand h3 {
    color: #fff; margin: 0 0 8px 0; font-size: 18px;
    display: flex; align-items: center; gap: 10px;
}
body.neon-on .footer-brand h3 {
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}
.footer-brand p { margin: 0; font-size: 13px; line-height: 1.6; max-width: 300px; }
.footer-links h4 {
    color: #fff; margin: 0 0 12px 0; font-size: 15px;
    position: relative; padding-bottom: 8px;
}
.footer-links h4::after {
    content: ''; position: absolute; bottom: 0; right: 0;
    width: 30px; height: 2px;
    background: linear-gradient(90deg, var(--neon-color, #00ffff), transparent);
}
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a {
    color: rgba(255,255,255,0.6); font-size: 13px;
    transition: all var(--anim-speed, 0.3s) ease;
    display: inline-flex; align-items: center; gap: 6px;
}
.footer-links a:hover { color: #fff; padding-right: 5px; }
body.neon-on .footer-links a:hover { text-shadow: 0 0 6px rgba(0, 255, 255, 0.5); }
.footer-bottom { text-align: center; padding-top: 15px; font-size: 13px; }
.footer-bottom a { color: #fff; font-weight: 600; }
.footer-bottom .sep { margin: 0 10px; opacity: 0.3; }

@media (max-width: 768px) {
    .footer-top { flex-direction: column; text-align: center; }
    .footer-brand p { max-width: 100%; }
}

/* ===== Static pages ===== */
.static-page { max-width: 800px; margin: 0 auto; }
.static-page h2 { font-size: 26px; color: var(--team-name-color); margin: 0 0 20px; text-align: center; }
.static-page h3 { font-size: 18px; color: var(--team-name-color); margin: 25px 0 12px; }
.static-page p, .static-page li { line-height: 1.8; color: var(--time-color); margin-bottom: 12px; font-size: 15px; text-align: justify; }
.static-page ul { padding-right: 20px; }
.static-page .info-box { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 25px; margin-bottom: 20px; }
.static-page .info-box h3 { font-size: 18px; color: var(--team-name-color); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.static-page .info-box h3 i { color: var(--result-color); }
.contact-form { display: grid; gap: 15px; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--card-radius, 12px);
    font-family: inherit; font-size: 14px;
    transition: all var(--anim-speed, 0.3s) ease;
}
.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--neon-color, #00ffff);
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.15);
    outline: none;
}
.contact-form textarea { min-height: 150px; }
.contact-form button {
    background: var(--today-bg); color: #fff; border: none;
    padding: 12px 30px; border-radius: var(--card-radius, 12px);
    font-size: 16px; font-weight: bold; cursor: pointer; font-family: inherit;
    transition: all var(--anim-speed, 0.3s) ease;
}
body.btn-glow-on .contact-form button {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}
.contact-form button:hover { transform: translateY(-2px); }

/* ===== أنماط الأزرار العامة ===== */
.elzem-btn, .btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--card-radius, 12px);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: all var(--anim-speed, 0.3s) ease;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
body.btn-style-modern .elzem-btn,
body.btn-style-modern .btn {
    background: linear-gradient(135deg, var(--competition-bg, #000), var(--header-bg-color-2, #333));
    color: var(--competition-text, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
body.btn-style-modern .elzem-btn:hover,
body.btn-style-modern .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

body.btn-style-neon .elzem-btn,
body.btn-style-neon .btn {
    background: transparent;
    color: var(--neon-color, #00ffff);
    border: 2px solid var(--neon-color, #00ffff);
    box-shadow: 0 0 var(--neon-blur, 15px) var(--neon-color, #00ffff), inset 0 0 calc(var(--neon-blur, 15px) * 0.5) var(--neon-color, #00ffff);
    text-shadow: 0 0 8px var(--neon-color, #00ffff);
}
body.btn-style-neon .elzem-btn:hover,
body.btn-style-neon .btn:hover {
    background: var(--neon-color, #00ffff);
    color: #000;
    box-shadow: 0 0 calc(var(--neon-blur, 15px) * 1.5) var(--neon-color, #00ffff);
}

body.btn-style-glass .elzem-btn,
body.btn-style-glass .btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--team-name-color, #000);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
body.btn-style-glass .elzem-btn:hover,
body.btn-style-glass .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--neon-color, #00ffff);
}

body.btn-style-classic .elzem-btn,
body.btn-style-classic .btn {
    background: var(--competition-bg, #000);
    color: var(--competition-text, #fff);
    border: 1px solid var(--border-color, #ccc);
}

body.btn-glow-on .elzem-btn:hover,
body.btn-glow-on .btn:hover {
    box-shadow: 0 0 calc(var(--glow-blur, 20px) * 0.6) var(--glow-color, #ff00ff);
}

/* ===== أنيميشن عامة ===== */
@keyframes elzem-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes elzem-glow-pulse {
    0%, 100% { box-shadow: 0 0 calc(var(--neon-blur, 15px) * 0.5) var(--neon-color, #00ffff); }
    50% { box-shadow: 0 0 calc(var(--neon-blur, 15px) * 1.2) var(--neon-color, #00ffff); }
}
@keyframes elzem-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes elzem-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

body.anim-on .match-item,
body.anim-on .news-card,
body.anim-on .hero-card {
    animation: elzem-fade-in var(--anim-speed, 0.3s) ease-out;
}

/* تأثير الوميض على العنوان الرئيسي */
body.neon-on .header-brand h1 {
    background-size: 200% auto;
    animation: elzem-shimmer 4s linear infinite;
}

/* توهج عائم للبطاقات المميزة */
body.anim-on .featured-badge {
    animation: elzem-glow-pulse 2s ease-in-out infinite;
}

/* تأثير العائم للشعار */
body.anim-on .header-brand .logo-icon {
    animation: elzem-float 3s ease-in-out infinite;
}

/* ====================================================================
   ===== نظام القوائم الجانبية (Widgets) =====
   ==================================================================== */

/* تخطيط الصفحة مع الشريط الجانبي */
.elzem-container { max-width: var(--layout-width, 1200px); margin: 0 auto; padding: 0 20px; }

/*
 * تخطيط ثلاثي الأعمدة باستخدام CSS Grid (أكثر استقراراً من flexbox في RTL).
 * في RTL: العمود الأول من grid-template-columns يقع في أقصى اليمين،
 *          والعمود الثاني إلى يساره، والثالث إلى يسار الثاني، وهكذا.
 *
 *   has-right-sidebar (فقط):  grid-template-columns: 300px 1fr;
 *                              → العمود 1 (300px) على اليمين = الشريط الأيمن
 *                              → العمود 2 (1fr)    على اليسار = المحتوى
 *
 *   has-left-sidebar  (فقط):  grid-template-columns: 1fr 300px;
 *                              → العمود 1 (1fr)    على اليمين = المحتوى
 *                              → العمود 2 (300px) على اليسار = الشريط الأيسر
 *
 *   الشريطين معاً:            grid-template-columns: 300px 1fr 300px;
 *                              → 300px يمين | 1fr وسط | 300px يسار
 *
 * نستخدم grid-column صراحةً لضمان وضع كل عنصر في العمود الصحيح بغض النظر
 * عن ترتيب DOM، مما يحل مشكلة ظهور الشريط أعلى/أسفل المحتوى.
 */
.elzem-layout {
    display: grid !important;
    gap: 20px;
    width: 100%;
    align-items: start;
    /* افتراضياً: عمود واحد بدون شريط */
    grid-template-columns: 1fr !important;
}
.elzem-layout.no-sidebar {
    grid-template-columns: 1fr !important;
}
.elzem-layout.no-sidebar .elzem-content {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* ===== شريط أيمن فقط ===== */
.elzem-layout.has-right-sidebar:not(.has-left-sidebar) {
    grid-template-columns: 300px 1fr !important;
}
.elzem-layout.has-right-sidebar:not(.has-left-sidebar) .elzem-sidebar-right {
    grid-column: 1;  /* يمين في RTL */
    grid-row: 1;
}
.elzem-layout.has-right-sidebar:not(.has-left-sidebar) .elzem-content {
    grid-column: 2;  /* يسار في RTL */
    grid-row: 1;
    min-width: 0;
}

/* ===== شريط أيسر فقط ===== */
.elzem-layout.has-left-sidebar:not(.has-right-sidebar) {
    grid-template-columns: 1fr 300px !important;
}
.elzem-layout.has-left-sidebar:not(.has-right-sidebar) .elzem-content {
    grid-column: 1;  /* يمين في RTL */
    grid-row: 1;
    min-width: 0;
}
.elzem-layout.has-left-sidebar:not(.has-right-sidebar) .elzem-sidebar-left {
    grid-column: 2;  /* يسار في RTL */
    grid-row: 1;
}

/* ===== الشريطين معاً ===== */
.elzem-layout.has-right-sidebar.has-left-sidebar {
    grid-template-columns: 300px 1fr 300px !important;
}
.elzem-layout.has-right-sidebar.has-left-sidebar .elzem-sidebar-right {
    grid-column: 1;  /* يمين */
    grid-row: 1;
}
.elzem-layout.has-right-sidebar.has-left-sidebar .elzem-content {
    grid-column: 2;  /* وسط */
    grid-row: 1;
    min-width: 0;
}
.elzem-layout.has-right-sidebar.has-left-sidebar .elzem-sidebar-left {
    grid-column: 3;  /* يسار */
    grid-row: 1;
}

/* ===== المحتوى الرئيسي ===== */
.elzem-layout .elzem-content {
    min-width: 0;
    min-height: 1px;
}

/* ===== الشريط الجانبي — ثابت العرض ولا يتمدد أو ينكمش ===== */
.elzem-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    align-self: start;
}

/* ودجت واحد */
.elzem-widget {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.elzem-widget:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }

.elzem-widget-title {
    padding: 12px 16px;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.02);
}
.elzem-widget-title i { font-size: 13px; opacity: 0.85; }
.elzem-widget-body { padding: 10px 14px 14px; }

.elzem-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.elzem-widget-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}
.elzem-widget-item:last-child { border-bottom: none; padding-bottom: 0; }
.elzem-widget-item:first-child { padding-top: 0; }

.elzem-widget-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f5f9;
    flex-shrink: 0;
    text-decoration: none;
}
.elzem-widget-thumb img {
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.elzem-widget-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 22px;
    background: #e2e8f0;
    border-radius: 8px;
}

.elzem-widget-content {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.elzem-widget-link {
    text-decoration: none;
    font-weight: 700;
    line-height: 1.4;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.elzem-widget-link:hover { text-decoration: underline; opacity: 0.85; }
.elzem-widget-meta {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.elzem-widget-meta i { font-size: 10px; opacity: 0.7; }

.elzem-widget-empty {
    padding: 20px 8px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* Style 2: مختصر — بدون صور */
.elzem-widget-style2 .elzem-widget-item {
    padding: 8px 0;
}
.elzem-widget-style2 .elzem-widget-thumb { display: none; }
.elzem-widget-style2 .elzem-widget-link {
    font-size: 14px;
    padding-right: 12px;
    position: relative;
}
.elzem-widget-style2 .elzem-widget-link::before {
    content: '◆';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--neon-color, #00ffff);
    font-size: 9px;
}

/* Style 3: بطاقات */
.elzem-widget-style3 .elzem-widget-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.elzem-widget-style3 .elzem-widget-item {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.015);
    flex-direction: column;
    align-items: stretch;
}
.elzem-widget-style3 .elzem-widget-thumb {
    width: 100% !important;
    height: 120px !important;
    border-radius: 8px;
}
.elzem-widget-style3 .elzem-widget-thumb img,
.elzem-widget-style3 .elzem-widget-thumb-fallback {
    width: 100% !important;
    height: 100% !important;
}
.elzem-widget-style3 .elzem-widget-link { font-size: 14px; margin-top: 8px; }

/* الوضع الداكن للودجتات */
[data-theme="dark"] .elzem-widget { box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
[data-theme="dark"] .elzem-widget-title { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .elzem-widget-thumb { background: #1a1a25; }
[data-theme="dark"] .elzem-widget-thumb-fallback { background: #2a2a35; color: #6b7280; }
[data-theme="dark"] .elzem-widget-item { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .elzem-widget-meta { color: #9ca3af; }
[data-theme="dark"] .elzem-widget-empty { color: #6b7280; }

/* تجاوب الشريط الجانبي على الجوال — نستخدم 768px بدلاً من 992px
 * حتى لا يتم تفعيله على الأجهزة اللوحية والقوالب التي تضع الإضافة في حاوية متوسطة */
@media (max-width: 768px) {
    .elzem-container { padding: 0; }
    /* على الجوال: عمود واحد، المحتوى أولاً ثم الشريط الجانبي أسفله */
    .elzem-layout,
    .elzem-layout.no-sidebar,
    .elzem-layout.has-right-sidebar:not(.has-left-sidebar),
    .elzem-layout.has-left-sidebar:not(.has-right-sidebar),
    .elzem-layout.has-right-sidebar.has-left-sidebar {
        grid-template-columns: 1fr !important;
        gap: 0;
    }
    .elzem-layout .elzem-content,
    .elzem-layout .elzem-sidebar-right,
    .elzem-layout .elzem-sidebar-left {
        grid-column: 1 !important;
    }
    /* ترتيب الصفوف: المحتوى أولاً، الشريط الجانبي (يمين أو يسار) أسفله */
    .elzem-layout .elzem-content      { grid-row: 1 !important; }
    .elzem-layout .elzem-sidebar-right,
    .elzem-layout .elzem-sidebar-left { grid-row: 2 !important; }
}

@media (max-width: 600px) {
    .elzem-widget-title { font-size: 14px; padding: 10px 12px; }
    .elzem-widget-body { padding: 8px 10px 12px; }
    .elzem-widget-thumb { width: 50px !important; height: 50px !important; }
    .elzem-widget-thumb img { width: 50px !important; height: 50px !important; }
}

/* ====================================================================
   ===== الشريط الجانبي المثبَّت (Sticky Sidebar) =====
   * يُفعَّل بإضافة الكلاس elzem-sidebar-sticky على الحاوية من widgets.php
   * عندما يكون أي ودجت عليه خاصية "تثبيت".
   * يقوم بـ:
   *   1) تثبيت الشريط في الأعلى أثناء تمرير الصفحة (position: sticky)
   *   2) جعل الشريط يأخذ ارتفاع الـ viewport بالكامل (min-height)
   *   3) السماح بالتمرير الداخلي للشريط إذا زاد محتواه عن ارتفاع الشاشة
   *   4) لا يظهر فراغ أسفل الشريط عند تمرير الصفحة
   ==================================================================== */
.elzem-sidebar-sticky {
    position: sticky;
    top: 90px;                          /* تحت الهيدر الثابت */
    align-self: start;
    /* ارتفاع الشريط = ارتفاع الـ viewport المتاح (نخصم ارتفاع الهيدر ~90px)
       حتى لا يظهر فراغ أسفل الشريط عند التمرير */
    min-height: calc(100vh - 90px);
    /* في حال زاد المحتوى عن ارتفاع الشاشة: تمرير داخلي أنيق */
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    /* شريط تمرير رفيع أنيق */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, rgba(0,0,0,0.2)) transparent;
}
.elzem-sidebar-sticky::-webkit-scrollbar { width: 6px; }
.elzem-sidebar-sticky::-webkit-scrollbar-track { background: transparent; }
.elzem-sidebar-sticky::-webkit-scrollbar-thumb {
    background: var(--border-color, rgba(0,0,0,0.2));
    border-radius: 3px;
}
/* الودجت المثبَّت داخل الشريط اللزج — تمييز بصري بسيط */
.elzem-sidebar-sticky .elzem-widget {
    position: relative;
}
/* على الجوال: لا معنى للـ sticky (عمود واحد) — نُلغيه */
@media (max-width: 768px) {
    .elzem-sidebar-sticky {
        position: static !important;
        top: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ====================================================================
   ===== القائمة الجانبية الذكية لونياً (Theme-Aware Sidebar) =====
   * تتكيّف خلفية الشريط وألوانه مع الثيم النشط ديناميكياً.
   * تعمل مع: light / dark / blood_dark / blood_light وأي ثيم مستقبلي
   * يأخذ الألوان من متغيرات CSS المعرفة في header.php (elzem_get_css_vars)
   ==================================================================== */

/* القاعدة الافتراضية (الثيم الفاتح) */
.elzem-sidebar-sticky {
    background: var(--sidebar-bg, #f4f6f8);
    border-radius: 14px;
    padding: 8px;
    border: 1px solid var(--border-color, rgba(0,0,0,0.04));
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

/* الثيم الداكن العام */
[data-theme="dark"] .elzem-sidebar-sticky,
body.dark-active .elzem-sidebar-sticky {
    background: var(--dark-sidebar-bg, #14141e);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

/* ثيم الدم الغزالي الداكن */
body.theme-blood-dark .elzem-sidebar-sticky {
    background: linear-gradient(180deg, #121214 0%, #0a0a0c 100%) !important;
    border: 1px solid rgba(220, 38, 38, 0.25) !important;
    box-shadow: 0 4px 22px rgba(127, 29, 29, 0.18) !important;
}
/* ثيم الدم الغزالي الفاتح */
body.theme-blood-light .elzem-sidebar-sticky {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%) !important;
    border: 1px solid rgba(220, 38, 38, 0.18) !important;
    box-shadow: 0 4px 22px rgba(220, 38, 38, 0.10) !important;
}

/* ودجتات الشريط تتكيّف مع الثيم تلقائياً */
[data-theme="dark"] .elzem-sidebar-sticky .elzem-widget,
body.theme-blood-dark .elzem-sidebar-sticky .elzem-widget {
    background: rgba(26, 26, 37, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e0e0e8 !important;
}
[data-theme="dark"] .elzem-sidebar-sticky .elzem-widget-title,
body.theme-blood-dark .elzem-sidebar-sticky .elzem-widget-title {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--dark-team-name-color, #ffffff) !important;
    border-bottom-color: rgba(220, 38, 38, 0.2) !important;
}
[data-theme="dark"] .elzem-sidebar-sticky .elzem-widget-link,
body.theme-blood-dark .elzem-sidebar-sticky .elzem-widget-link {
    color: var(--dark-team-name-color, #ffffff) !important;
}
[data-theme="dark"] .elzem-sidebar-sticky .elzem-widget-meta,
body.theme-blood-dark .elzem-sidebar-sticky .elzem-widget-meta {
    color: #9ca3af !important;
}
[data-theme="dark"] .elzem-sidebar-sticky .elzem-widget-item,
body.theme-blood-dark .elzem-sidebar-sticky .elzem-widget-item {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

/* ثيم الدم الفاتح — ودجتات بيضاء أنيقة */
body.theme-blood-light .elzem-sidebar-sticky .elzem-widget {
    background: #ffffff !important;
    border-color: rgba(220, 38, 38, 0.12) !important;
    color: #18181b !important;
}
body.theme-blood-light .elzem-sidebar-sticky .elzem-widget-title {
    background: rgba(220, 38, 38, 0.04) !important;
    color: #b91c1c !important;
    border-bottom-color: rgba(220, 38, 38, 0.15) !important;
}
body.theme-blood-light .elzem-sidebar-sticky .elzem-widget-link {
    color: #18181b !important;
}
body.theme-blood-light .elzem-sidebar-sticky .elzem-widget-item {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

/* تأثير توهج خفيف للشريط عند تفعيل النيون */
body.neon-on .elzem-sidebar-sticky {
    box-shadow: 0 0 calc(var(--neon-blur, 15px) * 0.3) rgba(0, 255, 255, 0.15),
                0 4px 18px rgba(0, 0, 0, 0.2);
}


