/* =========================================================
   🎨 Ultimate Artistic Hexo Butterfly Experience
   Version: 3.0 Master Artist Edition
   
   Features:
   ✨ Luxury scrollbars with neon effects
   🌈 Advanced glassmorphism & morphing cards
   🎭 Cinematic animations & transitions
   🎪 Interactive particle systems
   🌟 Multi-dimensional hover effects
   🎨 Artistic gradient orchestration
   🔮 Magical micro-interactions
========================================================= */

:root {
  /* 🎨 Artistic Color Palette */
  --primary-magic: #6366f1;
  --secondary-dream: #8b5cf6;
  --accent-fire: #f59e0b;
  --accent-ocean: #06b6d4;
  --accent-forest: #10b981;
  --accent-sunset: #f97316;
  --accent-rose: #ec4899;
  --accent-emerald: #059669;
  
  /* 🌈 Premium Gradients */
  --gradient-aurora: linear-gradient(135deg, #6366f1 0%, #8b5cf6 25%, #ec4899 50%, #f59e0b 75%, #06b6d4 100%);
  --gradient-sunset: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  --gradient-ocean: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-forest: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  --gradient-fire: linear-gradient(135deg, #ff9a56 0%, #ff6b95 100%);
  --gradient-neon: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff, #06ffa5);
  --gradient-holographic: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #9370db, #ff1493);
  
  /* ✨ Glassmorphism Layers */
  --glass-light: rgba(255, 255, 255, 0.25);
  --glass-medium: rgba(255, 255, 255, 0.15);
  --glass-dark: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.3);
  
  /* 🌟 Shadow System */
  --shadow-glow-sm: 0 0 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-md: 0 0 40px rgba(99, 102, 241, 0.4);
  --shadow-glow-lg: 0 0 60px rgba(99, 102, 241, 0.5);
  --shadow-neon-pink: 0 0 30px rgba(236, 72, 153, 0.6);
  --shadow-neon-blue: 0 0 30px rgba(6, 182, 212, 0.6);
  --shadow-neon-green: 0 0 30px rgba(16, 185, 129, 0.6);
  --shadow-depth: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-floating: 0 35px 60px -12px rgba(99, 102, 241, 0.3);
  
  /* 🎭 Animation Curves */
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-dramatic: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  
  /* 📐 Spacing Harmony */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 9999px;
}

/* 🎯 LUXURY SCROLLBAR SYSTEM */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: var(--glass-dark);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-full);
  margin: 6px;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-aurora);
  background-size: 400% 400%;
  animation: gradientShift 4s ease infinite;
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  background-clip: content-box;
  transition: all 0.3s var(--ease-elastic);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-holographic);
  box-shadow: var(--shadow-glow-lg), inset 0 0 15px rgba(255, 255, 255, 0.3);
  transform: scale(1.2);
  border-width: 2px;
}

::-webkit-scrollbar-thumb:active {
  background: var(--gradient-neon);
  box-shadow: var(--shadow-glow-lg), 0 0 50px rgba(99, 102, 241, 0.8);
  transform: scale(1.3);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

/* Dark theme scrollbar enhancements */
html[theme='dark'] ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(99, 102, 241, 0.2);
}

html[theme='dark'] ::-webkit-scrollbar-thumb {
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1), var(--shadow-glow-sm);
}

/* 🌟 MORPHING CARD SYSTEM */
.card-widget, 
.recent-post-item, 
.post-block, 
.post-card, 
.card {
  position: relative;
  border-radius: var(--radius-lg) !important;
  background: var(--glass-light);
  backdrop-filter: blur(25px) saturate(180%);
  border: 2px solid var(--glass-border);
  box-shadow: var(--shadow-depth);
  transition: all 0.4s var(--ease-dramatic);
  overflow: hidden;
  will-change: transform;
  transform-style: preserve-3d;
}

/* Holographic border effect */
.card-widget::before,
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-holographic);
  background-size: 400% 400%;
  animation: holographicBorder 6s ease infinite;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-widget:hover::before,
.post-card:hover::before {
  opacity: 0.2;
}

@keyframes holographicBorder {
  0%, 100% { background-position: 0% 50%; }
  33% { background-position: 100% 0%; }
  66% { background-position: 100% 100%; }
}

/* Multi-dimensional hover effects */
.card-widget:hover, 
.recent-post-item:hover, 
.post-card:hover {
  transform: translateY(-12px) rotateX(5deg) rotateY(5deg) scale(1.03);
  box-shadow: var(--shadow-floating), var(--shadow-glow-md);
  border-color: rgba(99, 102, 241, 0.6);
  background: var(--glass-medium);
}

/* Particle shimmer effect */
.card-widget::after,
.post-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.3) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.3) 0%, transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.3) 0%, transparent 30%);
  animation: particleFloat 8s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.card-widget:hover::after,
.post-card:hover::after {
  opacity: 1;
}

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* 🏷️ ARTISTIC TAG CONSTELLATION */
.tag-cloud a, 
.card-tag-cloud a, 
.tags a {
  position: relative;
  display: inline-block;
  padding: 10px 18px;
  margin: 8px 10px 8px 0;
  border-radius: var(--radius-full);
  background: var(--glass-medium);
  backdrop-filter: blur(15px);
  border: 2px solid transparent;
  background-clip: padding-box;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.4s var(--ease-bounce);
  overflow: hidden;
  cursor: pointer;
}

/* Tag gradient background animation */
.tag-cloud a::before,
.card-tag-cloud a::before,
.tags a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-aurora);
  background-size: 200% 200%;
  animation: tagGradientFlow 3s linear infinite;
  transition: all 0.4s var(--ease-dramatic);
  z-index: -1;
}

.tag-cloud a:hover,
.card-tag-cloud a:hover,
.tags a:hover {
  transform: translateY(-6px) scale(1.1) rotate(2deg);
  color: white !important;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: var(--shadow-glow-md), var(--shadow-neon-pink);
}

.tag-cloud a:hover::before,
.card-tag-cloud a:hover::before,
.tags a:hover::before {
  left: 0;
  animation-duration: 1s;
}

@keyframes tagGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 📊 CINEMATIC READING PROGRESS */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 6px;
  width: 0%;
  z-index: 9999;
  background: var(--gradient-holographic);
  background-size: 400% 400%;
  animation: progressRainbow 3s ease infinite;
  box-shadow: 
    0 0 30px rgba(99, 102, 241, 0.8),
    0 6px 20px rgba(99, 102, 241, 0.4);
  transition: width 0.1s var(--ease-smooth);
}

#reading-progress::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
  animation: progressGlare 2s ease-in-out infinite;
}

@keyframes progressRainbow {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

@keyframes progressGlare {
  0%, 100% { opacity: 0; transform: translateX(10px); }
  50% { opacity: 1; transform: translateX(-10px); }
}

/* 💝 MAGICAL LIKE BUTTON */
.post-like-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  border: 3px solid transparent;
  background-clip: padding-box;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.4s var(--ease-bounce);
  overflow: hidden;
}

.post-like-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.4), rgba(6, 182, 212, 0.4));
  transform: translate(-50%, -50%);
  transition: all 0.4s var(--ease-dramatic);
  z-index: -1;
  border-radius: 50%;
}

.post-like-btn:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: rgba(236, 72, 153, 0.8);
  box-shadow: var(--shadow-neon-pink), var(--shadow-glow-md);
}

.post-like-btn:hover::before {
  width: 200%;
  height: 200%;
}

.post-like-btn.liked {
  background: var(--gradient-fire);
  color: white !important;
  border-color: rgba(245, 158, 11, 0.8);
  animation: likeExplosion 0.8s var(--ease-bounce);
}

@keyframes likeExplosion {
  0% { transform: scale(1); }
  30% { transform: scale(1.2) rotate(5deg); }
  60% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 🔗 ORBITAL SHARE BUTTONS */
.share-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.share-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--glass-medium);
  backdrop-filter: blur(15px);
  border: 2px solid transparent;
  background-clip: padding-box;
  text-decoration: none !important;
  font-size: 20px;
  transition: all 0.4s var(--ease-bounce);
  overflow: hidden;
}

.share-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-neon);
  background-size: 200% 200%;
  animation: shareGradient 4s ease infinite;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: -1;
}

.share-btn:hover {
  transform: translateY(-6px) rotate(10deg) scale(1.15);
  color: white !important;
  box-shadow: var(--shadow-glow-md), var(--shadow-neon-blue);
}

.share-btn:hover::after {
  opacity: 1;
}

@keyframes shareGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 💻 ENHANCED CODE BLOCKS */
figure.highlight, 
pre code, 
pre {
  border-radius: var(--radius-md);
  background: var(--glass-dark) !important;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(99, 102, 241, 0.2);
  box-shadow: var(--shadow-depth);
  overflow: auto;
  transition: all 0.3s var(--ease-smooth);
  position: relative;
}

figure.highlight::before,
pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-aurora);
  animation: codeAccent 3s ease infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

figure.highlight:hover,
pre:hover {
  box-shadow: var(--shadow-floating), var(--shadow-glow-sm);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

figure.highlight:hover::before,
pre:hover::before {
  opacity: 1;
}

@keyframes codeAccent {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 📑 MYSTICAL TABLE OF CONTENTS */
.toc {
  background: var(--glass-light);
  backdrop-filter: blur(25px);
  border-radius: var(--radius-lg);
  border: 2px solid var(--glass-border);
  padding: 24px;
  box-shadow: var(--shadow-depth);
  position: relative;
}

.toc::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-holographic);
  background-size: 400% 400%;
  animation: tocBorder 8s ease infinite;
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.3;
}

@keyframes tocBorder {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

.toc .toc-item a {
  position: relative;
  display: block;
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: var(--radius-sm);
  transition: all 0.3s var(--ease-smooth);
  overflow: hidden;
}

.toc .toc-item a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-aurora);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: all 0.3s var(--ease-dramatic);
}

.toc .toc-item a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--glass-medium);
  transform: translateX(-100%);
  transition: all 0.3s var(--ease-smooth);
  z-index: -1;
}

.toc .toc-item a:hover {
  color: var(--primary-magic) !important;
  transform: translateX(12px);
  box-shadow: var(--shadow-glow-sm);
}

.toc .toc-item a:hover::before {
  transform: scaleY(1);
}

.toc .toc-item a:hover::after {
  transform: translateX(0);
}

/* 🌍 GLOBAL BACKGROUND ORCHESTRATION */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  z-index: -2;
  animation: backgroundOrchestra 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes backgroundOrchestra {
  0%, 100% { opacity: 0.5; filter: hue-rotate(0deg); }
  25% { opacity: 0.7; filter: hue-rotate(90deg); }
  50% { opacity: 0.6; filter: hue-rotate(180deg); }
  75% { opacity: 0.8; filter: hue-rotate(270deg); }
}

/* 💫 FOOTER CONSTELLATION */
.footer-inner .custom_text {
  position: relative;
  animation: footerPulse 3s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.footer-inner .custom_text::before {
  content: '✨';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  animation: sparkleOrbit 2s ease-in-out infinite;
  font-size: 1.2em;
}

.footer-inner .custom_text::after {
  content: '💫';
  position: absolute;
  top: -25px;
  right: -30px;
  animation: sparkleOrbit 2s ease-in-out infinite reverse;
  font-size: 1em;
}

@keyframes footerPulse {
  0%, 100% { 
    transform: scale(1);
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
  }
  50% { 
    transform: scale(1.08);
    text-shadow: 0 0 30px rgba(255, 71, 87, 0.8), 0 0 40px rgba(236, 72, 153, 0.4);
  }
}

@keyframes sparkleOrbit {
  0% { transform: translateX(-50%) rotate(0deg) translateY(-10px) rotate(0deg); opacity: 0.6; }
  50% { transform: translateX(-50%) rotate(180deg) translateY(-15px) rotate(-180deg); opacity: 1; }
  100% { transform: translateX(-50%) rotate(360deg) translateY(-10px) rotate(-360deg); opacity: 0.6; }
}

/* 🎭 UTILITY ANIMATIONS */
.floating {
  animation: float 4s ease-in-out infinite;
}

.rotating {
  animation: rotate 10s linear infinite;
}

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

.glowing {
  animation: glow 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6), 0 0 60px rgba(236, 72, 153, 0.3); }
}

/* 📱 RESPONSIVE MAGIC */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 12px;
  }
  
  .card-widget:hover, 
  .recent-post-item:hover, 
  .post-card:hover {
    transform: translateY(-6px) scale(1.02);
  }
  
  .share-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  body::before {
    animation-duration: 30s;
  }
}

@media (max-width: 480px) {
  ::-webkit-scrollbar {
    width: 8px;
  }
  
  .tag-cloud a:hover,
  .card-tag-cloud a:hover,
  .tags a:hover {
    transform: translateY(-3px) scale(1.05);
  }
}

/* 🎯 ACCESSIBILITY & PERFORMANCE */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --glass-light: rgba(0, 0, 0, 0.25);
    --glass-medium: rgba(0, 0, 0, 0.15);
    --glass-dark: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
  }
}

/* Focus indicators for accessibility */
.card-widget:focus,
.share-btn:focus,
.post-like-btn:focus,
.tag-cloud a:focus,
.toc .toc-item a:focus {
  outline: 3px solid var(--primary-magic);
  outline-offset: 3px;
  box-shadow: var(--shadow-glow-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card-widget,
  .post-card,
  .share-btn,
  .tag-cloud a {
    border-width: 3px;
    border-color: var(--primary-magic);
  }
}