/**
 * Authentication Modal Styles
 * Styles for login, signup, and password reset forms
 * 
 * @version 1.0.0
 */

/* Modal Overlay */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-modal--visible {
  opacity: 1;
  visibility: visible;
}

.auth-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Modal Container */
.auth-modal__container {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  animation: auth-modal-slide-in 0.3s ease;
}

@keyframes auth-modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Content */
.auth-modal__content {
  background: var(--surface-primary, #1a1a2e);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

/* Header */
.auth-modal__header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-modal__logo {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.auth-modal__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  margin: 0 0 8px 0;
}

.auth-modal__subtitle {
  font-size: 14px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  margin: 0;
}

/* Form */
.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-modal__field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.auth-modal__field input {
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  background: var(--surface-secondary, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, #ffffff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-modal__field input:focus {
  outline: none;
  border-color: var(--accent-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-modal__field input::placeholder {
  color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
}

/* Error & Success Messages */
.auth-modal__error {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 13px;
  text-align: center;
}

.auth-modal__success {
  padding: 12px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  color: #22c55e;
  font-size: 13px;
  text-align: center;
}

/* Buttons */
.auth-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-modal__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal__btn--primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.auth-modal__btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.auth-modal__btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-modal__btn--google {
  background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
  width: 100%;
}

.auth-modal__btn--google:hover:not(:disabled) {
  background: var(--surface-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.2));
}

.auth-modal__btn--microsoft {
  margin-top: 10px;
  background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
  width: 100%;
}

.auth-modal__btn--microsoft:hover:not(:disabled) {
  background: var(--surface-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.2));
}

/* Divider */
.auth-modal__divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
  font-size: 12px;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.auth-modal__divider span {
  padding: 0 16px;
}

/* Footer */
.auth-modal__footer {
  margin-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal__footer-text {
  font-size: 13px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}

.auth-modal__link {
  background: none;
  border: none;
  color: var(--accent-primary, #6366f1);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.auth-modal__link:hover {
  color: var(--accent-hover, #818cf8);
  text-decoration: underline;
}

/* Body class to prevent scrolling */
body.auth-modal-open {
  overflow: hidden;
}

/* User Menu (after login) - Base styles only, detailed styles in layout.css */
.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.user-menu__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.user-menu__trigger:hover .user-menu__avatar {
  box-shadow: 0 0 0 2px #e8e8e8;
}

.user-menu__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .auth-modal__container {
    margin: 16px;
  }
  
  .auth-modal__content {
    padding: 24px;
  }
  
  .auth-modal__logo {
    font-size: 40px;
  }
  
  .auth-modal__title {
    font-size: 20px;
  }
}
