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

:root {
  --primary-color: #ff6b9d;
  --secondary-color: #c44569;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: #ffffff;
  --text-color: #2d3436;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --error-color: #ff6b6b;
  --success-color: #51cf66;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Animierte Katzen im Hintergrund */
.login-cats-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-cat {
  position: absolute;
  font-size: 2.5rem;
  animation: floatAround 20s ease-in-out infinite;
  opacity: 0.3;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes floatAround {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(30vw, -20vh) rotate(90deg);
  }

  50% {
    transform: translate(-20vw, 30vh) rotate(180deg);
  }

  75% {
    transform: translate(40vw, 40vh) rotate(270deg);
  }
}

/* Login Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

.login-box {
  background: var(--card-bg);
  border-radius: 25px;
  padding: 40px;
  box-shadow: var(--shadow);
  animation: slideIn 0.6s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.cat-icon {
  font-size: 4rem;
  animation: bounce 2s ease-in-out infinite;
  display: inline-block;
  margin-bottom: 10px;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.login-header h1 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.login-subtitle {
  color: #636e72;
  font-size: 0.95rem;
}

/* Form */
.login-form {
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
}

.label-icon {
  margin-right: 5px;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 38px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.toggle-password:hover {
  transform: scale(1.2);
}

/* Error Message */
.error-message {
  color: var(--error-color);
  background: rgba(255, 107, 107, 0.1);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  display: none;
  animation: shake 0.5s ease-in-out;
}

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

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6);
}

.login-btn:active {
  transform: translateY(0);
}

/* Footer */
.login-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.hint {
  color: #636e72;
  font-size: 0.85rem;
}

/* Admin Panel Button */
.admin-panel-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(251, 140, 0, 0.5);
  transition: all 0.3s ease;
  z-index: 5000;
  animation: adminPulse 2s ease-in-out infinite;
}

@keyframes adminPulse {
  0%,
  100% {
    box-shadow: 0 5px 20px rgba(251, 140, 0, 0.5);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 5px 30px rgba(251, 140, 0, 0.9);
    transform: scale(1.05);
  }
}

.admin-panel-btn:hover {
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 8px 30px rgba(251, 140, 0, 0.8);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.4s ease-out;
}

.modal-header {
  padding: 25px;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close-btn {
  font-size: 2rem;
  cursor: pointer;
  color: #636e72;
  transition: all 0.3s ease;
}

.close-btn:hover {
  color: var(--primary-color);
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px;
}

/* Admin Section */
.admin-section {
  margin-bottom: 30px;
}

.admin-section h3 {
  margin-bottom: 15px;
  color: var(--text-color);
}

.add-user-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.add-user-form input {
  flex: 1;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
}

.add-btn {
  padding: 10px 20px;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.add-btn:hover {
  background: #40c057;
  transform: scale(1.05);
}

/* Users List */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.user-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-icon {
  font-size: 1.5rem;
}

.user-name {
  font-weight: 600;
  color: var(--text-color);
}

.delete-user-btn {
  padding: 8px 15px;
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.delete-user-btn:hover {
  background: #fa5252;
  transform: scale(1.05);
}

.user-count {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-align: center;
  padding: 20px;
  background: rgba(255, 107, 157, 0.1);
  border-radius: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  /* Tablet */
  .login-container {
    max-width: 500px;
  }

  .login-header h1 {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  /* Mobile Performance Optimierungen */

  /* Reduziere Hintergrund-Animationen drastisch */
  .login-cat {
    animation-duration: 30s !important; /* Noch langsamer */
    will-change: transform;
    font-size: 1.5rem !important;
  }

  /* Nur 5 Katzen auf Mobile (wird in JS gesteuert) */
  .login-cats-container {
    opacity: 0.5; /* Weniger ablenkend */
  }

  body {
    padding: 10px;
    min-height: 100vh;
    display: flex;
  }

  .login-container {
    max-width: 100%;
    padding: 10px;
  }

  .login-box {
    padding: 30px 20px;
    border-radius: 20px;
  }

  .login-header h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .cat-icon {
    font-size: 3rem;
    animation-duration: 3s; /* Langsamere Animation */
  }

  .login-subtitle {
    font-size: 0.85rem;
  }

  /* Größere Touch-Targets */
  .form-group input {
    padding: 15px;
    font-size: 16px; /* Verhindert Zoom auf iOS */
  }

  .toggle-password {
    right: 15px;
    top: 40px;
    font-size: 1.5rem;
    padding: 10px;
  }

  .login-btn {
    padding: 18px;
    font-size: 1.05rem;
    margin-top: 10px;
  }

  /* Modal für Mobile optimieren */
  .modal-content {
    width: 95%;
    max-width: 95%;
    max-height: 90vh;
  }

  .modal-header {
    padding: 20px 15px;
  }

  .modal-body {
    padding: 20px 15px;
  }

  .add-user-form {
    flex-direction: column;
  }

  .add-user-form input {
    font-size: 16px; /* Verhindert Zoom */
  }

  /* Admin Button größer auf Mobile */
  .admin-panel-btn {
    width: 55px;
    height: 55px;
    bottom: 15px;
    right: 15px;
    font-size: 1.8rem;
  }

  /* Reduziere Schatten für bessere Performance */
  .login-box,
  .modal-content,
  .login-btn {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15) !important;
  }
}

@media (max-width: 500px) {
  .login-box {
    padding: 25px 15px;
  }

  .login-header h1 {
    font-size: 1.2rem;
  }

  .cat-icon {
    font-size: 2.5rem;
  }

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

  .user-item {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .delete-user-btn {
    width: 100%;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .login-container {
    padding: 5px;
  }

  .login-box {
    padding: 20px 15px;
  }

  .cat-icon {
    font-size: 2rem;
    margin-bottom: 5px;
  }

  .login-header {
    margin-bottom: 20px;
  }

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