body {
  font-family: "Inter", system-ui, sans-serif;
  background: linear-gradient(135deg, #0d1117, #1c1f26);
  color: #fff;
  text-align: center;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 60px auto;
  padding: 0 10px;
}

.card {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.title {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #2ecc71;
}

.subtitle {
  font-size: 1rem;
  color: #aaa;
  margin-bottom: 20px;
}

.input-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

input {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  width: 280px;
  background: #2a2e38;
  color: #fff;
  font-size: 1rem;
}

input::placeholder {
  color: #aaa;
}

button {
  padding: 12px 20px;
  background: #2ecc71;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

button:hover {
  background: #27ae60;
  transform: scale(1.05);
}

.hint {
  font-size: 0.85rem;
  color: #888;
}

.output {
  margin-top: 30px;
  text-align: center;
}

h2 {
  color: #2ecc71;
  margin-bottom: 0.3rem;
}

.table-hint {
  font-size: 0.95rem;
  color: #f1c40f;
  margin: 10px 0 16px;
  font-weight: 500;
  background: rgba(241, 196, 15, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
  text-align: center;
}

.table-wrapper {
  overflow-x: auto; /* horizontal scroll for small screens */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  margin-bottom: 30px;
}

table {
  width: 100%;
  min-width: 600px; /* ensures scroll appears when needed */
  margin-top: 25px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

th, td {
  padding: 14px 10px;
  border-bottom: 1px solid #333;
  font-size: 0.95rem;
  min-width: 100px;
}

th {
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  color: #2ecc71;
}

tr:hover {
  background: rgba(255, 255, 255, 0.08);
  transition: 0.2s;
}

table:nth-of-type(2) th {
  background: #34495e;
}

/* Sortable column styles */
th.sortable {
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  color: #2ecc71;
  position: relative;
}

th.sortable::after {
  content: '⇅'; /* small sort icon */
  font-size: 0.7rem;
  margin-left: 6px;
  color: #f1c40f;
}

th.sortable:hover {
  background: rgba(46, 204, 113, 0.15);
  color: #fff;
}

th.active-sort {
  background: rgba(46, 204, 113, 0.3);
  color: #fff;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .input-section {
    flex-direction: column;
  }
  input, button {
    width: 100%;
  }
  th, td {
    font-size: 0.85rem;
    padding: 10px 5px;
  }
}

.footer {
  margin-top: 50px;
  text-align: center;
  font-size: 0.9rem;
  color: #aaa;
  opacity: 0.8;
}

.footer .author {
  color: #2ecc71;
  font-weight: 600;
}

.footer p:hover {
  opacity: 1;
  transform: scale(1.03);
  transition: all 0.2s ease-in-out;
}
