/**
 * Authentication UI Styles
 * Login modal, user menu, and auth-related components
 */

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 12px;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #999;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

/* Login Form */
.login-step h2 {
  color: #fff;
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
}

.login-description {
  color: #999;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: #ccc;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #8B5CF6;
}

.form-group input::placeholder {
  color: #666;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #8B5CF6;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #7C3AED;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #333;
  color: #fff;
}

.btn-secondary:hover {
  background: #444;
}

.btn-block {
  width: 100%;
}

/* Alerts */
.alert {
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ff6b6b;
}

.alert-success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #81c784;
}

/* Success State */
.login-success-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1rem;
}

#login-step-success h2 {
  text-align: center;
}

#login-step-success .login-description {
  text-align: center;
}

.login-help {
  color: #666;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 1rem;
}

.login-terms {
  color: #666;
  font-size: 0.75rem;
  text-align: center;
  margin-top: 1.5rem;
  line-height: 1.4;
}

/* User Menu (for navigation) */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu-button {
  background: #222;
  border: 1px solid #444;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.user-menu-button:hover {
  background: #333;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #8B5CF6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}

.user-menu.open .user-menu-dropdown {
  display: block;
}

.user-menu-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #ccc;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  background: none;
  font-size: 1rem;
}

.user-menu-item:hover {
  background: #222;
  color: #fff;
}

.user-menu-divider {
  height: 1px;
  background: #333;
  margin: 0.5rem 0;
}

/* Account Tier Badge */
.tier-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-badge-free {
  background: #333;
  color: #999;
}

.tier-badge-premium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.tier-badge-lifetime {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  .login-step h2 {
    font-size: 1.5rem;
  }

  .user-menu-dropdown {
    right: auto;
    left: 0;
  }
}
