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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f3f4f6;
  min-height: 100vh;
  line-height: 1.5;
}

.header {
  background: linear-gradient(to right, #1e3a8a, #2563eb);
  color: white;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

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

.nav-links a {
  color: white;
  text-decoration: none;
  margin-left: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.3s;
}

.nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.logo-container a {
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-container h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.intro-section {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin: 2rem 0;
  border: 1px solid #e5e7eb;
}

.intro-section h2 {
  font-size: 1.875rem;
  margin-bottom: 1rem;
  color: #1e3a8a;
}

.intro-section p {
  color: #4b5563;
  font-size: 1.125rem;
  line-height: 1.75;
}

.generated-at {
  margin-top: 0.75rem !important;
  font-size: 0.875rem !important;
  color: #6b7280 !important;
}

.status-banner {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #1e40af;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 0.5rem;
}

.matches-grid,
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stream-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.match-card,
.stream-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #e5e7eb;
}

.match-card:hover,
.stream-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.match-card h3 {
  text-transform: uppercase;
}

.match-card.empty {
  grid-column: 1 / -1;
  color: #6b7280;
}

.match-meta {
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.source-tag {
  font-size: 0.75rem;
  background: #f3e8ff;
  color: #6b21a8;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
}

/* League = soft label (not a CTA). Stream buttons = solid primary actions. */
.league-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* One horizontal bar: league left, streams right */
.match-card-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.stream-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Primary watch buttons — solid blue, white text */
.stream-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 5.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.stream-btn:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.stream-btn:active {
  transform: translateY(0);
}

/* Used on Available Streams cards */
.watch-now-btn {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s, transform 0.15s;
  display: inline-block;
  margin-top: 0;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}

.watch-now-btn:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

@media (max-width: 420px) {
  .match-card-footer {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .stream-actions {
    margin-left: 0;
    width: 100%;
  }
  .stream-btn {
    flex: 1;
  }
}

.stream-card-top,
.stream-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stream-card-top {
  margin-bottom: 0.5rem;
}

.live-tag {
  background: #dcfce7;
  color: #166534;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.footer {
  background: linear-gradient(to right, #111827, #1f2937);
  color: white;
  padding: 2rem;
  margin-top: 3rem;
}

.footer-link {
  color: white;
  text-decoration: underline;
}

.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.popup-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  z-index: 1001;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #4b5563;
}

.bookmark-button {
  background-color: #2563eb;
  color: white;
  padding: 0.25rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.bookmark-button:hover {
  background-color: #1e40af;
}

@media (max-width: 768px) {
  .logo-container h1 {
    font-size: 1.25rem;
  }
  .logo-img {
    width: 30px;
    height: 30px;
  }
  .nav-links a {
    margin-left: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
  }
}
