/* Auth Popup Styles */

/* User button in navbar */
.user_auth_button {
  position: relative;
  cursor: pointer;
}

.user_auth_button .user_avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent-color, #4a90d9) 0%,
    var(--accent-secondary, #357abd) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

/* Auth Modal Overlay */
.auth_modal_overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.auth_modal_overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Auth Modal Container */
.auth_modal {
  background: var(--bg-color, #ffffff);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.auth_modal_overlay.active .auth_modal {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.auth_modal_header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth_modal_header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color, #333);
}

.auth_modal_close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-color, #333);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth_modal_close:hover {
  background: var(--bg-tertiary, #e0e0e0);
  transform: rotate(90deg);
}

/* Tab Switcher */
.auth_tabs {
  display: flex;
  padding: 20px 24px 0;
  gap: 8px;
}

.auth_tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-muted, #666);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth_tab:hover {
  background: var(--bg-tertiary, #e0e0e0);
}

.auth_tab.active {
  background: var(--accent-color, #4a90d9);
  color: white;
}

/* Form Container */
.auth_form_container {
  padding: 24px;
}

.auth_form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth_form.active {
  display: flex;
}

/* Form Groups */
.auth_input_group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth_input_group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #666);
}

.auth_input_group input {
  padding: 12px 16px;
  border: 2px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  font-size: 15px;
  background: var(--bg-color, #fff);
  color: var(--text-color, #333);
  transition: all 0.2s ease;
}

.auth_input_group input:focus {
  outline: none;
  border-color: var(--accent-color, #4a90d9);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.auth_input_group input::placeholder {
  color: var(--text-muted, #999);
}

/* Submit Button */
.auth_submit_btn {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--accent-color, #4a90d9) 0%,
    var(--accent-secondary, #357abd) 100%
  );
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.auth_submit_btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.4);
}

.auth_submit_btn:active {
  transform: translateY(0);
}

.auth_submit_btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Error/Success Messages */
.auth_message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.auth_message.error {
  display: block;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.auth_message.success {
  display: block;
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* User Profile Dropdown */
.user_dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-color, #fff);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 10001;
  overflow: hidden;
}

.user_dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user_dropdown_header {
  padding: 16px;
  background: var(--bg-secondary, #f5f5f5);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.user_dropdown_header .username {
  font-weight: 600;
  color: var(--text-color, #333);
  font-size: 15px;
}

.user_dropdown_header .email {
  font-size: 12px;
  color: var(--text-muted, #666);
  margin-top: 2px;
}

.user_dropdown_item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-color, #333);
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.user_dropdown_item:hover {
  background: var(--bg-secondary, #f5f5f5);
}

.user_dropdown_item i {
  width: 20px;
  text-align: center;
  color: var(--text-muted, #666);
}

.user_dropdown_item.logout {
  color: #dc2626;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.user_dropdown_item.logout i {
  color: #dc2626;
}

/* Quick Action Buttons (when not logged in) */
.auth_quick_actions {
  display: flex;
  gap: 8px;
  padding: 0 24px 24px;
}

.auth_quick_btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth_quick_btn.guest {
  background: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border-color, #e0e0e0);
  color: var(--text-color, #333);
}

.auth_quick_btn.guest:hover {
  background: var(--bg-tertiary, #e0e0e0);
}

/* Dark mode adjustments */
.dark-mode .auth_modal {
  background: var(--bg-color, #1e1e1e);
}

.dark-mode .auth_message.error {
  background: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

.dark-mode .auth_message.success {
  background: #052e16;
  color: #86efac;
  border-color: #166534;
}

/* Loading spinner */
.auth_loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: auth_spin 0.8s linear infinite;
}

@keyframes auth_spin {
  to {
    transform: rotate(360deg);
  }
}
