:root {
    --bg-color: #0a0a0a;         /* أسود عميق جداً */
    --card-bg: #141414;          /* رمادي داكن فخم للبطاقات */
    --text-main: #f5f5f5;        /* أبيض ناصع للقراءة */
    --text-muted: #9e9e9e;       /* رمادي هادئ للتفاصيل */
    --accent: #d4af37;           /* ذهبي فخم (Gold) */
    --accent-glow: rgba(212, 175, 55, 0.15); /* توهج ذهبي خفيف */
    --border-color: #2a2a2a;     /* حدود خفيفة جداً */
    --live-color: #e63946;       /* أحمر صارخ لشارة المباشر */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    /* إضافة لمسة فخمة في الخلفية */
    background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, var(--bg-color) 70%);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   الترويسة (Header & Navigation)
========================================= */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    text-shadow: 0 2px 5px rgba(212, 175, 55, 0.3);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.header-controls {
    display: flex;
    gap: 10px;
}

/* =========================================
   قسم الهيرو (Hero Section)
========================================= */
.hero-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
    padding: 60px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
}

.hero-title span {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff; /* دائمًا أبيض حتى في اللايت مود لكي يكون واضحاً */
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* =========================================
   تذييل الصفحة (Footer)
========================================= */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px 20px;
    margin-top: 50px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
}

.footer-dmca {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.footer-copyright {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-main);
}

/* مساحات الإعلانات */
.ad-space {
    width: 100%;
    height: 90px;
    background: var(--card-bg);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 8px;
    margin: 20px 0;
    font-size: 0.9rem;
}

/* قسم القنوات */
.channels-section {
    margin-bottom: 30px;
}

.channels-section h2 {
    color: var(--accent);
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.channels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.channel-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 1 1 calc(33.333% - 12px);
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.channel-btn:hover {
    background: var(--bg-color);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(212, 175, 55, 0.15);
}

/* كروت المباريات */
.matches-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}

.match-card:hover::before {
    opacity: 1;
}

/* تفاصيل الكارت */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.live-badge {
    background-color: var(--live-color);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.6);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.team-logo {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    padding: 5px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.team-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.team-name {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-main);
}

.match-info-center {
    flex: 0.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.match-time {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent);
    background: var(--bg-color);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.match-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* صفحة المشغل */
.player-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    position: relative;
}

.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #fff;
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 600px) {
    .team-name {
        font-size: 0.9rem;
    }
    .team-logo {
        width: 40px;
        height: 40px;
    }
    header h1 {
        font-size: 2.2rem;
    }
    .channel-btn {
        flex: 1 1 calc(50% - 12px);
    }
}

/* =========================================
   إعدادات التحكم (اللغة والوضع)
========================================= */
.settings-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: var(--accent);
    color: var(--bg-color);
    border-color: var(--accent);
}

/* =========================================
   الوضع الفاتح (Light Mode - Royal White & Gold)
========================================= */
body.light-mode {
    --bg-color: #ebeae5;         /* لون بيج/رمادي هادئ جداً يطفئ سطوع الأبيض */
    --card-bg: #f5f4ef;          /* لون كريمي مطفي للبطاقات (Off-white) */
    --text-main: #1a1a1a;        /* أسود غير صارخ لراحة العين */
    --text-muted: #666666;
    --border-color: rgba(212, 175, 55, 0.5); /* حدود ذهبية أوضح بقليل */
    --accent-glow: rgba(212, 175, 55, 0.15);
    background-image: radial-gradient(circle at 50% 0%, #f0efe9 0%, #ebeae5 100%);
}

body.light-mode header h1 {
    color: #1a1a1a;
    text-shadow: none;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 10px;
}
body.light-mode header::after {
    display: none;
}

body.light-mode .channel-btn {
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    background: var(--card-bg);
    color: #1a1a1a;
}

body.light-mode .channel-btn:hover {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 8px 15px rgba(212, 175, 55, 0.3);
    border-color: var(--accent);
}

body.light-mode .match-card {
    box-shadow: 0 4px 8px rgba(0,0,0,0.03);
}

body.light-mode .match-card:hover {
    background: #fffef8;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
}

body.light-mode .team-logo {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-color: rgba(212, 175, 55, 0.5);
}

body.light-mode .player-container {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 2px solid var(--accent);
}

body.light-mode .match-time {
    background: #fdfdfd;
}

/* التمرير الأفقي المستمر (Seamless Marquee) للقنوات الرئيسية */
.scroll-channels-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding-bottom: 10px;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: scroll-marquee 20s linear infinite;
}

/* التوقف عند وضع الماوس أو اللمس */
.scroll-channels-container:hover .marquee-track,
.scroll-channels-container:active .marquee-track {
    animation-play-state: paused;
}

.marquee-content {
    display: flex;
    gap: 15px;
    padding-right: 15px; /* نفس مسافة الجاب لكي يكون الاتصال سلس */
}

/* الحركة للغة الإنجليزية (LTR) */
@keyframes scroll-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* الحركة للغة العربية (RTL) */
html[dir="rtl"] .marquee-track {
    animation: scroll-marquee-rtl 20s linear infinite;
}

@keyframes scroll-marquee-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

.channel-btn {
    flex: 0 0 auto;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
}

.channel-btn img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
}
