/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Form Container */
.form-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
}

.form-container h2 {
  margin-bottom: 10px;
  color: #2d3748;
  font-size: 28px;
  font-weight: 600;
}

.form-container p {
  margin-bottom: 30px;
  color: #718096;
  font-size: 14px;
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-weight: 500;
  color: #4a5568;
  font-size: 14px;
}

/* Required Field Indicator */
.required {
  color: #d32f2f;
  font-weight: bold;
  margin-left: 2px;
}

/* Input Styles */
input,
textarea {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #f7fafc;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input:hover,
textarea:hover {
  border-color: #cbd5e0;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Button Styles */
button[type="submit"] {
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Response Message */
#response {
  margin-top: 20px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  display: none;
}

#response.show {
  display: block;
}

#response.success {
  background-color: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

#response.error {
  background-color: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

/* Validation Styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #fc8181;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: #68d391;
}

/* Error Message Styles */
.error-message {
  display: none;
  color: #c53030;
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
  padding-left: 4px;
}

.error-message.show {
  display: block;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #fc8181;
  background-color: #fff5f5;
}

/* Responsive Design */
@media (max-width: 600px) {
  .form-container {
    padding: 30px 20px;
  }

  .form-container h2 {
    font-size: 24px;
  }

  input,
  textarea,
  button[type="submit"] {
    font-size: 14px;
  }
}

/* Accessibility: Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Data Table */
.view-data-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
}

.view-data-btn:hover {
  background-color: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

table {
  border-collapse: collapse;
  border: 2px solid rgb(140 140 140);
  font-family: sans-serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

caption {
  caption-side: top;
  padding: 10px;
  font-weight: bold;
}

thead,
tfoot {
  background-color: rgb(228 240 245);
}

th,
td {
  border: 1px solid rgb(160 160 160);
  padding: 8px 10px;
}

td:last-of-type {
  text-align: center;
}

tbody > tr:nth-of-type(even) {
  background-color: rgb(237 238 242);
}

tfoot th {
  text-align: right;
}

tfoot td {
  font-weight: bold;
}

.main-page-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
}
/* end of CSS */