@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Oswald:wght@400;500;700&display=swap&display=swap');

:root {
  /* Colors - Dark Navy LiveScore Theme */
  --bg-main: #060c18;
  --bg-card: #111e36;
  --bg-dark: #030811;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --text-live: #22c55e;
  --text-finished: #64748b;
  --text-upcoming: #3b82f6;

  --accent-primary: #facc15;
  /* Yellow */
  --accent-live: #ef4444;
  /* Red for live pulse */
  --accent-green: #22c55e;

  --border-color: #1e293b;

  /* Typography */
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --container-width: 1200px;

  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Utilities */
.text-accent {
  color: var(--accent-primary);
}

.text-muted {
  color: var(--text-muted);
}

.bg-card {
  background-color: var(--bg-card);
}

.text-uppercase {
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-smooth);
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-dark {
  background-color: var(--bg-dark);
  color: var(--text-inverse);
}

.btn-dark:hover {
  background-color: #333;
  transform: translateY(-2px);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 50%;
  height: 4px;
  background-color: var(--accent-primary);
  border-radius: 2px;
}

/* ── Page-load progress bar ── */
#nprogress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent-primary);
  z-index: 9999;
  transition: width 0.25s ease, opacity 0.4s ease;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Navbar */
.navbar {
  background-color: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--accent-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--accent-primary);
}

.logo:hover {
  opacity: 0.85;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.9rem;
  position: relative;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-links a:hover {
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.07);
}

.nav-links a.active {
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.1);
  border-bottom: 2px solid var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  font-size: 1.4rem;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--bg-dark);
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--bg-main);
}

/* Search Bar */
.search-container {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.25rem 1rem;
  width: 250px;
  position: relative;
}

.search-container input {
  border: none;
  background: transparent;
  padding: 0.5rem;
  outline: none;
  width: 100%;
  font-family: var(--font-body);
  color: var(--text-primary);
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  flex-direction: column;
}

.search-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.star-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  font-size: 1.1rem;
}

.star-btn:hover {
  transform: scale(1.1);
}

.star-btn.fav-active {
  color: var(--accent-primary);
}

/* Grid Layout */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 1px solid var(--border-color);
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-primary);
}

.card-content {
  padding: 1.5rem;
}

.tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.news-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--bg-dark);
}

.news-card h3 a:hover {
  color: var(--accent-primary);
}

.card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Admin Dashboard Specifics */
.admin-sidebar {
  background: var(--bg-dark);
  color: var(--text-inverse);
}

.admin-sidebar a {
  color: #a1a1aa;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.7rem 1rem;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
  }

  .mobile-menu-btn {
    display: block;
  }

  .search-container {
    display: none;
  }

  .logo {
    font-size: 1.6rem;
  }
}

/* Matches Layout */
.match-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition-fast);
}

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

.match-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-family: var(--font-body);
  font-size: 1rem;
  flex: 1;
}

.match-team img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.match-team.home {
  justify-content: flex-end;
}

.match-score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.match-score {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.match-time {
  font-size: 0.8rem;
  font-weight: 600;
  width: 60px;
}

.match-time.live {
  color: var(--accent-primary);
  animation: pulse 1.5s infinite ease-in-out;
}

.match-time.finished {
  color: var(--text-finished);
}

.match-time.upcoming {
  color: var(--text-upcoming);
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
}

.league-header {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.league-header img {
  width: 28px;
  height: 28px;
}

/* grid skeleton for news cards */
.card-skeleton {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Match Detail Page */
.detail-header {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.detail-teams {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.detail-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.detail-team img {
  width: 60px;
  height: 60px;
}

.detail-score {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.detail-time {
  color: var(--accent-primary);
  font-weight: 600;
}

.detail-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-title {
  font-size: 1.2rem;
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.stat-home {
  width: 30%;
  text-align: right;
  font-weight: 600;
}

.stat-label {
  width: 40%;
  text-align: center;
  color: var(--text-muted);
}

.stat-away {
  width: 30%;
  text-align: left;
  font-weight: 600;
}

.timeline-event {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.timeline-min {
  width: 40px;
  font-weight: 600;
  color: var(--accent-primary);
}

.timeline-icon {
  width: 30px;
  text-align: center;
  color: var(--text-muted);
}

.timeline-desc {
  flex: 1;
}

.lineups-container {
  display: flex;
  gap: 2rem;
}

.lineup-col {
  flex: 1;
}

.lineup-col h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--accent-primary);
}

.lineup-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player-num {
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 20px;
}

/* cursor for links */
.match-card {
  cursor: pointer;
}

/* Sidebar & Layout Elements */
.layout-wrapper {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  min-height: 70vh;
}

.sidebar-left {
  width: 260px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-widget h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.sidebar-widget h3 i {
  color: var(--accent-primary);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-list li a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-list img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

@media (max-width: 900px) {
  .layout-wrapper {
    flex-direction: column;
  }

  .sidebar-left {
    width: 100%;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .sidebar-widget {
    min-width: 250px;
    margin-bottom: 0;
  }
}

/* Standings Table */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.9rem;
}

.standings-table th {
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.standings-table td {
  padding: 0.75rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.standings-table th.left-align,
.standings-table td.left-align {
  text-align: left;
}

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

.team-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.team-cell img {
  width: 20px;
  height: 20px;
}

.rank {
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* Date Navigation */
.date-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.date-nav button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s;
}

.date-nav button:hover {
  color: var(--accent-primary);
}

.date-nav .current-date {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}

@keyframes card-shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

/* ===================== FOOTBALL PITCH UI ===================== */
.pitch-wrapper {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.pitch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.pitch-header .team-a {
  color: var(--accent-primary);
}

.pitch-header .team-b {
  color: #60a5fa;
}

.pitch-surface {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: linear-gradient(180deg, #1a5c1e 0%, #2e7d32 25%, #236b27 50%, #2e7d32 75%, #1a5c1e 100%);
  border: 3px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  overflow: hidden;
}

/* Field markings */
.pitch-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* center line */
    linear-gradient(rgba(255, 255, 255, 0.5) 2px, transparent 2px) center / 100% 100% no-repeat,
    /* penalty areas */
    linear-gradient(transparent 14.5%, rgba(255, 255, 255, 0.35) 14.5%, rgba(255, 255, 255, 0.35) 15%, transparent 15%) 0 0 / 100% 100% no-repeat,
    linear-gradient(transparent 85%, rgba(255, 255, 255, 0.35) 85%, rgba(255, 255, 255, 0.35) 85.5%, transparent 85.5%) 0 0 / 100% 100% no-repeat;
}

.pitch-surface::after {
  content: '';
  position: absolute;
  width: 21%;
  height: 21%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Player nodes placed via inline top/left % */
.player-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.player-disc {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.team-a-disc {
  background: var(--accent-primary);
  color: var(--bg-main);
}

.team-b-disc {
  background: #3b82f6;
  color: white;
}

.player-tag {
  margin-top: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lineup info sections */
.lineup-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.lineup-info-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.lineup-info-card h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lineup-info-card h4 i {
  color: var(--accent-primary);
}

.lineup-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lineup-entry:last-child {
  border-bottom: none;
}

.lineup-entry .num {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.lineup-entry .badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-injury {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.badge-sub {
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-primary);
}

.badge-coach {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.lineup-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.4rem;
}

.lineup-tab-btn {
  flex: 1;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.lineup-tab-btn.active {
  background: var(--accent-primary);
  color: var(--bg-main);
}

@media (max-width: 600px) {
  .lineup-sections {
    grid-template-columns: 1fr;
  }

  .pitch-wrapper {
    max-width: 100%;
  }
}