* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background-color: #2c3e50;
  color: white;
  padding: 20px 0;
  text-align: center;
  margin-bottom: 20px;
  border-radius: 5px;
}

header p {
  margin-top: 10px;
  font-size: 16px;
  opacity: 0.9;
}

nav {
  background-color: #34495e;
  margin-bottom: 20px;
  border-radius: 5px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

nav ul li {
  flex: 1;
  min-width: 120px;
}

nav ul li a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 15px;
  text-align: center;
  transition: background-color 0.3s;
}

nav ul li a:hover {
  background-color: #1abc9c;
}

main {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

footer {
  text-align: center;
  margin-top: 20px;
  padding: 10px;
  background-color: #2c3e50;
  color: white;
  border-radius: 5px;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.btn-primary {
  background-color: #1abc9c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #16a085;
}

.btn-secondary {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.btn-secondary:hover {
  background-color: #2980b9;
}

.btn-warning {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.btn-warning:hover {
  background-color: #c0392b;
}

.btn-remove {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.btn-remove:hover {
  background-color: #c0392b;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
}

.form-table input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.success {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
}

.info {
  background-color: #cce5ff;
  color: #004085;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid #b8daff;
}

.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

.nilai-input {
  width: 60px;
  text-align: center;
  padding: 5px;
}

/* Penyesuaian untuk form input atlet setelah menghapus nomor peserta */
.form-table th:nth-child(1) {
  width: 50px;
}

.form-table th:nth-child(2) {
  width: auto;
}

.form-table th:nth-child(3) {
  width: 100px;
}

.form-table td input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Styling untuk tabel daftar atlet terdaftar */
.table-responsive table th:nth-child(1),
.table-responsive table td:nth-child(1) {
  width: 50px;
}

.table-responsive table th:nth-child(2),
.table-responsive table td:nth-child(2) {
  width: auto;
}

.table-responsive table th:nth-child(3),
.table-responsive table td:nth-child(3) {
  width: 150px;
}

/* Hover effect untuk baris tabel */
.table-responsive table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Responsive design */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
  }

  .container {
    width: 100%;
    padding: 10px;
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .form-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .btn-primary,
  .btn-secondary,
  .btn-warning {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 14px;
  }

  /* Responsive table */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
  }

  .form-table {
    min-width: 300px;
  }

  .form-table th,
  .form-table td {
    padding: 8px;
  }

  .btn-remove {
    padding: 4px 8px;
    font-size: 12px;
  }
}
