/* ============================================
   STING WEB — MAIN STYLESHEET
   Direction: RTL | Language: AR/EN
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Bebas+Neue&display=swap');

:root {
  --bg:         #0a0c10;
  --bg2:        #0f1117;
  --bg3:        #161925;
  --card:       #13161f;
  --card-h:     #1a1e2a;
  --border:     rgba(255,255,255,.06);
  --border-h:   rgba(255,255,255,.12);
  --accent:     #e8ff47;
  --accent2:    #47b3ff;
  --red:        #ff4757;
  --green:      #2ed573;
  --orange:     #ffa502;
  --text:       #e8eaf0;
  --text-dim:   #7a808f;
  --text-muted: #4a5060;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 48px rgba(0,0,0,.6);
  --font:       'Tajawal', sans-serif;
  --font-num:   'Bebas Neue', cursive;
  --trans:      .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.en { direction: ltr; }

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ── Utility ── */
.hidden { display: none !important; }
.flex   { display: flex; }
.center { align-items: center; justify-content: center; }

/* ================================================
   HEADER
   ================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,12,16,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo */
.logo {
  font-family: var(--font-num);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--accent);
  white-space: nowrap;
}
.logo span { color: var(--text-dim); font-size: 13px; letter-spacing: 1px; }

/* Nav */
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-btn {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: var(--trans);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.nav-btn:hover { color: var(--text); background: var(--bg3); }
.nav-btn.active {
  color: var(--accent);
  background: rgba(232,255,71,.08);
}
.nav-btn svg { width: 16px; height: 16px; }

/* Lang toggle */
.lang-toggle {
  margin-right: auto;
  display: flex;
  gap: 4px;
}
body.en .lang-toggle { margin-right: 0; margin-left: auto; }
.lang-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: var(--trans);
}
.lang-btn.active, .lang-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(232,255,71,.06);
}

/* ================================================
   MAIN LAYOUT
   ================================================ */
#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Sidebar ── */
#sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-section { }
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* Date picker */
.date-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.date-strip::-webkit-scrollbar { display: none; }
.date-pill {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--trans);
  text-align: center;
}
.date-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.date-pill .day-name { font-size: 10px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; }
.date-pill.active .day-name { color: rgba(0,0,0,.6); }
.date-pill .day-num { font-family: var(--font-num); font-size: 20px; line-height: 1; margin-top: 2px; }

/* Competition list */
.comp-list { display: flex; flex-direction: column; gap: 2px; }
.comp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--trans);
  font-size: 13px;
  color: var(--text-dim);
}
.comp-item:hover, .comp-item.active {
  background: var(--card-h);
  color: var(--text);
}
.comp-item.active { color: var(--accent); }
.comp-logo {
  width: 22px; height: 22px;
  border-radius: 4px;
  object-fit: contain;
  background: var(--bg3);
  flex-shrink: 0;
}

/* ── Main content ── */
#main-content { min-width: 0; }

/* ================================================
   PAGES
   ================================================ */
.page { display: none; }
.page.active { display: block; }

/* ── Page header bar ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.page-title {
  font-family: var(--font-num);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--text);
}
.page-header .badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(232,255,71,.12);
  color: var(--accent);
  letter-spacing: 1px;
}

/* ── LIVE indicator ── */
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1.2s infinite;
  display: inline-block;
  margin-left: 6px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ================================================
   MATCH CARD
   ================================================ */
.matches-group { margin-bottom: 20px; }
.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.group-header img { width: 20px; height: 20px; object-fit: contain; }
.group-header .comp-name { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.group-header .match-count { font-size: 11px; color: var(--text-muted); }

.match-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}
.match-card::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: var(--trans);
}
.match-card:hover { background: var(--card-h); }
.match-card:hover::before { background: var(--accent); }
.match-card:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* Team block */
.team-block {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-block.away { flex-direction: row-reverse; }
.team-logo {
  width: 36px; height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--bg3);
  border-radius: 6px;
  padding: 2px;
}
.team-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 120px;
}
.team-block.away .team-name { text-align: right; }

/* Score/time block */
.score-block { text-align: center; }
.score-display {
  font-family: var(--font-num);
  font-size: 28px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--text);
}
.score-sep { color: var(--text-muted); margin: 0 4px; }
.match-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 4px;
  white-space: nowrap;
}
.match-status.live  { color: var(--red); }
.match-status.ended { color: var(--text-muted); }
.match-status.soon  { color: var(--accent2); }

.match-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-num);
  letter-spacing: 1px;
}

/* ================================================
   MATCH DETAILS PAGE
   ================================================ */
#page-details .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  transition: var(--trans);
}
#page-details .back-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Details hero */
.details-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}
.details-cup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.details-cup img { width: 28px; height: 28px; }
.details-cup-name { font-size: 14px; font-weight: 700; }
.details-cup-status { margin-right: auto; }
body.en .details-cup-status { margin-right: 0; margin-left: auto; }

.details-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.details-team { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.details-team-logo {
  width: 64px; height: 64px;
  object-fit: contain;
  background: var(--bg3);
  border-radius: 12px;
  padding: 4px;
}
.details-team-name { font-size: 16px; font-weight: 700; text-align: center; }
.details-score-block { text-align: center; }
.details-score {
  font-family: var(--font-num);
  font-size: 52px;
  letter-spacing: 4px;
  line-height: 1;
}
.details-score-sep { color: var(--text-muted); }
.details-time {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Detail tabs */
.detail-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}
.detail-tab {
  flex: 1;
  padding: 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
}
.detail-tab.active {
  background: var(--card);
  color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Events */
.events-list { display: flex; flex-direction: column; gap: 2px; }
.event-row {
  display: grid;
  grid-template-columns: 1fr 50px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: var(--trans);
}
.event-row:hover { background: var(--bg3); }
.event-time {
  text-align: center;
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--accent);
}
.event-icon { font-size: 14px; }
.home-side { text-align: right; }
.away-side { text-align: left; }
body.en .home-side { text-align: left; }
body.en .away-side { text-align: right; }

/* Stats bars */
.stat-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
}
.stat-val { font-weight: 700; text-align: center; font-family: var(--font-num); font-size: 18px; }
.stat-bar-wrap { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--bg3); }
.stat-bar-home { height: 100%; background: var(--accent); border-radius: 3px 0 0 3px; transition: width .6s ease; }
.stat-bar-away { height: 100%; background: var(--accent2); border-radius: 0 3px 3px 0; transition: width .6s ease; }

/* H2H */
.h2h-list { display: flex; flex-direction: column; gap: 6px; }
.h2h-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: 8px;
  font-size: 13px;
}
.h2h-date { text-align: center; font-size: 11px; color: var(--text-muted); }
.h2h-score { font-family: var(--font-num); font-size: 20px; letter-spacing: 2px; text-align: center; }
.h2h-team { font-size: 13px; font-weight: 600; }
.h2h-team.away { text-align: left; }
body.en .h2h-team.away { text-align: right; }

/* Lineups */
.lineups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lineup-col { }
.lineup-col-title { font-size: 13px; font-weight: 700; padding: 8px 0; border-bottom: 2px solid var(--accent); margin-bottom: 8px; }
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  transition: var(--trans);
  font-size: 13px;
}
.player-row:hover { background: var(--bg3); }
.player-num {
  width: 24px; height: 24px;
  border-radius: 5px;
  background: var(--bg3);
  font-family: var(--font-num);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
}

/* ================================================
   STANDINGS PAGE
   ================================================ */
.standings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.comp-selector {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  flex: 1;
  max-width: 300px;
}
.comp-selector:focus { border-color: var(--accent); }

.standings-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.standings-table th {
  padding: 12px 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.standings-table th.left { text-align: right; }
body.en .standings-table th.left { text-align: left; }
.standings-table td {
  padding: 11px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  transition: var(--trans);
}
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: var(--card-h); }
.standings-table td.left { text-align: right; }
body.en .standings-table td.left { text-align: left; }

.st-team {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.en .st-team { flex-direction: row; }
.st-logo { width: 24px; height: 24px; object-fit: contain; }
.st-name { font-weight: 600; }
.st-pos {
  font-family: var(--font-num);
  font-size: 17px;
  color: var(--text-dim);
  width: 30px;
  text-align: center;
}
.st-pts { font-family: var(--font-num); font-size: 18px; font-weight: 700; color: var(--accent); }

.form-badge {
  display: inline-flex;
  width: 18px; height: 18px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.form-badge.W { background: rgba(46,213,115,.2); color: var(--green); }
.form-badge.D { background: rgba(255,165,2,.2); color: var(--orange); }
.form-badge.L { background: rgba(255,71,87,.2); color: var(--red); }

/* Promotion zones */
.zone-cl    { border-right: 3px solid #4af0ff; }
.zone-el    { border-right: 3px solid #ff9f43; }
.zone-rel   { border-right: 3px solid var(--red); }
body.en .zone-cl  { border-right: none; border-left: 3px solid #4af0ff; }
body.en .zone-el  { border-right: none; border-left: 3px solid #ff9f43; }
body.en .zone-rel { border-right: none; border-left: 3px solid var(--red); }

/* ================================================
   LOADING SKELETON
   ================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--card-h) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.sk-card { height: 68px; margin-bottom: 2px; }
.sk-header { height: 44px; margin-bottom: 2px; border-radius: var(--radius) var(--radius) 0 0; }

/* ================================================
   EMPTY / ERROR STATE
   ================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 15px; }

/* ================================================
   MOBILE
   ================================================ */
@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  #sidebar { position: static; }
  .header-inner { padding: 0 12px; }
  .main-nav { gap: 2px; }
  .nav-btn span { display: none; }
  .lineups-grid { grid-template-columns: 1fr; }
  .details-teams { gap: 10px; }
  .details-score { font-size: 40px; }
  .details-team-logo { width: 50px; height: 50px; }
}

@media (max-width: 600px) {
  .team-name { font-size: 12px; max-width: 90px; }
  .team-logo { width: 30px; height: 30px; }
  .standings-table th, .standings-table td { padding: 8px 10px; font-size: 12px; }
}
