/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #1e1b2e;
  color: #f0f0f0;
  line-height: 1.6;
  padding: 0 1rem;
}

/* Header & Navigation */
header {
  background: linear-gradient(to right, #4B0082, #6A0DAD);
  color: white;
  padding: 1rem;
  text-align: center;
  border-radius: 0 0 10px 10px;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

nav a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.3s ease, color 0.3s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFD700;
}

/* Main Layout */
main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1000px;
}

/* Sections */
section {
  background: #2c2540;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Dashboard */
#stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
}

#stats div {
  background: #6A0DAD;
  padding: 1rem;
  border-radius: 6px;
  flex: 1 1 200px;
  text-align: center;
  font-weight: bold;
  color: #fff;
}

/* Form */
form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

form label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}

form input[type="text"],
form input[type="date"],
form input[type="number"] {
  padding: 0.6rem;
  border: 1px solid #6A0DAD;
  border-radius: 6px;
  background-color: #fdfdfd;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input:focus {
  border-color: #FFD700;
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  outline: none;
}

form button {
  grid-column: span 2;
  padding: 0.75rem;
  background: #6A0DAD;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

form button:hover {
  background: #4B0082;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

thead, tbody, tr {
  display: contents;
}

th, td {
  padding: 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
}

thead th {
  background: #4B0082;
  color: white;
  font-weight: bold;
}

tbody tr:nth-child(even) {
  background: #3a2f50;
}

mark {
  background-color: #ffeb3b;
  padding: 0 2px;
}

/* Settings */
#settings input {
  margin-top: 0.5rem;
  padding: 0.5rem;
  width: 200px;
  border-radius: 6px;
  border: 1px solid #6A0DAD;
  background-color: #fdfdfd;
}

/* Footer */
footer {
  background: linear-gradient(to right, #6A0DAD, #4B0082);
  color: white;
  padding: 1rem;
  text-align: center;
  border-radius: 10px 10px 0 0;
}

footer a {
  color: #FFD700;
  text-decoration: none;
  font-weight: bold;
  margin: 0 0.5rem;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

footer a:hover {
  color: white;
  text-shadow: 0 0 5px #FFD700;
}

/* Focus & Accessibility */
input:focus, button:focus, a:focus {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  form {
    grid-template-columns: 1fr;
  }

  #stats {
    flex-direction: column;
  }

  nav {
    flex-direction: column;
    align-items: center;
  }

  table {
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.5rem;
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
    margin-right: 1rem;
  }
}

/* Delete Button */
.delete-btn {
  background-color: #b00020;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.delete-btn:hover {
  background-color: #ff1744;
  transform: scale(1.05);
}
