/* Light mode (default) */
body {
  font-family: "Inter", Arial, sans-serif;
  background-color: #f7f8fa;
  color: #333;
  margin: 0;
  padding: 2rem;
  display: flex;
  justify-content: center;
  animation: fadeIn 1s ease-in-out;
}

.table-container {
  width: 100%; 
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  animation: fadeInUp 0.8s ease-out;
}

h1 {
  text-align: center;
  margin-bottom: 1.2rem;
  color: #111;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
}

.intro {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.8rem;
  color: #555;
  text-align: center;
}

.intro a {
  color: #1e88e5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.intro a:hover {
  text-decoration: underline;
  color: #1565c0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  border-radius: 12px;
  overflow: auto;
  display: block;
  height: 75vh;
  word-wrap: break-word;
}

thead th {
  cursor: pointer;
  background-color: #eef1f5;
  text-align: left;
  padding: 0.9rem;
  border-bottom: 2px solid #ddd;
  position: relative;
  user-select: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

thead th:hover {
  background-color: #e1e5ea;
}

tbody td {
  padding: 0.85rem;
  border-bottom: 1px solid #eee;
}

tbody tr:nth-child(even) {
  background-color: #fafafa;
}

tbody tr:hover {
  background-color: #f1f6ff;
  transition: background-color 0.15s ease;
}

/* Sort indicators */
th.asc::after,
th.desc::after {
  content: '';
  position: absolute;
  right: 10px;
  border: 6px solid transparent;
  transition: transform 0.3s ease;
}

th.asc::after {
  border-bottom-color: #555;
  top: 40%;
  transform: rotate(0deg);
}

th.desc::after {
  border-top-color: #555;
  top: 45%;
  transform: rotate(180deg);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================
   Dark Mode
===================== */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #ddd;
  }

  .table-container {
    background-color: #1e1e1e;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
  }

  h1 {
    color: #f0f0f0;
  }

  .intro {
    color: #ccc;
  }

  .intro a {
    color: #64b5f6;
  }

  .intro a:hover {
    color: #90caf9;
  }

  thead th {
    background-color: #2c2c2c;
    border-bottom: 2px solid #444;
  }

  thead th:hover {
    background-color: #3a3a3a;
  }

  tbody td {
    border-bottom: 1px solid #333;
  }

  tbody tr:nth-child(even) {
    background-color: #242424;
  }

  tbody tr:hover {
    background-color: #2a2a2a;
  }

  th.asc::after {
    border-bottom-color: #ddd;
  }

  th.desc::after {
    border-top-color: #ddd;
  }
}

