/* Auth Modal Styles */
#authModal {
  backdrop-filter: blur(20px);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(249, 115, 22, 0.9) 100%);
}

#authContainer {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(194, 65, 12, 0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

/* Modal Animation States */
#authModal.show {
  opacity: 1;
  visibility: visible;
}

#authModal.show #authContainer {
  transform: scale(1);
  opacity: 1;
}

/* Auth Input Styles */
.auth-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.auth-input:focus + .absolute {
  opacity: 1;
}

/* Auth Button Styles */
.auth-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #f97316 100%);
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.auth-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.auth-btn:hover::before {
  left: 100%;
}

.auth-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(249, 115, 22, 0.6);
}

/* Form Transition Animations */
.form-slide-enter {
  animation: slideInRight 0.5s ease-out forwards;
}

.form-slide-exit {
  animation: slideOutLeft 0.5s ease-out forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Floating Background Elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.8), 0 0 60px rgba(147, 51, 234, 0.4);
  }
}

/* Enhanced Pulse Animation */
.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Input Focus Ring Enhancement */
.auth-input:focus {
  animation: input-glow 0.3s ease-out;
}

@keyframes input-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* Success/Error Messages */
.auth-message {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid;
  animation: slideInDown 0.3s ease-out;
}

.auth-message.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.auth-message.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Loading State */
.auth-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.auth-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  #authContainer {
    margin: 16px;
    max-width: none;
  }
  
  .auth-input {
    padding: 16px 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  #authModal {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 50%, rgba(71, 85, 105, 0.9) 100%);
  }
}

/* Accessibility */
.auth-input:focus-visible,
.auth-btn:focus-visible,
.social-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
