/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background-color: #f8f9fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: #ffb74d !important;
  color: #2c3e50;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.league-dropdown {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #2c3e50;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.league-dropdown option {
  background: white;
  color: #2c3e50;
}

/* Navigation controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Navigation links */
.nav-links {
  display: flex;
  align-items: center;
}

.methodology-link {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.methodology-link:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
  text-decoration: none;
}

.methodology-link:active {
  transform: translateY(0);
}

/* Main content */
.main {
  padding: 2rem 0;
}

.content-grid {
  display: grid;
  gap: 3rem;
}

/* Sections */
section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #ffb74d;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8f9fa;
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Fixtures table specific */
.fixtures-section .data-table td:nth-child(4),
.fixtures-section .data-table td:nth-child(5),
.fixtures-section .data-table td:nth-child(6) {
  text-align: center;
  font-weight: 600;
}

.prob-high {
  color: #27ae60;
}
.prob-medium {
  color: #f39c12;
}
.prob-low {
  color: #e74c3c;
}

/* Standings table specific */
.standings-table .position {
  font-weight: 700;
  text-align: center;
  width: 40px;
}

.standings-table .team-name {
  font-weight: 600;
}

.qualification-champions {
  background-color: #e8f5e8;
  color: #27ae60;
}
.qualification-europa {
  background-color: #fff3cd;
  color: #856404;
}
.qualification-conference {
  background-color: #d1ecf1;
  color: #0c5460;
}
.qualification-relegation {
  background-color: #f8d7da;
  color: #721c24;
}

.relegation-risk {
  font-weight: 600;
}

.risk-high {
  color: #e74c3c;
}
.risk-medium {
  color: #f39c12;
}
.risk-low {
  color: #27ae60;
}

/* Players table specific */
.table-controls {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-dropdown {
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
}

.data-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.data-table th[data-sort]:hover {
  background-color: #e9ecef;
}

.probaball-value {
  font-weight: 700;
  color: #ffb74d;
}

.player-position {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pos-gk {
  background-color: #ffeaa7;
  color: #2d3436;
}
.pos-def {
  background-color: #74b9ff;
  color: white;
}
.pos-mid {
  background-color: #00b894;
  color: white;
}
.pos-att {
  background-color: #e17055;
  color: white;
}

/* Responsive design */
@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "fixtures standings"
      "players players";
  }

  .fixtures-section {
    grid-area: fixtures;
  }
  .standings-section {
    grid-area: standings;
  }
  .players-section {
    grid-area: players;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 0 15px;
  }

  .header .container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .header-left {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .nav-controls {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .nav-links,
  .league-selector {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .league-dropdown {
    width: 100%;
    max-width: 200px;
  }

  .logo {
    font-size: 1.5rem;
  }

  section {
    padding: 1.5rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
}

/* Footer */
.footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-credits {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #bdc3c7;
}

.footer-credits strong {
  color: #ecf0f1;
}

.kofi-link {
  color: #f39c12;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.kofi-link:hover {
  color: #e67e22;
  text-decoration: underline;
}

/* Loading state */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #7f8c8d;
  font-style: italic;
}

/* Methodology page styles */
.methodology-content {
  max-width: 900px;
  margin: 0 auto;
}

.methodology-header {
  text-align: center;
  margin-bottom: 3rem;
}

.methodology-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.methodology-header .subtitle {
  font-size: 1.3rem;
  color: #7f8c8d;
  font-weight: 400;
}

.content-sections {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.method-section {
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

.method-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #ffb74d;
}

.method-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #34495e;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.method-section p {
  line-height: 1.7;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.method-section ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.method-section li {
  line-height: 1.7;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.method-section li strong {
  color: #ffb74d;
  font-weight: 600;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.data-item {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #ffb74d;
}

.data-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.data-item p {
  font-size: 0.95rem;
  color: #6c757d;
  margin-bottom: 0;
}

.model-section {
  margin-bottom: 2rem;
}

.accuracy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.accuracy-item {
  text-align: center;
  background: #f8f9fa;
  padding: 2rem 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.accuracy-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  margin-top: 0;
}

.accuracy-stat {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffb74d;
  margin-bottom: 0.5rem;
}

.accuracy-item p:not(.accuracy-stat) {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}
