/* ==================================================================
   Koora Live - site styles. Mobile-first, RTL, dark theme.
   ================================================================== */
:root {
    --bg: #070b14;
    --bg-2: #0d1320;
    --card: #111a2b;
    --card-2: #16223a;
    --line: #1e2c45;
    --text: #eaf1fb;
    --muted: #93a4bd;
    --brand: #16b866;
    --brand-2: #0f9c55;
    --live: #ef4444;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --container: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 16px;
}

/* ---- Header ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 14, 24, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 62px;
}

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.brand__mark {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 9px; color: #04140c; font-size: 14px;
}
.brand__name { font-size: 20px; }

.site-nav { display: none; align-items: center; gap: 4px; }
.site-nav a {
    padding: 8px 12px; border-radius: 9px; color: var(--muted);
    font-weight: 600; font-size: 15px; transition: background .2s, color .2s;
}
.site-nav a:hover { color: var(--text); background: var(--card); }

.nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    background: transparent; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
    background: radial-gradient(1200px 400px at 50% -80px, rgba(22, 184, 102, .22), transparent 70%), var(--bg-2);
    padding: 40px 0 28px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}
.hero__title { margin: 0 0 6px; font-size: 30px; font-weight: 800; }
.hero__subtitle { margin: 0; color: var(--muted); font-size: 15px; }

/* ---- Blocks ---- */
.page { padding-bottom: 40px; }
.block { margin-top: 28px; }
.block__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.block__title {
    font-size: 19px; font-weight: 800; margin: 0; position: relative; padding-inline-start: 14px;
}
.block__title::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
    width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(var(--brand), var(--brand-2));
}
.block__more { color: var(--brand); font-weight: 700; font-size: 14px; }
.empty { color: var(--muted); padding: 20px; text-align: center; background: var(--card); border-radius: var(--radius); }

/* ---- Match grid / cards ---- */
.matches-grid {
    display: grid; gap: 14px;
    grid-template-columns: 1fr;
}

.match-card {
    display: flex; flex-direction: column; gap: 12px;
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.match-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }

.match-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.match-card__league { color: var(--muted); font-size: 12px; font-weight: 600; }

.match-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
    background: var(--card-2); color: var(--muted);
}
.match-status--live { background: rgba(239, 68, 68, .15); color: #ff8a8a; }
.match-status--finished { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.match-status .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--live);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); animation: pulse 1.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

.match-card__teams { display: flex; align-items: center; justify-content: space-around; gap: 8px; }
.team { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.team__logo { width: 52px; height: 52px; object-fit: contain; }
.team__name { font-size: 14px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.match-card__vs { color: var(--muted); font-weight: 800; font-size: 13px; }

.match-card__meta { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.match-card__cta {
    text-align: center; padding: 9px; border-radius: 10px; font-weight: 700; font-size: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #04140c;
}

/* ---- News grid ---- */
.news-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.news-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.news-card__image { aspect-ratio: 16 / 9; background: var(--card-2); }
.news-card__image img { width: 100%; height: 100%; object-fit: cover; }
.news-card__body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.news-card__cat { color: var(--brand); font-size: 12px; font-weight: 700; }
.news-card__title { margin: 0; font-size: 16px; font-weight: 700; }
.news-card__excerpt { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Match page ---- */
.crumbs { color: var(--muted); font-size: 13px; padding: 14px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--brand); }

.match-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
.player-shell { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.player-frame { position: relative; aspect-ratio: 16 / 9; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.match-headline { margin-top: 16px; }
.match-headline__title { margin: 8px 0; font-size: 22px; font-weight: 800; }
.match-headline__meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }

.server-switch { margin-top: 18px; }
.server-switch__label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.server-switch__list { display: flex; flex-wrap: wrap; gap: 8px; }
.server-chip {
    padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--muted); transition: .2s;
}
.server-chip:hover { color: var(--text); border-color: var(--brand); }
.server-chip.is-active { background: var(--brand); color: #04140c; border-color: var(--brand); }

.match-content { margin-top: 20px; color: #d5e0f0; line-height: 1.9; }
.match-content img { border-radius: 10px; margin: 10px 0; }
.ad-slot { margin: 18px 0; text-align: center; }

/* ---- Match side ---- */
.side-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.side-block__title { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.side-matches { display: flex; flex-direction: column; gap: 8px; }
.side-match { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--bg-2); }
.side-match:hover { background: var(--card-2); }
.side-match__status { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.side-match__status--live { background: rgba(239, 68, 68, .15); color: #ff8a8a; }
.side-match__title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-news { display: flex; flex-direction: column; }
.side-news__item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.side-news__item:last-child { border-bottom: 0; }

/* ---- Article ---- */
.article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.article__title { font-size: 24px; font-weight: 800; margin: 10px 0; }
.article__meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.article__image { margin: 16px 0; border-radius: 10px; overflow: hidden; }
.article__body { line-height: 1.9; color: #d5e0f0; }
.section-desc { color: var(--muted); margin-bottom: 16px; }

/* ---- Chips / pager ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--brand); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pager__link { min-width: 38px; text-align: center; padding: 8px 10px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.pager__link.is-active { background: var(--brand); color: #04140c; border-color: var(--brand); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; }
.site-footer__inner { display: flex; flex-direction: column; gap: 16px; padding: 26px 16px; }
.site-footer__brand p { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.site-footer__social { display: flex; flex-wrap: wrap; gap: 12px; }
.site-footer__social a { color: var(--muted); font-weight: 600; font-size: 14px; }
.site-footer__social a:hover { color: var(--brand); }
.site-footer__copy { text-align: center; color: var(--muted); font-size: 12px; padding: 14px; border-top: 1px solid var(--line); }

/* ---- Error page ---- */
.error-page { display: grid; place-items: center; min-height: 50vh; }
.error-box { text-align: center; }
.error-code { font-size: 72px; font-weight: 800; color: var(--brand); }
.error-message { color: var(--muted); margin-bottom: 18px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 10px; background: var(--brand); color: #04140c; font-weight: 700; }

/* ---- Responsive ---- */
@media (min-width: 560px) {
    .matches-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .matches-grid { grid-template-columns: repeat(3, 1fr); }
    .news-grid { grid-template-columns: repeat(3, 1fr); }
    .hero__title { font-size: 38px; }
    .match-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .site-footer__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 720px) {
    .site-nav { display: flex; }
    .nav-toggle { display: none; }
}

/* Mobile nav drawer */
@media (max-width: 719px) {
    .site-nav {
        position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch;
        background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px 16px;
        transform: translateY(-120%); transition: transform .25s ease; display: flex; z-index: 49;
    }
    .site-nav.is-open { transform: translateY(0); }
    .site-nav a { padding: 12px; border-bottom: 1px solid var(--line); }
}

@media (min-width: 1024px) {
    .matches-grid { grid-template-columns: repeat(4, 1fr); }
}
