:root {
    --esz-yellow: #FFC107;
    --esz-red: #e30613;
    --esz-black: #1a1a1b;
    --esz-white: #ffffff;
    --bg-light: #f8f8f8;
    --body-bg: var(--bg-light);
    --text-color: var(--esz-black);
    --card-bg: var(--esz-white);
    --card-border: #dddddd;
}

[data-theme="dark"] {
    --body-bg: #0d0d0e; /* Noir plus profond pour l'identité club */
    --text-color: #f0f0f0;
    --card-bg: #161617; /* Teinte proche du esz-black original */
    --card-border: #2c2c2d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Montserrat', sans-serif; 
    background: var(--body-bg); 
    color: var(--text-color); 
    overflow-x: hidden; 
    transition: background-color 0.3s ease, color 0.3s ease; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; }
.flex-between { display: flex; justify-content: space-between; align-items: center; width: 100%; }

/* Top Bar */
.top-bar {
    background: #000;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0; /* Suppression de la bande blanche entre les icônes et le logo */
    height: 50px; /* Hauteur fixe pour un centrage vertical précis */
    display: flex; /* Utiliser flexbox pour centrer le contenu */
    align-items: center; /* Centrage vertical */
    justify-content: center; /* Centrage horizontal du contenu */
    position: relative;
}
.social-icons-centered { 
    display: flex; 
    justify-content: center; 
    gap: 25px; /* Espace entre les icônes */
}
/* Sélecteur de langue */
.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    direction: ltr !important; /* Empêche l'inversion des boutons en mode Arabe */
}
.lang-btn {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 3px;
    font-family: 'Montserrat', sans-serif;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.1); }

.lang-btn.active { 
    background: var(--esz-yellow); 
    border-color: var(--esz-yellow); 
    color: var(--esz-black); 
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.6);
}

.social-icons-centered a { color: #fff; font-size: 18px; transition: 0.3s; } /* Taille réduite des icônes */
.social-icons-centered a:hover { color: var(--esz-yellow); transform: scale(1.2); } /* Effet au survol */

/* Navigation */
.main-nav { background: var(--esz-black); height: 80px; border-bottom: 4px solid var(--esz-yellow); position: sticky; top: 0; z-index: 1000; transition: 0.3s; overflow: visible; }
.main-nav.scrolled { height: 65px; background: rgba(26, 26, 27, 0.95); backdrop-filter: blur(5px); }
.nav-container { display: flex; align-items: center; height: 100%; justify-content: center; }
.logo-wrapper { position: relative; top: 25px; transition: 0.3s; margin: 0 80px; order: 2; } /* Ajusté pour un logo de 130px */
.main-nav.scrolled .logo-wrapper { top: 17.5px; } /* Ajusté pour un logo de 100px sur nav de 65px */
.main-logo { height: 130px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); transition: 0.3s; z-index: 1100; }
.main-nav.scrolled .main-logo { height: 100px; transform: none; }
.nav-links { display: flex; list-style: none; gap: 35px; flex: 1; align-items: center; }
.nav-left { justify-content: flex-end; order: 1; }
.nav-right { justify-content: flex-start; order: 3; }
.nav-links a { 
    text-decoration: none; 
    color: #fff; 
    font-weight: 700; 
    font-size: 13px; 
    transition: 0.3s; 
    position: relative;
    padding: 5px 0;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--esz-yellow);
    transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--esz-yellow); }

.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

/* Hero Section */
.hero {
    width: 100%;
    height: auto;
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2; /* Ratio plus haut (1.5) pour éviter de couper les têtes et les pieds des joueurs */
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.hero-slide {
    flex: 0 0 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-content { color: #fff; position: relative; z-index: 10; pointer-events: none; }

/* Next Match Section */
.next-match-section { padding: 40px 0; background: var(--card-bg); border-bottom: 1px solid var(--card-border); }
.match-box { 
    display: flex; 
    align-items: center; 
    justify-content: space-around; 
    background: var(--esz-black); 
    color: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    border-bottom: 5px solid var(--esz-yellow);
    flex-wrap: wrap;
    gap: 30px;
}
.match-teams-info { display: flex; align-items: center; gap: 40px; }
.m-team { text-align: center; }
.m-team img { height: 80px; margin-bottom: 10px; }
.m-team h4 { font-size: 14px; font-weight: 900; color: var(--esz-yellow); }
.m-vs { font-size: 32px; font-weight: 900; color: var(--esz-red); }
.m-score { 
    font-size: 42px; 
    font-weight: 900; 
    color: #fff; 
    background: rgba(255,255,255,0.1); 
    padding: 5px 20px; 
    border-radius: 8px; 
    margin-top: 10px;
}

.match-center { text-align: center; flex: 1; }
.match-meta p { margin: 8px 0; font-size: 14px; color: #eee; }
.match-meta i { color: var(--esz-yellow); margin-right: 10px; width: 20px; }

.match-countdown-wrapper { text-align: center; }
.match-countdown-wrapper { width: 100%; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; margin-top: 10px; }
.countdown-timer { display: flex; gap: 15px; justify-content: center; margin-bottom: 15px; }
.timer-block { background: rgba(255,255,255,0.1); padding: 10px 15px; border-radius: 4px; min-width: 70px; }
.timer-block span { display: block; font-size: 24px; font-weight: 900; color: var(--esz-yellow); }
.timer-block p { font-size: 10px; text-transform: uppercase; color: #888; margin-top: 5px; }

.match-meta { font-size: 13px; color: #ccc; }
.match-meta p { margin-bottom: 5px; }
.match-meta i { color: var(--esz-yellow); margin-right: 5px; }

@media (max-width: 768px) {
    .match-box { flex-direction: column; }
    .match-teams-info { gap: 20px; }
}

.season-tag { background: var(--esz-red); padding: 5px 15px; font-weight: 900; font-size: 14px; display: inline-block; margin-bottom: 15px; }
.hero h1 { font-size: 60px; font-weight: 900; color: var(--esz-yellow); max-width: 600px; line-height: 1.1; }

/* Main Layout */
.main-layout {
    width: 100%;
    margin: 40px 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.sidebar {
    display: flex;
    flex-direction: row; /* Aligne le classement et facebook côte à côte sur ordinateur */
    gap: 40px;
    align-items: flex-start; /* Aligne les titres en haut */
    flex-wrap: wrap;
    margin-bottom: 40px;
    width: 100%; 
    justify-content: space-evenly; /* Place chaque tableau au centre de sa moitié d'écran */
}

/* Standings */
.standings-card { 
    background: var(--card-bg); 
    border: 1px solid var(--card-border); 
    padding: 20px; 
    border-radius: 4px; 
    flex: 1 1 350px; 
    max-width: 400px; 
    width: 100%;
}

/* Titres des Cartes (Classement & Facebook) */
.card-title {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 20px;
    border-left: 5px solid var(--esz-red);
    padding-left: 10px;
    text-transform: uppercase;
    color: var(--text-color);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.standings-table th {
    background: var(--body-bg);
    padding: 10px 5px;
    text-align: center;
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--card-border);
}

.standings-table td {
    padding: 10px 5px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-logo-mini {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
    border: 1px solid #eee;
}

.esz-highlight {
    background: linear-gradient(90deg, #fff9c4, #fffde7) !important;
    border-left: 6px solid var(--esz-red) !important;
}

/* Utility for responsive table */
@media (max-width: 600px) {
    .hide-mobile { display: none; }
}

/* News Feed */
.facebook-feed {
    flex: 1 1 500px;
    min-width: 320px;
    max-width: 540px; /* 500px width + 40px padding */
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 4px;
}

.facebook-feed .card-title {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.section-title { font-weight: 900; font-size: 24px; margin-bottom: 30px; }
.news-grid { display: grid; gap: 20px; }
.news-item { background: var(--card-bg); display: flex; height: 180px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.news-img { width: 250px; background-size: cover; background-position: center; }
.news-item { transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; }
.news-item:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
}
.news-info { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.news-cat { color: var(--esz-red); font-weight: 900; font-size: 10px; margin-bottom: 5px; display: block; }
.news-info h4 { font-size: 18px; font-weight: 900; margin-bottom: 10px; }
.news-info p { font-size: 14px; color: var(--text-color); opacity: 0.7; line-height: 1.5; }

/* Squad Styles */
.squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.player-card { background: var(--card-bg); border-bottom: 4px solid var(--esz-red); transition: 0.3s; text-align: center; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.player-card:hover { transform: translateY(-10px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.player-img-placeholder { width: 100%; height: 220px; background: var(--body-bg); display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--card-border); }
.player-info { padding: 15px; }
.player-number { display: block; font-weight: 900; color: var(--esz-red); font-size: 22px; line-height: 1; margin-bottom: 5px; }
.player-info h4 { font-weight: 900; text-transform: uppercase; font-size: 15px; margin-bottom: 5px; color: var(--text-color); }
.player-info p { color: #888; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.position-divider { grid-column: 1 / -1; font-weight: 900; font-size: 18px; color: var(--text-color); border-left: 5px solid var(--esz-yellow); padding-left: 15px; margin: 20px 0 10px 0; text-transform: uppercase; }

/* Sponsors Section */
.sponsors-section { background: var(--card-bg); padding: 60px 0; border-top: 1px solid var(--card-border); margin-top: 40px; }
.sponsors-title { text-align: center; font-size: 14px; font-weight: 900; color: #bbb; letter-spacing: 3px; margin-bottom: 40px; }
.sponsors-flex { display: flex; justify-content: center; align-items: center; gap: 50px; flex-wrap: wrap; opacity: 0.6; }
.sponsors-flex img { 
    height: 50px; 
    filter: grayscale(100%); 
    transition: all 0.4s ease; 
    cursor: pointer;
}
.sponsors-flex img:hover { 
    filter: grayscale(0%); 
    opacity: 1; 
    transform: scale(1.1); 
}

/* Map Section */
.map-section {
    background: var(--card-bg);
    padding: 40px 0;
    border-top: 1px solid var(--card-border);
}
.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--card-border);
}

/* Séparateur de carte */
.map-separator {
    width: 1px; /* Largeur de la bande */
    background-color: var(--card-border); /* Couleur grise */
    margin: 0 20px; /* Espacement autour de la bande */
    height: auto; /* S'étire avec le contenu */
    align-self: stretch; /* S'assure que la bande prend toute la hauteur */
}

@media (max-width: 768px) {
    .map-separator { display: none; } /* Cache la bande sur mobile */
}

@media (max-width: 900px) {
    .sidebar {
        flex-direction: column-reverse; /* يضع الفيسبوك في الأعلى والترتيب في الأسفل */
        align-items: center;
        gap: 30px;
    }
    .standings-card, .facebook-feed {
        max-width: 100%;
    }
    .nav-container { justify-content: space-between; }
    .logo-wrapper { order: 1; margin: 0; left: 0; }
    .mobile-menu-btn { display: block; z-index: 2000; position: relative; order: -1; } /* Bouton à gauche */
    .nav-links { 
        display: flex; 
        position: fixed; 
        top: 0; 
        left: -300px; 
        width: 300px; 
        height: 100vh;
        background: var(--esz-black);
        flex-direction: column; 
        padding: 160px 40px; /* زيادة المسافة لتنزيل الأزرار للأسفل */
        gap: 25px; 
        justify-content: flex-start;
        align-items: flex-start;
        order: 2;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 20px rgba(0,0,0,0.5);
        z-index: 1500;
        border-right: 4px solid var(--esz-yellow);
    }
    .nav-links.active { 
        left: 0;
    }
    .nav-right.active {
        top: 0;
        padding-top: 315px; /* تعديل المسافة لتبقى ملاصقة لزر EQUIPE PREMIERE بعد التغيير أعلاه */
        background: transparent;
        box-shadow: none;
        border-right: none;
        top: 285px; /* تحديد موضع القائمة الثانية لتبدأ بعد انتهاء القائمة الأولى */
        /* التأكد من أن القائمة الثانية لها نفس تصميم القائمة الأولى */
        background: var(--esz-black);
        box-shadow: 10px 0 20px rgba(0,0,0,0.5);
        border-right: 4px solid var(--esz-yellow);
        padding-top: 25px; /* إضافة مسافة داخلية بسيطة بين القائمتين */
    }
    .nav-links a { font-size: 15px; }
    .hero h1 { font-size: 40px; }
}

/* Footer Styles */
.main-footer {
    background: var(--esz-black);
    color: #fff;
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
    border-top: 4px solid var(--esz-yellow);
}
.main-footer p { margin-bottom: 10px; font-weight: 700; }

/* Bouton Retour en haut */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--esz-red);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    z-index: 2000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.3s;
}
#back-to-top:hover { background: var(--esz-black); color: var(--esz-yellow); }

/* Styles pour les données Live du Scraper */
.live-rank-display {
    text-align: center;
    padding: 20px;
    background: #fff;
    border: 2px solid var(--esz-red);
    border-radius: 8px;
}
.live-rank-val {
    font-size: 64px;
    font-weight: 900;
    color: var(--esz-red);
    display: block;
    line-height: 1;
}
.live-score-pulse {
    color: var(--esz-red) !important;
    font-size: 48px !important;
    animation: blinker 1.5s linear infinite;
}
.live-tag {
    color: var(--esz-red);
    font-weight: 900;
    font-size: 11px;
    margin-top: 10px;
}

/* Maillot Rayé ESZ */
.jersey-striped {
    width: 120px;
    height: 120px;
    margin: 0 auto 25px;
    position: relative;
    background: 
        /* Col Blanc Style 2025-26 */
        radial-gradient(circle at 50% -10%, #fff 35%, transparent 36%),
        /* Bandes verticales Sang et Or */
        repeating-linear-gradient(
            90deg,
            var(--esz-yellow),
            var(--esz-yellow) 20px,
            var(--esz-red) 20px,
            var(--esz-red) 40px
        );
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M211.8 0c-31.3 0-59.5 18.7-71.4 47.7L99 148.5c-4.7 11.4-16 18.6-28.2 18.6H32c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32h32c10.1 0 19.6-4.7 25.6-12.8L128 261.2V480c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V261.2l38.4 51.2c6 8.1 15.5 12.8 25.6 12.8h32c17.7 0 32-14.3 32-32v-96c0-17.7-14.3-32-32-32h-38.8c-12.2 0-23.5-7.2-28.2-18.6L499.6 47.7C487.7 18.7 459.5 0 428.2 0H211.8z"/></svg>') no-repeat center;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M211.8 0c-31.3 0-59.5 18.7-71.4 47.7L99 148.5c-4.7 11.4-16 18.6-28.2 18.6H32c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32h32c10.1 0 19.6-4.7 25.6-12.8L128 261.2V480c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V261.2l38.4 51.2c6 8.1 15.5 12.8 25.6 12.8h32c17.7 0 32-14.3 32-32v-96c0-17.7-14.3-32-32-32h-38.8c-12.2 0-23.5-7.2-28.2-18.6L499.6 47.7C487.7 18.7 459.5 0 428.2 0H211.8z"/></svg>') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.jersey-crest {
    position: absolute;
    top: 25%;
    left: 20%;
    width: 20px;
    height: 20px;
    background: url('assets/images/logo_esz.png') no-repeat center;
    background-size: contain;
}

.jersey-sponsor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    font-size: 8px;
    font-weight: 900;
    color: #000;
    text-align: center;
    font-family: sans-serif;
    opacity: 0.8;
}

@keyframes blinker {
    50% { opacity: 0.3; }
}
    );
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M211.8 0c-31.3 0-59.5 18.7-71.4 47.7L99 148.5c-4.7 11.4-16 18.6-28.2 18.6H32c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32h32c10.1 0 19.6-4.7 25.6-12.8L128 261.2V480c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V261.2l38.4 51.2c6 8.1 15.5 12.8 25.6 12.8h32c17.7 0 32-14.3 32-32v-96c0-17.7-14.3-32-32-32h-38.8c-12.2 0-23.5-7.2-28.2-18.6L499.6 47.7C487.7 18.7 459.5 0 428.2 0H211.8z"/></svg>') no-repeat center;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M211.8 0c-31.3 0-59.5 18.7-71.4 47.7L99 148.5c-4.7 11.4-16 18.6-28.2 18.6H32c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32h32c10.1 0 19.6-4.7 25.6-12.8L128 261.2V480c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V261.2l38.4 51.2c6 8.1 15.5 12.8 25.6 12.8h32c17.7 0 32-14.3 32-32v-96c0-17.7-14.3-32-32-32h-38.8c-12.2 0-23.5-7.2-28.2-18.6L499.6 47.7C487.7 18.7 459.5 0 428.2 0H211.8z"/></svg>') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

@keyframes blinker {
    50% { opacity: 0.3; }
}
    bottom: 30px;
    right: 30px;
    background: var(--esz-red);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    z-index: 2000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.3s;
}
#back-to-top:hover { background: var(--esz-black); color: var(--esz-yellow); }