/* General Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: #333;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile First */
#login-container {
  width: 100%;
  max-width: 420px;
  margin: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 50px;
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
}

#dashboard-container {
  width: 100%;
  max-width: 1200px;
  margin: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
}

.logo {
  width: 140px;
  height: auto;
  margin-bottom: 30px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: white;
  padding: 30px;
}

h1 {
  font-size: 2em;
  margin: 0;
  font-weight: 300;
}

#login-container h1 {
  color: #333;
  margin-bottom: 30px;
}

input, button {
  width: 100%;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 2px solid #e1e5e9;
  box-sizing: border-box;
  font-size: 16px;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.2);
}

button {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(15,15,35,0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15,15,35,0.5);
}

header button {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  font-size: 14px;
}

header button:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.error-message {
  color: #d93025;
  font-size: 0.9em;
}

/* User Lists */
#active-users-list, #all-users-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.user-card {
  background-color: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #f0f2f5;
  transition: all 0.3s ease;
}

.user-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.user-card h3 {
  margin-top: 0;
  font-size: 1.1em;
}

.user-card p {
  margin: 5px 0;
  font-size: 0.9em;
  word-break: break-all;
}

.user-actions button {
  padding: 8px 12px;
  margin-right: 5px;
  font-size: 0.8em;
}

main {
  padding: 30px;
}

#active-users-section, #all-users-section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

#active-users-section h2, #all-users-section h2 {
  color: #333;
  font-size: 1.4em;
  margin: 0;
  font-weight: 500;
}

.add-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  color: white;
  padding: 12px 24px !important;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 !important;
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.form-group small {
  display: block;
  color: #6c757d;
  font-size: 12px;
  margin-top: 4px;
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

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

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

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

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #1a1a2e;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.form-actions button {
  flex: 1;
  padding: 14px;
  margin: 0;
}

#cancel-edit {
  background: #6c757d !important;
}

#cancel-edit:hover {
  background: #5a6268 !important;
  transform: translateY(-1px);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #1a1a2e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1001;
  transform: translateX(400px);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

/* Improved Delete Button */
.delete-btn {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.delete-btn:hover {
  background: linear-gradient(135deg, #c82333, #a71e2a) !important;
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  #login-container {
    padding: 60px;
  }

  .logo {
    width: 150px;
  }

  #active-users-list, #all-users-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  body {
    padding: 40px;
  }

  .modal-content {
    margin: 10% auto;
    width: 80%;
  }
}
