:root {
  /* --- Color Palette (Catppuccin Latte - Light) --- */
  --bg-body: #eff1f5;
  --bg-card: #ffffff;
  --bg-header: #e6e9ef;
  --bg-table-stripe: #f9f9f9;
  
  --text-main: #4c4f69;
  --text-muted: #6c6f85;
  
  --primary: #1e66f5;    /* Blue */
  --accent: #8839ef;     /* Mauve */
  --success: #40a02b;    /* Green */
  --highlight: #df8e1d;  /* Yellow */
  
  --border: #ccd0da;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "ui-monospace", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Dark Theme Overrides (Catppuccin Mocha) --- */
[data-theme="dark"] {
  --bg-body: #1e1e2e;
  --bg-card: #181825;
  --bg-header: #11111b;
  --bg-table-stripe: #1e1e2e; /* Slightly lighter than card */

  --text-main: #cdd6f4;
  --text-muted: #a6adc8;

  --primary: #89b4fa;
  --accent: #cba6f7;
  --success: #a6e3a1;
  --highlight: #f9e2af;

  --border: #313244;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

/* --- Base Layout --- */
html, body {
  height: 100%;
  margin: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Typography & Header --- */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.mainheader {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
}

/*
.mainheader code {
  background-color: var(--bg-header);
  padding: 0.2em 0.4em;
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  color: var(--accent);
}
*/

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--highlight);
  padding-left: 0.75rem;
}

/* --- Cards & Tables --- */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden; /* Clips the table corners */
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

th, td {
  padding: 1.1rem;
  text-align: left;
}

thead th {
  background-color: var(--bg-header);
  color: var(--text-main);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background-color: var(--bg-table-stripe);
}

tbody tr:hover {
  background-color: var(--bg-header); /* Highlight on hover */
}

/* --- Data Styling --- */
td.data-mono {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 1rem;
}

td.callsign-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1em;
}

.big-call-row td {
  background-color: var(--bg-card);
  border-bottom: none; 
}

.big-call-row .callsign-cell {
  color: var(--success);
  font-size: 1.5rem;
}

/* --- Footer & Links --- */
a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Theme Toggle Switch --- */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  background: var(--bg-header);
}

/* --- Mobile Responsive Table (Stacking) --- */
@media screen and (max-width: 768px) {
  /* Hide the actual table header */
  thead {
    display: none;
  }

  /* Make rows look like individual cards */
  tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-card);
    box-shadow: var(--shadow);
  }

  /* Make cells look like rows within the card */
  tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bg-header);
    font-size: 0.95rem;
  }

  tbody td:last-child {
    border-bottom: none;
  }

  /* Inject the column name using the data-label attribute */
  tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-right: 1rem;
    text-align: left;
  }

  /* Special styling for the Call/Hero row on mobile */
  .big-call-row .callsign-cell {
    font-size: 1.5rem;
    justify-content: center; /* Center the big callsign */
    background: var(--bg-header);
  }
  
  /* Hide the label for the big callsign to make it cleaner */
  .big-call-row .callsign-cell::before {
    display: none;
  }
}
