/* Beautify CSS - Material You & Stunning Animations */

:root {
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50px;
  
  --spring-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spring-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --spring-snappy: cubic-bezier(0.2, 0.8, 0.2, 1);

  --shadow-hover: 0 12px 24px -4px rgba(2, 132, 199, 0.15), 0 8px 16px -4px rgba(2, 132, 199, 0.1);
  --shadow-btn: 0 4px 14px rgba(2, 132, 199, 0.3);
  --shadow-btn-hover: 0 6px 20px rgba(2, 132, 199, 0.4);
}

/* Base Body smooth scroll */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Input Enhancements --- */
input, textarea, select {
  border-radius: var(--radius-md) !important;
  transition: all 0.3s var(--spring-smooth) !important;
  background-color: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(4px);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15) !important;
  background-color: #fff !important;
  transform: translateY(-1px);
}

/* --- Button Enhancements (Material You) --- */
button.btn-primary, button.btn-secondary, button.btn-ghost, button.btn-danger, button.action-btn {
  border-radius: var(--radius-full) !important;
  transition: transform 0.2s var(--spring-snappy), box-shadow 0.2s var(--spring-snappy), filter 0.2s ease !important;
  position: relative;
  overflow: hidden;
}

/* Ensure all JS ripple targets have proper positioning context. */
button.ripple-host {
  position: relative;
  overflow: hidden;
}

button.btn-primary {
  box-shadow: var(--shadow-btn) !important;
}

button.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover) !important;
  filter: brightness(1.1);
}

button:active:not(:disabled) {
  transform: scale(0.94) !important;
}

/* Ripple Effect via JS/CSS */
.ripple-span {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  background-color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

/* --- Modals and Popups --- */
.modal-wrap, .modal-mask {
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.4) !important;
  animation: fadeIn 0.3s ease-out forwards;
}

.modal-card, .modal-content, .drawer-content {
  border-radius: var(--radius-lg) !important;
  animation: popIn 0.5s var(--spring-bounce) forwards !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.drawer-content {
  animation: slideUpFade 0.4s var(--spring-bounce) forwards !important;
}

/* --- Dropdowns and Context Menus --- */
.nav-menu, .custom-dropdown-list {
  animation: dropdownOpen 0.3s var(--spring-bounce) forwards;
  transform-origin: top;
}

/* --- Cards and List Items --- */
.stats-card, .panel, .project-row, .item, tr, .card, .equity-item, .account-item, .resource-item {
  transition: all 0.3s var(--spring-smooth);
  border-radius: var(--radius-md) !important;
}

.stats-card:hover, .panel:hover, .project-row:hover, .item:hover, .equity-item:hover, .account-item:hover, .resource-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-hover) !important;
  z-index: 10;
}

/* Keep "当前项目" tab panel consistent (no hover lift). */
.panel.resource-panel:hover {
  transform: none !important;
  box-shadow: 0 14px 36px rgba(17, 34, 64, 0.06) !important;
  z-index: auto !important;
}

/* --- Staggered Entry Animations (Triggered by JS) --- */
.stagger-enter {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.5s var(--spring-bounce) forwards;
}

/* --- Login Background & Orbs --- */
.auth-page, .auth-wrap {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.auth-card {
  animation: popIn 0.8s var(--spring-bounce) forwards !important;
  border-radius: var(--radius-lg) !important;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.85) !important;
}

.beautify-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

.beautify-orb-1 {
  width: 400px; height: 400px;
  background: var(--brand, #0284c7);
  top: -100px; left: -100px;
  animation: floatOrb 15s ease-in-out infinite;
}

.beautify-orb-2 {
  width: 500px; height: 500px;
  background: var(--brand-dark, #0369a1);
  bottom: -150px; right: -100px;
  animation: floatOrb 18s ease-in-out infinite reverse;
}

.beautify-orb-3 {
  width: 300px; height: 300px;
  background: var(--accent, #f97316);
  top: 30%; left: 60%;
  animation: floatOrb 12s ease-in-out infinite 2s;
}

/* --- Keyframes --- */
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(25px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(30px, -50px) scale(1.1) rotate(15deg); }
  66% { transform: translate(-20px, 40px) scale(0.9) rotate(-15deg); }
}

@keyframes dropdownOpen {
  0% { opacity: 0; transform: scaleY(0.8) translateY(-10px); }
  100% { opacity: 1; transform: scaleY(1) translateY(0); }
}
