:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --primary: #2563eb;
  --primary-foreground: #f8fafc;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #ea580c;
  --accent-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #2563eb;
  --radius: 0.5rem;
}

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

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 1.5rem 1rem;
}

.site-header-inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-header-icon {
  background-color: var(--accent);
  padding: 0.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent-foreground);
}

.site-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.site-header p {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Main */
.main-content {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.main-content > * + * {
  margin-top: 2rem;
}

/* Team Section */
.team-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 1rem;
  margin: -1.5rem -1.5rem 0 -1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.team-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-title svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary-foreground);
}

.team-title h2 {
  font-weight: 600;
  font-size: 1.125rem;
}

.team-title h2 a {
  color: var(--primary-foreground);
  text-decoration: none;
}

.team-title h2 a:hover {
  color: var(--primary-foreground);
  text-decoration: underline;
}

.team-competition {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: normal;
  margin-top: 0.125rem;
}

.team-count {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Calendar Card */
.calendar-card {
  border-radius: var(--radius);
  border: 1px solid rgba(234, 88, 12, 0.2);
  background: linear-gradient(to bottom right, var(--card), rgba(234, 88, 12, 0.05));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-card-header {
  padding: 1.5rem 1.5rem 0.75rem;
}

.calendar-card-header h3 {
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.025em;
}

.calendar-card-header h3 svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.calendar-card-header p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.calendar-card-content {
  padding: 0 1.5rem 1.5rem;
}

.calendar-card-content > * + * {
  margin-top: 1rem;
}

/* URL Input */
.url-field {
  display: flex;
  gap: 0.5rem;
}

.url-input {
  flex: 1;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  background-color: var(--muted);
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--foreground);
}

.url-input:focus {
  outline: none;
  ring: 2px solid var(--ring);
}

.url-copy-btn {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  background-color: var(--background);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.url-copy-btn:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.url-copy-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Buttons */
.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .btn-group {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0 1rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  border: none;
  text-decoration: none;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

.btn-accent {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-accent:hover {
  background-color: rgba(234, 88, 12, 0.9);
}

.btn-outline {
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

/* Instructions */
.calendar-instructions {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  line-height: 1.75;
}

.calendar-instructions strong {
  color: var(--foreground);
}

/* Match Cards */
.matches-grid {
  display: grid;
  gap: 0.75rem;
}

.match-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.match-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
}

.match-date-header {
  background-color: var(--secondary);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.match-date-header p {
  color: var(--secondary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.match-content {
  padding: 1rem;
}

.match-content > * + * {
  margin-top: 0.75rem;
}

/* Competition badge */
.match-competition {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.match-competition-name {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Teams */
.match-teams {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-team span {
  font-size: 1rem;
}

.match-team.highlight {
  font-weight: 600;
  color: var(--primary);
}

.match-team.highlight svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.match-vs {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  padding-left: 1.5rem;
}

/* Match meta */
.match-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.match-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.match-meta-item svg {
  width: 1rem;
  height: 1rem;
}

.match-meta-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-meta-item a {
  color: var(--primary);
  text-decoration: none;
}

.match-meta-item a:hover {
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-foreground);
}

/* Footer */
.site-footer {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary);
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* All Teams Calendar Section */
.all-teams-section {
  margin-top: 2rem;
}

.all-teams-section .calendar-card {
  background: linear-gradient(to bottom right, var(--primary), rgba(37, 99, 235, 0.8));
  border-color: var(--primary);
}

.all-teams-section .calendar-card-header h3,
.all-teams-section .calendar-card-header p {
  color: var(--primary-foreground);
}

.all-teams-section .calendar-card-header h3 svg {
  color: var(--accent-foreground);
}

.all-teams-section .url-input {
  background-color: rgba(255, 255, 255, 0.9);
}

.all-teams-section .calendar-instructions {
  color: rgba(255, 255, 255, 0.8);
  border-top-color: rgba(255, 255, 255, 0.2);
}

.all-teams-section .calendar-instructions strong {
  color: var(--primary-foreground);
}

/* Highlighted Section */
.highlighted-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.highlighted-box {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  background: var(--card);
}

.highlighted-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
}

.highlighted-header svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.results-box .highlighted-header {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
}

.results-box .highlighted-header svg {
  color: #78350f;
}

.upcoming-box .highlighted-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.upcoming-box .highlighted-header svg {
  color: white;
}

.highlighted-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* Matches Table */
.matches-table-container {
  overflow-x: auto;
}

.matches-day-header {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.matches-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.matches-table tbody tr:hover {
  background-color: var(--secondary);
}

.matches-table td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
}

.match-time-cell {
  width: 60px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.match-competition-cell {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-home-cell,
.match-away-cell {
  white-space: nowrap;
}

.match-home-cell.highlight,
.match-away-cell.highlight {
  font-weight: 600;
  color: var(--primary);
}

.match-venue-cell {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-venue-cell a {
  color: var(--primary);
  text-decoration: none;
}

.match-venue-cell a:hover {
  text-decoration: underline;
}

/* Result column */
.match-result-cell {
  text-align: center;
  width: 70px;
  white-space: nowrap;
}

.match-result {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 50px;
}

.match-result-pending {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.result-win {
  background-color: #dcfce7;
  color: #166534;
}

.result-loss {
  background-color: #fee2e2;
  color: #991b1b;
}

.result-draw {
  background-color: #fef3c7;
  color: #92400e;
}

/* Team links in table */
.match-home-cell a,
.match-away-cell a {
  color: inherit;
  text-decoration: none;
}

.match-home-cell a:hover,
.match-away-cell a:hover {
  text-decoration: underline;
}

.match-home-cell.highlight a,
.match-away-cell.highlight a {
  color: var(--primary);
}

/* Teams List Section */
.teams-list-section {
  margin-top: 2rem;
}

.teams-list-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.team-link-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  text-decoration: none;
  color: var(--foreground);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.team-link-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.team-link-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primary);
}

.team-link-count {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Responsive table */
@media (max-width: 768px) {
  .matches-table {
    font-size: 0.75rem;
  }

  .matches-table td {
    padding: 0.5rem 0.375rem;
  }

  .match-competition-cell {
    display: none;
  }

  .match-venue-cell {
    max-width: 100px;
  }
}

/* Responsive */
@media (min-width: 640px) {
  .site-header h1 {
    font-size: 1.5rem;
  }
}
