/* Modern CSS with Dark Mode Support */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --background: #ffffff;
  --surface: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
  --error: #ef4444;
  --success: #22c55e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --background: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s, color 0.3s;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 4px 6px var(--shadow);
}

h1 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(to right, var(--primary), var(--primary-hover));
  -webkit-background-clip: text;
  color: transparent;
}

.home-button-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.home-button {
    text-decoration: none;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    display: inline-block;
}

.home-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    filter: brightness(110%);
}

form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 2rem;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--surface);
  font-weight: 600;
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: var(--surface);
}

.actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.actions button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1rem;
  }

  form {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  h1 {
    font-size: 2rem;
  }
}

/* Loading States */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Animation for new rows */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

tbody tr {
  animation: fadeIn 0.3s ease-out;
}