/**
 * File: client/css/auth-modal.css
 * 认证弹窗样式
 * 作用: 登录和注册弹窗的样式定义
 */

/* 弹窗遮罩层 */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

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

/* 弹窗内容 */
.auth-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease-out;
}

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

/* 弹窗头部 */
.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #e5e7eb;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.auth-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.auth-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* 弹窗主体 */
.auth-modal-body {
  padding: 28px;
}

/* 表单样式 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-error {
  display: none;
  font-size: 13px;
  color: #ef4444;
  margin-top: 4px;
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

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

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.btn-loading {
  display: none;
}

/* 小型加载动画 */
.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* 弹窗底部 */
.auth-modal-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.auth-modal-footer p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.link-primary {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.link-primary:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  z-index: 10000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* 用户信息区域 */
.user-info {
  display: none;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.user-dropdown {
  position: relative;
}

.user-dropdown-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #6b7280;
  font-size: 18px;
  border-radius: 6px;
  transition: all 0.2s;
}

.user-dropdown-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 1000;
}

.user-dropdown-menu.show {
  display: block;
  animation: dropdownFadeIn 0.2s ease-out;
}

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

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.user-dropdown-item:hover {
  background: #f3f4f6;
}

.user-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
  color: #ef4444;
}

/* 未登录遮罩提示 */
.auth-required-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-required-overlay.show {
  display: flex;
}

.auth-required-overlay:hover {
  background: rgba(0, 0, 0, 0.4);
}

.auth-required-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 30px 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: 400px;
  animation: messageSlideIn 0.5s ease-out;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.auth-required-overlay:hover .auth-required-message {
  transform: scale(1.05);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-required-message h2 {
  font-size: 24px;
  margin: 0 0 15px 0;
  font-weight: 600;
}

.auth-required-message p {
  font-size: 16px;
  margin: 0;
  opacity: 0.95;
  line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 640px) {
  .auth-modal-content {
    width: 95%;
    max-width: none;
  }

  .auth-modal-header {
    padding: 20px;
  }

  .auth-modal-body {
    padding: 20px;
  }

  .auth-modal-title {
    font-size: 20px;
  }

  .auth-required-message {
    margin: 0 20px;
    padding: 25px 30px;
  }

  .auth-required-message h2 {
    font-size: 20px;
  }

  .auth-required-message p {
    font-size: 14px;
  }
}
