/* ========================================
   A Art Museum - Global Styles
   AI的艺术 - 共享样式表
   ======================================== */

/* ========================================
   1. CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
  /* Primary Colors (Museum Foundation) */
  --color-bg-primary: #0d0d15;
  --color-bg-secondary: #1a1a2e;
  --color-bg-tertiary: #16213e;
  --color-bg-elevated: #1e2a4a;

  /* Accent Colors (Gold Luxury) */
  --color-gold-primary: #d4af37;
  --color-gold-light: #ffd700;
  --color-gold-dark: #b8941f;
  --color-gold-muted: #c9b037;

  /* Text Colors */
  --color-text-primary: #faf9f6;
  --color-text-secondary: #e8e6e1;
  --color-text-muted: #a0a0a0;
  --color-text-gold: #d4af37;

  /* Semantic Colors */
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;

  /* Font Families */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-accent: 'Cinzel', 'Playfair Display', serif;

  /* Spacing System */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);

  /* Animation Timing */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-museum: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-slowest: 1000ms;
}

/* ========================================
   2. Body Reset (NO * selector reset)
   ======================================== */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
}

h1 { font-size: 4rem; letter-spacing: -0.02em; }
h2 { font-size: 2.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; font-weight: 500; }

p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-default);
}

a:hover {
  color: var(--color-gold-primary);
}

/* ========================================
   4. Keyframe Animations
   ======================================== */

/* Fade In Up - Element entrance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In - Simple opacity transition */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale In - With slight scale */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gold Pulse - Glowing effect */
@keyframes goldPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
  }
}

/* Float - Gentle floating motion */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Countdown Pulse - Timer emphasis */
@keyframes countdownPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Coin Drop - Falling animation */
@keyframes coinDrop {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(0) rotate(360deg);
    opacity: 1;
  }
}

/* Shimmer - Light sweep effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Spin - Rotation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pulse - Opacity pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   5. Animation Utility Classes
   ======================================== */
.animate-fadeInUp {
  animation: fadeInUp var(--duration-slow) var(--ease-museum) forwards;
}

.animate-fadeIn {
  animation: fadeIn var(--duration-normal) var(--ease-default) forwards;
}

.animate-scaleIn {
  animation: scaleIn var(--duration-slow) var(--ease-museum) forwards;
}

.animate-goldPulse {
  animation: goldPulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-countdownPulse {
  animation: countdownPulse 1s ease-in-out infinite;
}

.animate-coinDrop {
  animation: coinDrop var(--duration-slow) var(--ease-museum) forwards;
}

.animate-shimmer {
  animation: shimmer 2s linear infinite;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 175, 55, 0.1),
    transparent
  );
  background-size: 200% 100%;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-slideInRight {
  animation: slideInRight var(--duration-slow) var(--ease-museum) forwards;
}

.animate-slideInLeft {
  animation: slideInLeft var(--duration-slow) var(--ease-museum) forwards;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* Initial hidden state for animations */
.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.is-visible {
  opacity: 1;
}

/* ========================================
   6. Gold Effects
   ======================================== */
.gold-glow {
  box-shadow: var(--shadow-gold);
}

.gold-glow-strong {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.gold-border {
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.gold-border-strong {
  border: 1px solid var(--color-gold-primary);
}

.gold-text {
  color: var(--color-gold-primary);
}

.gold-text-light {
  color: var(--color-gold-light);
}

.gold-gradient-text {
  background: linear-gradient(135deg, var(--color-gold-primary), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   7. Button Styles
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  border: none;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-gold-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold-primary), var(--color-gold-dark));
  color: var(--color-bg-primary);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-primary));
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.btn-secondary {
  background: transparent;
  color: var(--color-gold-primary);
  border: 1px solid rgba(212, 175, 55, 0.5);
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-gold-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  color: var(--color-gold-primary);
  background: rgba(212, 175, 55, 0.05);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1.125rem;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
}

/* ========================================
   8. Card Styles
   ======================================== */
.card {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-frame {
  border: 8px solid #2a2a3e;
  box-shadow: 
    inset 0 0 0 2px rgba(212, 175, 55, 0.3),
    var(--shadow-lg);
}

.card-frame:hover {
  border-color: #3a3a4e;
  box-shadow: 
    inset 0 0 0 2px rgba(212, 175, 55, 0.5),
    var(--shadow-gold);
}

/* ========================================
   9. Form Elements
   ======================================== */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--duration-normal) var(--ease-default);
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--color-gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ========================================
   10. Modal Styles
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-secondary);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--duration-normal) var(--ease-museum);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

/* ========================================
   11. Utility Classes
   ======================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}

.section {
  padding: var(--space-16) 0;
}

.section-lg {
  padding: var(--space-20) 0;
}

/* Text utilities */
.text-gradient-gold {
  background: linear-gradient(135deg, var(--color-gold-primary), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--color-text-muted);
}

/* Backdrop blur utilities */
.backdrop-blur-nav {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-muted);
}

/* Selection styling */
::selection {
  background: rgba(212, 175, 55, 0.3);
  color: var(--color-text-primary);
}
