:root {
    --brand: #111111;
    --brand-dark: #000000;
    --brand-light: #333333;
    --accent: #000000;
    --live: #000000;
    --bg: #f2f2f2;
    --card-bg: #ffffff;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    color: #1f2933;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }

/* ===== Navbar ===== */
.app-navbar {
    background: #000000;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    border-bottom: 1px solid #222;
}
.app-navbar .navbar-brand { font-size: 1.35rem; letter-spacing: .3px; }
.brand-logo { height: 40px; width: auto; object-fit: contain; display: block; }
.app-navbar .nav-link { font-weight: 600; opacity: .85; transition: opacity .2s; }
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active { opacity: 1; }
.lang-btn { font-weight: 600; }

/* ===== Live dot ===== */
.live-dot {
    display: inline-block;
    width: 9px; height: 9px;
    background: var(--live);
    border-radius: 50%;
    margin: 0 3px;
    animation: pulse 1.3s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0,0,0,.5); }
    70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* ===== Page head (legacy) ===== */
.page-head h1 { font-weight: 700; }

/* ===== Unified page hero ===== */
.page-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #000 0%, #1c1c1c 55%, #333 100%);
    border-radius: 18px;
    padding: 1.9rem 1.75rem;
    margin-bottom: 1.75rem;
    color: #fff;
    box-shadow: 0 6px 22px rgba(0,0,0,.22);
}
.page-hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 12px, transparent 12px 24px);
    pointer-events: none;
}
.page-hero::after {
    content: ""; position: absolute; inset-inline-start: 0; bottom: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, #fff, rgba(255,255,255,.15));
}
.page-hero-content {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
}
.page-hero-title {
    font-weight: 800; font-size: 1.7rem; margin: 0;
    display: flex; align-items: center; gap: .65rem; line-height: 1.25;
}
.page-hero-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 12px;
    background: rgba(255,255,255,.12); font-size: 1.35rem;
    border: 1px solid rgba(255,255,255,.15);
}
.page-hero-sub { margin: .55rem 0 0; color: rgba(255,255,255,.72); font-size: .95rem; font-weight: 500; }
.page-hero-extra { position: relative; z-index: 2; }
.page-hero-watermark {
    position: absolute; z-index: 1; bottom: -1.5rem; inset-inline-end: -0.5rem;
    font-size: 8rem; color: rgba(255,255,255,.05); transform: rotate(-8deg);
    pointer-events: none;
}
@media (max-width: 575.98px) {
    .page-hero { padding: 1.4rem 1.2rem; border-radius: 14px; }
    .page-hero-title { font-size: 1.3rem; }
    .page-hero-icon { width: 40px; height: 40px; font-size: 1.15rem; }
    .page-hero-watermark { font-size: 6rem; }
}

/* ===== Filters ===== */
.filters { border: none; box-shadow: 0 2px 10px rgba(0,0,0,.05); border-radius: 14px; }

/* ===== League group ===== */
.league-group { margin-bottom: 2rem; }
.league-group-title {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; margin-bottom: 1rem;
    padding-bottom: .5rem; border-bottom: 2px solid #e3e8ee;
}
.league-group-logo { height: 26px; width: 26px; object-fit: contain; }

/* ===== Match card ===== */
.match-card {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    overflow: hidden;
    height: 100%;
    transition: transform .18s, box-shadow .18s;
    border: 1px solid #eef1f4;
}
.match-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.1); }
.match-card.is-live { border-color: #111; }

.match-league {
    display: flex; align-items: center; gap: 6px;
    padding: .5rem .9rem;
    background: #f8fafc;
    font-size: .78rem; color: #64748b; font-weight: 600;
    border-bottom: 1px solid #eef1f4;
}
.league-mini-logo { height: 16px; width: 16px; object-fit: contain; }

.match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .5rem;
    padding: 1rem .9rem;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.team-logo { height: 44px; width: 44px; object-fit: contain; }
.team-name { font-size: .85rem; font-weight: 600; line-height: 1.2; }

.match-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 78px; }
.score { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; }
.score span { color: #cbd5e1; font-weight: 400; }
.score-vs { font-size: 1.1rem; font-weight: 700; color: #94a3b8; }

.status-badge {
    font-size: .72rem; font-weight: 700;
    padding: 2px 10px; border-radius: 20px;
    white-space: nowrap;
    display: inline-flex; align-items: center;
}
.status-live { background: #111; color: #fff; }
.status-finished { background: #eee; color: #555; }
.status-upcoming { background: #e8e8e8; color: #111; }

/* ===== Empty state ===== */
.empty-state { background: var(--card-bg); border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }

/* ===== Standings ===== */
.standings-wrap { background: var(--card-bg); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; }
.standings-table thead th {
    background: var(--brand-dark); color: #fff;
    font-size: .8rem; font-weight: 700; border: none;
    white-space: nowrap;
}
.standings-table td { border-color: #eef1f4; font-size: .9rem; }
.standings-table tbody tr:hover { background: #f8fafc; }
.team-logo-sm { height: 26px; width: 26px; object-fit: contain; }
.points-cell { color: var(--brand); font-size: 1rem; }
.group-title { font-weight: 700; font-size: 1rem; color: var(--brand-dark); display: flex; align-items: center; gap: 6px; }

.standings-table tr.qual-ucl td:first-child { box-shadow: inset 3px 0 0 #000; }
.standings-table tr.qual-uel td:first-child { box-shadow: inset 3px 0 0 #777; }
.standings-table tr.relegation td:first-child { box-shadow: inset 3px 0 0 #aaa; }
html[dir="rtl"] .standings-table tr.qual-ucl td:first-child { box-shadow: inset -3px 0 0 #000; }
html[dir="rtl"] .standings-table tr.qual-uel td:first-child { box-shadow: inset -3px 0 0 #777; }
html[dir="rtl"] .standings-table tr.relegation td:first-child { box-shadow: inset -3px 0 0 #aaa; }

.legend-box { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; border: 1px solid #ddd; }
.legend-box.qual-ucl { background: #000; }
.legend-box.qual-uel { background: #777; }
.legend-box.relegation { background: #aaa; }

/* ===== Footer ===== */
.app-footer { background: #000; border-top: 1px solid #222; color: #cfcfcf; flex-shrink: 0; }
.app-footer .fw-bold { color: #fff; }
.footer-logo { height: 54px; width: auto; object-fit: contain; }
.app-footer .text-muted { color: #9a9a9a !important; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.2rem; }
.footer-links a { color: #cfcfcf; text-decoration: none; font-size: .85rem; font-weight: 600; }
.footer-links a:hover { color: #fff; }

/* ===== Article cards & news ===== */
.article-card {
    display: block; height: 100%; text-decoration: none; color: inherit;
    background: var(--card-bg); border-radius: 14px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06); border: 1px solid #eef1f4;
    transition: transform .18s, box-shadow .18s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.1); color: inherit; }
.article-thumb {
    height: 170px; background-size: cover; background-position: center; background-color: #111;
    position: relative;
}
.article-thumb.no-cover {
    background: linear-gradient(135deg, #000, #3a3a3a);
    display: flex; align-items: center; justify-content: center;
}
.article-thumb .thumb-icon { font-size: 2.6rem; color: rgba(255,255,255,.28); }
.article-cat {
    position: absolute; inset-inline-start: 10px; top: 10px;
    background: #000; color: #fff; font-size: .72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
}
.article-body { padding: 1rem; }
.article-title { font-size: 1.02rem; font-weight: 700; line-height: 1.4; margin-bottom: .5rem; }
.article-excerpt { font-size: .85rem; color: #64748b; line-height: 1.6; margin-bottom: .6rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { font-size: .75rem; color: #94a3b8; }

/* Full article */
.article-full { background: var(--card-bg); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 2rem; max-width: 820px; margin: 0 auto; }
.article-full-title { font-weight: 800; font-size: 1.7rem; line-height: 1.4; }
.article-full-cover { width: 100%; border-radius: 12px; max-height: 420px; object-fit: cover; }
.article-full-body { font-size: 1.05rem; line-height: 2; color: #1f2933; }
.article-full-body p { margin-bottom: 1rem; }
.article-full-body h2 { font-size: 1.35rem; font-weight: 700; margin: 1.5rem 0 .8rem; color: var(--brand-dark); }
.article-full-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.2rem 0 .6rem; }
.article-full-body ul, .article-full-body ol { padding-inline-start: 1.6rem; margin-bottom: 1rem; }
.article-full-body a { color: #111; text-decoration: underline; }
.article-full-body img { max-width: 100%; border-radius: 10px; margin: 1rem 0; }

/* ===== Content pages (about/privacy/terms/contact) ===== */
.content-page { background: var(--card-bg); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.05); padding: 2rem; max-width: 860px; margin: 0 auto; line-height: 1.9; }
.content-page h1 { font-weight: 700; }
.content-page h2 { font-weight: 700; color: var(--brand-dark); }
.content-page a { color: var(--brand); }
.content-page ul { padding-inline-start: 1.5rem; }

/* ===== Date hero (jdwel-style tabs) ===== */
.date-hero {
    background: #000000;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.date-tabs { display: flex; gap: .5rem; justify-content: center; }
.date-tab {
    flex: 1; max-width: 160px;
    text-align: center; padding: .6rem .4rem;
    border-radius: 12px; text-decoration: none;
    color: rgba(255,255,255,.8); font-weight: 700;
    background: rgba(255,255,255,.1);
    transition: all .2s; display: flex; flex-direction: column; gap: 3px;
    align-items: center;
}
.date-tab i { font-size: 1.1rem; }
.date-tab:hover { background: rgba(255,255,255,.2); color: #fff; }
.date-tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.date-picker-row { display: flex; justify-content: center; margin-top: .8rem; }
.date-picker-row form { background: rgba(255,255,255,.15); padding: .3rem .6rem; border-radius: 10px; }
.current-date { color: #fff; font-weight: 600; font-size: .9rem; }
.date-input { max-width: 150px; border: none; }

/* ===== League filter bar ===== */
.league-filter-bar { background: var(--card-bg); padding: .6rem 1rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }

/* ===== League block (list) ===== */
.league-block { background: var(--card-bg); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; margin-bottom: 1.2rem; }
.league-block-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .7rem 1rem; background: #f8fafc; border-bottom: 1px solid #eef1f4;
}
.lbh-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.lbh-title small { color: #94a3b8; font-weight: 500; }
.lbh-logo { height: 22px; width: 22px; object-fit: contain; }
.lbh-standings { font-size: .8rem; color: var(--brand); text-decoration: none; font-weight: 600; white-space: nowrap; }
.lbh-standings:hover { color: var(--brand-dark); }

/* ===== Match row ===== */
.match-row {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: .5rem; padding: .8rem 1rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid #f1f4f7; transition: background .15s;
}
.match-row:last-child { border-bottom: none; }
.match-row:hover { background: #f8fafc; }
.match-row.is-live { background: #f6f6f6; }

.mr-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mr-home { justify-content: flex-end; }
.mr-away { justify-content: flex-start; }
.mr-logo { height: 30px; width: 30px; object-fit: contain; flex-shrink: 0; }
.mr-team-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-team.winner .mr-team-name { color: var(--brand-dark); font-weight: 800; }

.mr-center { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 70px; }
.mr-score { font-size: 1.2rem; font-weight: 800; letter-spacing: 1px; }
.mr-time { font-size: 1rem; font-weight: 700; color: var(--brand); }
.mr-status {
    font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
}
.mr-status.status-live { background: #111; color: #fff; }
.mr-status.status-finished { background: #eee; color: #555; }
.mr-status.status-upcoming { background: transparent; color: #888; }

.player-photo { height: 36px; width: 36px; border-radius: 50%; object-fit: cover; background: #eef1f4; }

/* ===== Fixture details ===== */
.fixture-hero { border: none; box-shadow: 0 2px 12px rgba(0,0,0,.07); border-radius: 16px; overflow: hidden; }
.fh-league { padding: .6rem 1rem; background: #f8fafc; border-bottom: 1px solid #eef1f4; font-size: .82rem; color: #64748b; font-weight: 600; display: flex; align-items: center; gap: 6px; justify-content: center; }
.fh-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.5rem 1rem; }
.fh-team { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.fh-logo { height: 64px; width: 64px; object-fit: contain; }
.fh-name { font-weight: 700; font-size: 1rem; }
.fh-center { text-align: center; }
.fh-score { font-size: 2.2rem; font-weight: 800; letter-spacing: 3px; }
.fh-vs { font-size: 1.4rem; font-weight: 700; color: var(--brand); }
.fh-meta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; padding: .8rem 1rem; background: #f8fafc; border-top: 1px solid #eef1f4; font-size: .82rem; color: #64748b; }

.fixture-tabs .nav-link { color: var(--brand-dark); font-weight: 600; }
.fixture-tabs .nav-link.active { background: var(--brand); }

/* Events timeline */
.events-timeline { display: flex; flex-direction: column; gap: .5rem; }
.event-item { display: flex; }
.event-item.ev-home { justify-content: flex-start; }
.event-item.ev-away { justify-content: flex-end; }
.ev-side { display: flex; align-items: center; gap: 8px; max-width: 60%; }
.event-item.ev-away .ev-side { flex-direction: row-reverse; text-align: end; }
.ev-min { font-weight: 700; color: var(--brand); font-size: .82rem; min-width: 34px; }
.ev-player { font-size: .88rem; font-weight: 600; }
.ev-card { display: inline-block; width: 11px; height: 15px; border-radius: 2px; }
.ev-yellow { background: #f5c518; }
.ev-red { background: #dc2626; }

/* Lineups */
.lineup-list { list-style: none; padding: 0; margin: 0; }
.lineup-list li { padding: .35rem 0; border-bottom: 1px dashed #eef1f4; font-size: .9rem; }
.lineup-list.subs li { opacity: .75; font-size: .85rem; }
.pl-num { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; background: var(--brand); color: #fff; border-radius: 6px; font-size: .75rem; font-weight: 700; margin-inline-end: 6px; }

/* Statistics */
.stat-row { margin-bottom: 1rem; }
.stat-vals { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
.stat-type { color: #94a3b8; font-weight: 500; }
.stat-bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: #eef1f4; }
.stat-bar-home { background: var(--brand); }
.stat-bar-away { background: var(--accent); }

/* ===== Featured competitions ===== */
.featured-comps { margin-top: 2.5rem; }
.featured-title {
    font-size: 1.3rem; font-weight: 700; margin-bottom: 1.2rem;
    padding-bottom: .6rem; border-bottom: 3px solid var(--brand);
    display: inline-block;
}
.featured-title .bi { color: var(--accent); }
.comp-card {
    background: var(--card-bg); border-radius: 14px; height: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,.06); border: 1px solid #eef1f4;
    overflow: hidden; transition: transform .18s, box-shadow .18s;
    display: flex; flex-direction: column;
}
.comp-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.comp-head {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 1.1rem .8rem .8rem; text-align: center;
    background: linear-gradient(180deg, #f8fafc, #fff);
}
.comp-logo { height: 46px; width: 46px; object-fit: contain; }
.comp-name { font-weight: 700; font-size: .88rem; line-height: 1.25; min-height: 2.4em; display: flex; align-items: center; }
.comp-links { display: flex; flex-direction: column; border-top: 1px solid #eef1f4; margin-top: auto; }
.comp-links a {
    padding: .5rem .8rem; font-size: .8rem; font-weight: 600;
    color: #475569; text-decoration: none; text-align: center;
    border-bottom: 1px solid #f1f4f7; transition: background .15s, color .15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.comp-links a:last-child { border-bottom: none; }
.comp-links a:hover { background: var(--brand); color: #fff; }
.comp-links a .bi { font-size: .9rem; opacity: .8; }

/* ===== Mobile ===== */
@media (max-width: 575.98px) {
    .app-navbar .navbar-brand { font-size: 1.15rem; }
    .brand-logo { height: 34px; }
    .comp-name { font-size: .8rem; min-height: 2.6em; }
    .comp-logo { height: 40px; width: 40px; }
    .comp-links a { font-size: .74rem; padding: .45rem .5rem; }
    .date-tab span { font-size: .8rem; }
    .mr-team-name { font-size: .8rem; }
    .mr-logo { height: 26px; width: 26px; }
    .mr-score { font-size: 1.05rem; }
    .fh-logo { height: 48px; width: 48px; }
    .fh-score { font-size: 1.7rem; }
    .fh-name { font-size: .85rem; }
    .match-row { padding: .7rem .6rem; }
}

/* ===== Monochrome (أبيض وأسود) overrides ===== */
.btn-primary { background: #111; border-color: #111; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: #000; border-color: #000; }
.btn-outline-primary { color: #111; border-color: #111; }
.btn-outline-primary:hover { background: #111; border-color: #111; color: #fff; }
.btn-outline-secondary { color: #333; border-color: #ccc; }
.btn-outline-secondary:hover { background: #333; border-color: #333; color: #fff; }
.bg-danger { background-color: #111 !important; }
.bg-secondary { background-color: #555 !important; }
.text-danger, .text-success, .text-warning { color: #111 !important; }
.stat-bar-away { background: #bbb; }
.fixture-tabs .nav-link { color: #111; }
.fixture-tabs .nav-link.active { background: #111; color: #fff; }
.form-select:focus, .form-control:focus { border-color: #111; box-shadow: 0 0 0 .2rem rgba(0,0,0,.12); }
.content-page a, .lbh-standings, .lbh-standings:hover { color: #111; }
