/**
 * Authentication Modal Styles
 * Consistent with existing search modal design
 */

/* Auth Backdrop - Same style as search backdrop */
.auth-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 2rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.auth-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-backdrop[hidden] {
  display: none;
}

/* Auth Modal - Similar to search modal */
.auth-modal {
  width: min(90vw, 480px);
  max-height: 75vh;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden; /* Remove scrollbar from modal container */
}

/* Auth Modal Header */
.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 1rem;
}

.auth-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Diatype-bold', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
  text-transform: uppercase;
}

.auth-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.auth-tab.active {
  color: white;
  border-bottom-color: rgb(255, 221, 0);
}

/* Close Button - Same as search */
.auth-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease, transform 0.3s ease;
  padding: 0;
  margin-left: auto;
}

.auth-close:hover,
.auth-close:focus-visible {
  color: rgb(255, 221, 0);
  transform: scale(1.1);
  outline: none;
}

/* Auth Modal Body */
.auth-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  overflow-y: auto; /* Allow scrolling only in body if needed */
  overflow-x: hidden;
  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 221, 0, 0.3) transparent;
}

.auth-modal-body::-webkit-scrollbar {
  width: 6px;
}

.auth-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.auth-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 221, 0, 0.3);
  border-radius: 3px;
}

.auth-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 221, 0, 0.5);
}

/* Auth Forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-form.active {
  display: flex;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group label {
  font-family: 'Diatype-bold', sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-family: 'Diatype-light', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.form-group input:focus {
  border-color: rgb(255, 221, 0);
  background: rgba(255, 255, 255, 0.12);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Form Error */
.form-error {
  display: none;
  padding: 0.75rem 1rem;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  color: rgb(252, 165, 165);
  font-family: 'Diatype-light', sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Submit Button */
.auth-submit-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: rgb(255, 221, 0);
  color: black;
  border: none;
  border-radius: 12px;
  font-family: 'Diatype-bold', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-top: 0.5rem;
}

.auth-submit-btn:hover:not(:disabled) {
  background: rgb(255, 230, 50);
  transform: translateY(-1px);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

#sign-out-btn {
  background: transparent;
  border: none;
  color: white;
  font-family: 'Diatype-bold', sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease;
}

#sign-out-btn:hover {
  color: rgb(255, 221, 0);
}

/* Notification Toast */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: white;
  font-family: 'Diatype-light', sans-serif;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 300;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification-success {
  border-left: 3px solid rgb(34, 197, 94);
}

.notification-error {
  border-left: 3px solid rgb(220, 38, 38);
}

.notification-warning {
  border-left: 3px solid rgb(251, 191, 36);
}

.notification-info {
  border-left: 3px solid rgb(59, 130, 246);
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-modal {
    width: 95vw;
    padding: 1.25rem;
  }

  .auth-tabs {
    gap: 0.75rem;
  }

  .auth-tab {
    font-size: 1rem;
  }

  .notification {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100vw - 2rem);
  }
}
