/* ===== Common Styles — Shared across all pages ===== */

/* ===== Header ===== */

.header-glass {
  background: rgba(11, 11, 13, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 20px rgba(255, 50, 100, 0.1);
  transition:
    background 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.6s ease;
}

.header-scrolled {
  background: rgba(11, 11, 13, 0.92) !important;
  box-shadow: 0 0 40px rgba(255, 50, 100, 0.2) !important;
}

.nav-link {
  color: #94a3b8;
  transition: color 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link.active {
  color: #f43f5e;
  border-bottom: 2px solid #ea580c;
  padding-bottom: 4px;
}

.btn-login {
  background: rgba(254, 0, 0, 0.67);
  border-radius: 4px;
}


/* ===== Scroll Reveal Animations ===== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */

.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.12s; }
.stagger-3 { transition-delay: 0.19s; }
.stagger-4 { transition-delay: 0.26s; }
.stagger-5 { transition-delay: 0.33s; }
.stagger-6 { transition-delay: 0.40s; }


/* ===== Floating Animations ===== */

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  16%       { transform: translate(12px, -8px) scale(1.03); }
  33%       { transform: translate(22px, -16px) scale(1.05); }
  50%       { transform: translate(8px, -6px) scale(1.02); }
  66%       { transform: translate(-12px, 12px) scale(0.96); }
  83%       { transform: translate(-6px, 6px) scale(0.98); }
}

.animate-float {
  animation: float 10s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%       { transform: translate(-14px, 8px) scale(1.04); }
  50%       { transform: translate(-28px, 18px) scale(1.08); }
  75%       { transform: translate(-16px, 10px) scale(1.05); }
}

.animate-float-slow {
  animation: float-slow 14s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}


/* ===== User Dropdown Menu ===== */

/* 全局SVG图标尺寸保护 */
.user-menu svg {
  width: auto !important;
  height: auto !important;
}

.user-menu-btn svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

/* User menu container */
.user-menu {
  position: relative;
  display: inline-block;
  z-index: 9999;
}

/* User menu button - clickable area */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  transition: all 0.2s ease;
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-menu-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* User avatar circle */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fe8031, #ff0000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

/* User name text */
.user-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chevron arrow */
.user-chevron {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.user-menu-btn.active .user-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel - hidden by default */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: rgba(26, 26, 31, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 99999;
  display: none;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-origin: top right;
}

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

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

/* Dropdown user info section */
.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fe8031, #ff0000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  line-height: 40px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

.dropdown-user-text {
  flex: 1;
  min-width: 0;
}

.dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-email {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}

/* Dropdown divider */
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Dropdown items */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* 确保图标尺寸正确 */
.dropdown-item svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.dropdown-item:hover svg {
  color: #fff;
}

.dropdown-danger {
  color: #ef4444;
}

.dropdown-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ff6b6b;
}

.dropdown-danger svg {
  color: #ef4444;
}

.dropdown-danger:hover svg {
  color: #ff6b6b;
}

.disabled-item {
  opacity: 0.4;
  cursor: not-allowed;
}

.disabled-item:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
}


/* ===== Global Toast ===== */

.toast-global {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 28px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast-global.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-global.success {
  border-color: rgba(34, 197, 94, 0.4);
}



.toast-global.error {
  border-color: rgba(255, 65, 48, 0.4);
}

.toast-global.info {
  border-color: rgba(59, 130, 246, 0.4);
}


/* ===== Scrollbar ===== */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #051424;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
