/* Reset e base styles */
* {
  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: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

header h1 {
  font-size: 2rem;
  font-weight: 300;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  min-width: 120px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.btn-edit {
  background: #28a745;
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  min-width: 80px;
}

.btn-edit:hover {
  background: #218838;
}

.btn-delete {
  background: #dc3545;
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  min-width: 80px;
}

.btn-delete:hover {
  background: #c82333;
}

/* Form Section */
.form-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.form-section h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.5rem;
  font-weight: 400;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e1e1;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

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

.form-group input[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

/* Table Section */
.table-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-section h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.5rem;
  font-weight: 400;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  background: #f8f9fa;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e1e1e1;
}

table td {
  padding: 15px;
  border-bottom: 1px solid #e1e1e1;
}

table tr:hover {
  background-color: #f8f9fa;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

/* Notification */
.notification {
  position: fixed;
  top: -100px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  transition: top 0.3s ease;
  max-width: 300px;
}

.notification.show {
  top: 20px;
}

.notification.success {
  background: #28a745;
}

.notification.error {
  background: #dc3545;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header {
    flex-direction: column;
    text-align: center;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .form-section,
  .table-section {
    padding: 20px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 13px;
    min-width: 100px;
  }

  /* Responsive table */
  table {
    font-size: 12px;
  }

  table th {
    display: none;
  }

  table td {
    display: block;
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #e1e1e1;
    position: relative;
    padding-left: 50%;
  }

  table td:before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    text-align: left;
  }

  table tr {
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    margin-bottom: 15px;
    display: block;
    background: white;
  }

  .actions {
    justify-content: flex-end;
  }

  .btn-edit,
  .btn-delete {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 70px;
  }

  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.2rem;
  }

  .form-section,
  .table-section {
    padding: 15px;
  }

  .form-group input {
    padding: 10px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
  }

  .actions {
    flex-direction: column;
    gap: 5px;
  }

  .btn-edit,
  .btn-delete {
    width: 100%;
    min-width: auto;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-section,
.table-section {
  animation: fadeIn 0.5s ease-out;
}

/* Focus improvements for accessibility */
.btn:focus,
input:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Hover effects */
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.form-group input:hover {
  border-color: #b8c6ea;
}
