/* Base fluid typography */
html {
  font-size: clamp(14px, 1.2vw + 10px, 18px);
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  /* Use the provided background image from the Images folder (path is relative to this CSS file) */
  background-color: #06180b;
  background-image: url("../Images/backgroundimage.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #eaf7ea;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Header and Footer */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(90deg, #16a34a 0%, #0f7a3a 100%);
  color: #fff;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(90deg, #0b2e18 0%, #06220f 100%);
  color: #fff;
}

.football-logo {
  width: 48px;
  height: 48px;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.filters input,
.filters select,
.filters button {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 8px;
  width: 100%;
  max-width: 300px;
}

/* Generic button styles for retry and other action buttons */
.btn,
#retryBtn,
.loading-retry,
.filters button {
  background: #0b0b0b;
  color: #ffffff;
  border: none;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover,
#retryBtn:hover,
.loading-retry:hover,
.filters button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.45);
}

.loading-retry[disabled],
#retryBtn[disabled],
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading countdown badge (large numeric timer) */
#loadingCountdown,
.loading-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg,#0b0b0b,#111);
  color: #bff7b9;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45), inset 0 -2px 6px rgba(255,255,255,0.02);
  border: 2px solid rgba(255,255,255,0.04);
}

.loading-countdown-small {
  min-width: 40px;
  height: 40px;
  font-size: 0.95rem;
}

.loading-note {
  margin-left: 12px;
  color: #dfffd8;
  font-weight: 600;
}

/* Loading wrapper layout: center the counter and note in the results area */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 36vh;
  gap: 12px;
  padding: 12px;
}

.loader-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.person-content {
  display: block;
}

/* Results container */
#resultsContainer {
  padding: 80px 10px 84px;
  min-height: 60vh;
}

/* League section */
.league-section {
  max-width: 760px;
  margin: 18px auto;
  background: linear-gradient(180deg, #0f3a20, #0b2e18);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.league-header h2 {
  margin: 0;
  font-size: 1.2rem;
  text-transform: uppercase;
  background: #000;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
}

/* Match cards */
.match-card {
  background: linear-gradient(180deg, #0c2b14, #0b2914);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  width: 100%;
}

.match-card-content {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Teams */
.teams-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  flex: 1 1 220px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #eefbe8;
}

.team-logo {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
  padding: 2px;
}

/* Match time */
.match-meta {
  text-align: center;
  color: #cfead0;
  min-width: 110px;
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  padding: 6px 10px;
  border-radius: 8px;
}

/* Status chip inside match-meta */
.match-meta .status {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #0b0b0b;
}
.match-meta .status.pending {
  background: linear-gradient(180deg,#fecaca,#ffedd5);
  color: #6b2a00;
}
.match-meta .status.live {
  background: linear-gradient(180deg,#ff6b6b,#ff2e2e);
  color: #ffffff;
}
.match-meta .status.finished {
  background: linear-gradient(180deg,#d1fae5,#bbf7d0);
  color: #065f46;
}

/* Optional subtle border for finished match cards */
.match--finished {
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.02);
}
.match--live {
  border: 1px solid rgba(255,80,80,0.14);
}

/* Scores */
.scores-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 64px;
  flex: 0 0 80px;
  padding-right: 8px;
}

.score-number {
  font-size: 18px;
  font-weight: 800;
  color: #caffc6;
}

/* ------------------- Responsive Breakpoints ------------------- */

/* Tablet */
@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .match-card-content {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .match-card-content {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .teams-vertical {
    order: 1;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .match-meta {
    order: 2;
    margin-bottom: 8px;
    font-size: 14px;
    flex: none;
    min-width: 100px;
  }

  .scores-vertical {
    order: 3;
    flex-direction: row;
    justify-content: center;
    gap: 14px;
    width: 100%;
  }

  .team-logo {
    width: 28px;
    height: 28px;
  }

  .team-row span {
    max-width: 120px;
    font-size: 14px;
  }

  .score-number {
    font-size: 16px;
  }
}

/* Extra small */
@media (max-width: 380px) {
  .team-logo {
    width: 24px;
    height: 24px;
  }

  .team-row span {
    max-width: 100px;
    font-size: 13px;
  }

  .score-number {
    font-size: 14px;
  }
}