:root {
  --color-bg: #0e1013;
  --color-fg: #eaeaea;
  --color-accent: #1e90ff;
  --color-danger: #e74c3c;
  --color-success: #2ecc71;
  --color-muted: #999;
  --card-bg: #1a1d21;
}

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: 'Cairo', sans-serif;
  margin: 0;
  padding: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  margin: 120px auto;
  max-width: 1000px;
  padding: 0 16px;
}

h2,
h3 {
  font-size: 1.4em;
  margin-top: 20px;
  color: var(--color-fg);
}



.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 36px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 36px;
  height: 100%;
}

.slider:before {
  content: "";
  position: absolute;
  height: 30px;
  width: 30px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--color-accent);
}

input:checked+.slider:before {
  transform: translateX(34px);
}

.live-toggle-label {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--color-fg);
  margin-right: 10px;
}

.top-header {
  background: #111;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5em;
  font-weight: bold;
}

.nav-bar {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
  background: #191b1e;
  margin: 0;
}

.nav-bar li a {
  color: var(--color-fg);
  text-decoration: none;
}

.nav-bar li.active a {
  color: var(--color-accent);
  font-weight: bold;
}

.league-badge {
  width: 100%;
  background: #222;
  border: 1px solid #444;
  padding: 10px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.league-header {
  cursor: pointer;
}

.live-label {
  color: var(--color-danger);
  font-weight: bold;
  font-size: 0.9em;
  letter-spacing: 1px;
}

.live-bar {
  width: 40px;
  height: 4px;
  background: var(--color-danger);
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.live-bar::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 4px;
  background: white;
  animation: slidebar 1s infinite linear;
  border-radius: 2px;
}

.live-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
  color: var(--color-danger);
  margin-top: 6px;
  font-size: 0.9em;
}


.live-dot-wave {
  width: 6px;
  height: 6px;
  background-color: var(--color-success);
  border-radius: 50%;
  margin-top: 4px;
  position: relative;
  animation: waveDotHorizontal 0.8s infinite ease-in-out;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes slidebar {
  0% {
    left: 0;
  }

  50% {
    left: 30px;
  }

  100% {
    left: 0;
  }
}

.rating-table {
  width: 100%;
  border-collapse: collapse;
  background: #1a1d21;
  color: var(--color-fg);
}

.rating-table th,
.rating-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #333;
}

.club-icon,
.flag-icon {
  width: 24px;
  vertical-align: middle;
  margin-left: 6px;
}

.rating-table .up {
  color: var(--color-success);
}

.rating-table .down {
  color: var(--color-danger);
}

.rating-table .same {
  color: var(--color-muted);
}

select {
  background: #1a1d21;
  color: var(--color-fg);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'Cairo', sans-serif;
  margin: 0 10px 10px 0;
}

select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.pagination a {
  display: inline-block;
  padding: 6px 12px;
  margin: 2px;
  background: #1a1d21;
  color: var(--color-fg);
  border: 1px solid #444;
  border-radius: 4px;
  text-decoration: none;
}

.pagination a:hover {
  background: var(--color-accent);
  color: white;
}

.pagination .active a {
  background: var(--color-accent);
  font-weight: bold;
  color: white;
  cursor: default;
}

.rating-pagination {
  margin-top: 24px;
  text-align: center;
}

.rating-pagination a {
  display: inline-block;
  margin: 0 6px;
  padding: 6px 12px;
  background: #1a1d21;
  color: var(--color-fg);
  border: 1px solid #444;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease;
}

.rating-pagination a:hover {
  background: var(--color-accent);
  color: white;
}

.rating-pagination a.active {
  background: var(--color-accent);
  color: white;
  cursor: default;
}

.compact-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  font-size: 1.1em;
  text-align: center;
}

.compact-match .team {
  flex-basis: 40%;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



.compact-match .team:last-child {
  justify-content: flex-end;
}












.match-details {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.match-header {
  text-align: center;
  margin-bottom: 20px;
}

.match-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.6em;
}

.match-score {
  font-weight: bold;
  font-size: 1.4em;
  margin: 0 8px;
  color: var(--color-accent);
}

.match-meta {
  font-size: 0.95em;
  color: var(--color-muted);
  margin-top: 8px;
}

.stats-table,
.lineup,
.events-list {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #333;
}

.lineup li,
.events-list li {
  padding: 6px 12px;
  margin-inline: auto;
  width: fit-content;
  border-bottom: 1px dashed #444;
}





.match-stats-modern {
  margin-top: 20px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: 40px 1fr 40px auto;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.stat-bar {
  position: relative;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.bar-left {
  background-color: orange;
  height: 100%;
}

.bar-right {
  background-color: lightgray;
  height: 100%;
}

.team-value {
  font-weight: bold;
  text-align: center;
  font-size: 0.95em;
}



.stat-block {
  margin: 12px 0;
}

.stat-type {
  text-align: center;
  font-size: 0.95em;
  margin-bottom: 6px;
  color: var(--color-fg);
  font-weight: bold;
}

.stat-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-val {
  width: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 0.95em;
}

.stat-bar {
  flex-grow: 1;
  height: 8px;
  background: #444;
  border-radius: 4px;
  position: relative;
  display: flex;
  overflow: hidden;
}

.bar-left {
  background-color: rgb(0, 26, 255);
  height: 100%;
}

.bar-right {
  background-color: rgb(255, 255, 255);
  height: 100%;
}

.stat-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.95em;
  font-weight: bold;
  color: var(--color-fg);
}

.stat-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.stat-label {
  margin-right: 8px;
  font-size: 0.95em;
  color: var(--color-fg);
}



.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
}

.tab-btn {
  padding: 8px 16px;
  background: #1a1d21;
  color: var(--color-fg);
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--color-accent);
  color: white;
}



.formation {
  display: flex;
  flex-direction: column-reverse;
  gap: 16px;
  margin-top: 20px;
  align-items: center;
}

.formation-line {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.player-box {
  text-align: center;
  color: white;
  font-size: 0.85em;
  width: 70px;
}

.circle {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
  font-weight: bold;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-formation-table {
  width: 100%;
  margin: 0 auto;
}

.vs-line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}

.vs-side {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
}

.vs-mid {
  flex: 0 0 24px;
}

.formation-line {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.player-box {
  text-align: center;
  color: white;
  font-size: 0.85em;
  width: 68px;
}

.circle {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
  font-weight: bold;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formation-line {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.player-box {
  text-align: center;
  color: white;
  font-size: 0.85em;
  width: 68px;
}

.circle {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
  font-weight: bold;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}






.tabs {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  justify-content: center;
}

.tab-btn {
  padding: 8px 16px;
  background: #1a1d21;
  color: var(--color-fg);
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.tab-btn.active {
  background: var(--color-accent);
  color: white;
}

.tab-content {
  display: none;
}

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

.formation-team {
  margin: 20px 0;
  text-align: center;
}

.formation-line {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.player-box {
  text-align: center;
}

.player-box .circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  line-height: 36px;
  margin: 0 auto 4px;
  font-weight: bold;
}

.player-box .player-name {
  font-size: 0.85em;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-divider {
  font-size: 24px;
  font-weight: bold;
  margin: 16px 0;
  color: var(--color-danger);
}

.subs {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.sub-team {
  flex: 1;
  text-align: center;
}

ul.collapsed {
  display: none;
}

ul.expanded {
  display: block;
}










.horizontal-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 1.1em;
  position: relative;
}

.horizontal-match .team-name {
  flex: 1;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.horizontal-match .team-name:first-child {
  text-align: right;
  padding-right: 6px;
}

.horizontal-match .team-name:last-child {
  text-align: left;
  padding-left: 6px;
}

.horizontal-match img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.score-link {
  min-width: 60px;
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  color: var(--color-accent);
  position: relative;
  display: inline-block;
}






.score-minute {
  font-size: 0.75em;
  color: var(--color-success);
  margin-bottom: 2px;
}


.score-link-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}



.live-dot {
  width: 10px;
  height: 2px;
  background-color: var(--color-success);
  border-radius: 50%;
  animation: waveDotHorizontal 3s linear infinite;
}

/* Removed duplicate @keyframes waveDotHorizontal */


.live-info-combined {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75em;
  color: var(--color-success);
  margin-bottom: 1px;
  /* ← بدلاً من 4px */
  font-weight: bold;
  gap: 1px;
}


@keyframes waveDotHorizontal {
  0% {
    transform: translateX(-8px);
  }

  50% {
    transform: translateX(8px);
  }

  100% {
    transform: translateX(-8px);
  }
}



.match-card {
  transition: background-color 0.2s ease;
  border-radius: 4px;
}

.match-card:hover {
  background-color: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}


/* تحسين تصميم جدول الترتيب */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}

.standings-table th,
.standings-table td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #333;
}

.standings-table th {
  background-color: #1f2227;
  font-weight: bold;
  color: var(--color-fg);
}

.standings-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.standings-table td img {
  vertical-align: middle;
  width: 20px;
  margin-inline: 4px;
}

.standings-table .up {
  color: var(--color-success);
}

.standings-table .down {
  color: var(--color-danger);
}

.form-bar {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.form-bar span {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.form-bar .W {
  background-color: var(--color-success);
}

.form-bar .D {
  background-color: var(--color-muted);
}

.form-bar .L {
  background-color: var(--color-danger);
}


.btn-compare {
  margin-left: 8px;
  padding: 3px 8px;
  font-size: .85em;
  background: #222;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  text-decoration: none
}


.btn-compare:hover {
  background: #444
}


/* static/css/main.css — add near the end */
.compare-panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px
}

.segmented {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px
}

.seg-btn {
  padding: 8px 14px;
  border: 1px solid #444;
  background: #1a1d21;
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600
}

.seg-btn.active {
  background: var(--color-accent);
  color: #fff
}

.seg-content {
  display: none
}

.seg-content.active {
  display: block
}

.odds-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px
}

.odds-card {
  background: #15181c;
  border: 1px solid #2a2e34;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center
}

.odds-market {
  font-weight: 700;
  margin-bottom: 6px;
  color: #ddd
}

.odds-values {
  display: flex;
  gap: 10px;
  align-items: baseline
}

.odds-values .prob {
  color: var(--color-success);
  font-weight: 700
}

.odds-values .odds {
  color: var(--color-accent);
  font-weight: 700
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px
}

.metric-card {
  background: #15181c;
  border: 1px solid #2a2e34;
  border-radius: 10px;
  padding: 12px
}

.metric-title {
  font-weight: 700;
  margin-bottom: 8px
}

.metric-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0
}

.metric-team {
  color: #bbb
}

.metric-val {
  font-weight: 700
}

.metric-edge {
  margin-top: 8px;
  text-align: center;
  font-size: 1.2em
}

@media (max-width: 900px) {
  .odds-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }
}

@media (max-width: 600px) {
  .odds-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .metrics-grid {
    grid-template-columns: 1fr
  }
}

/* static/css/main.css — add near the end */
.metrics-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden
}

.metrics-table th,
.metrics-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #333
}

.metrics-table th {
  background: #1f2227;
  color: var(--color-fg)
}

.metrics-table .metric-name {
  text-align: left
}

.metrics-table .metric-num {
  font-weight: 700
}

.metric-bar-row td {
  padding-top: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #333
}

.mini-bar {
  height: 6px;
  background: #2b2f36;
  border-radius: 4px;
  overflow: hidden;
  display: flex
}

.mini-bar .mini-left {
  background: var(--color-accent)
}

.mini-bar .mini-right {
  background: #7a869a
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden
}

.summary-table th,
.summary-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #333
}

.summary-table th {
  background: #1f2227;
  color: var(--color-fg)
}

.summary-table td:first-child,
.summary-table th:first-child {
  text-align: left
}

.kv-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1d21;
  border: 1px solid #333;
  border-radius: 8px;
  margin-top: 6px;
  z-index: 1000;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}

.kv-suggest-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.kv-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.kv-item:hover,
.kv-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.kv-item img {
  object-fit: contain;
}

.kv-name {
  color: #eaeaea;
  font-weight: 600;
}

.kv-type {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
}

.kv-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1d21;
  border: 1px solid #333;
  border-radius: 8px;
  margin-top: 6px;
  z-index: 1000;
  display: none;
  max-height: 360px;
  overflow-y: auto
}

.kv-suggest-list {
  list-style: none;
  margin: 0;
  padding: 6px 0
}

.kv-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer
}

.kv-item:hover,
.kv-item.active {
  background: rgba(255, 255, 255, 0.06)
}

.kv-name {
  color: #eaeaea;
  font-weight: 600
}

.kv-type {
  color: #999;
  font-size: 12px;
  text-transform: uppercase
}