* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  padding: 20px;
  animation: gradientShift 15s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  animation: slideIn 0.5s ease-out;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card h1 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 2.5em;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
  color: #667eea;
  margin-bottom: 25px;
  font-size: 2em;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

input {
  width: 100%;
  padding: 15px;
  margin: 12px 0;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

input:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

input::placeholder {
  color: #999;
}

button {
  width: 100%;
  padding: 15px;
  margin: 12px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

button:active {
  transform: translateY(-1px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 30px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar h1 {
  color: #667eea;
  font-size: 2.2em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.topbar button {
  max-width: 150px;
  padding: 12px 25px;
  font-size: 16px;
}

table {
  background: rgba(255, 255, 255, 0.95);
  width: 100%;
  margin-top: 30px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 18px;
  text-align: left;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td {
  padding: 18px;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
  font-size: 15px;
}

tr:last-child td {
  border-bottom: none;
}

tr {
  transition: all 0.3s ease;
}

tr:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: scale(1.01);
}

.err {
  color: #ff4757;
  text-align: center;
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 71, 87, 0.1);
  border-radius: 8px;
  border-left: 4px solid #ff4757;
  font-weight: bold;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.emoji {
  font-size: 1.2em;
  margin-right: 8px;
}

.form-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-section h2 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.8em;
  text-align: center;
}

.success-message {
  background: rgba(46, 213, 115, 0.1);
  color: #2ed573;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 4px solid #2ed573;
  text-align: center;
  font-weight: bold;
  animation: slideIn 0.5s ease-out;
}

/* Dashboard Stats */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: slideUp 0.5s ease-out;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card .icon {
  font-size: 3em;
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 2.5em;
  font-weight: bold;
  color: #667eea;
  margin: 10px 0;
}

.stat-card .label {
  color: #666;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Search Bar */
.search-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  animation: slideUp 0.5s ease-out;
}

.search-container input {
  margin: 0;
  font-size: 18px;
}

/* Action Buttons */
.btn-action {
  width: auto;
  padding: 8px 15px;
  margin: 0 5px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  display: inline-block;
}

.btn-edit {
  background: linear-gradient(135deg, #2ed573 0%, #1ecc5a 100%);
  box-shadow: 0 4px 15px rgba(46, 213, 115, 0.4);
}

.btn-edit:hover {
  background: linear-gradient(135deg, #1ecc5a 0%, #2ed573 100%);
  box-shadow: 0 6px 20px rgba(46, 213, 115, 0.6);
}

.btn-delete {
  background: linear-gradient(135deg, #ff4757 0%, #ee5a6f 100%);
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn-delete:hover {
  background: linear-gradient(135deg, #ee5a6f 0%, #ff4757 100%);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
}

.btn-cancel {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4);
}

.btn-cancel:hover {
  background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
  box-shadow: 0 6px 20px rgba(149, 165, 166, 0.6);
}

.actions-cell {
  white-space: nowrap;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: rgba(255, 255, 255, 0.98);
  padding: 40px;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease-out;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2em;
  cursor: pointer;
  color: #667eea;
  transition: transform 0.3s ease;
  background: none;
  border: none;
  width: auto;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.modal-close:hover {
  transform: rotate(90deg);
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content button {
  margin-top: 10px;
}

/* Message Alerts */
.alert {
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: bold;
  text-align: center;
  animation: slideIn 0.5s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.alert-success {
  background: rgba(46, 213, 115, 0.1);
  color: #2ed573;
  border-left: 4px solid #2ed573;
}

.alert-error {
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
  border-left: 4px solid #ff4757;
}

/* Toggle Form Button */
.toggle-form-btn {
  width: 100%;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.toggle-form-btn:hover {
  background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
  box-shadow: 0 6px 20px rgba(240, 147, 251, 0.6);
}

.form-section.hidden {
  display: none;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.empty-state .icon {
  font-size: 6em;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .card {
    padding: 30px 20px;
  }
  
  .topbar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .topbar button {
    max-width: 100%;
  }
  
  table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
  }
  
  th, td {
    padding: 12px 8px;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .btn-action {
    display: block;
    width: 100%;
    margin: 5px 0;
  }
  
  .modal-content {
    padding: 30px 20px;
  }
}
