/*
 * Luxury Design System - Premium Enhancements
 * High-end visual and interaction design
 */

/* ═══ LUXURY CURSOR ═══ */
.luxury-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  background: rgba(124, 58, 237, 0.1);
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.15s ease;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
}

.luxury-cursor.hover {
  transform: translate(-50%, -50%) scale(1.8);
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.6);
}

.luxury-cursor-trail {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--violet-l);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
}

/* Hide default cursor on interactive elements */
button, a, .btn, .game-card, .service-card {
  cursor: none !important;
}

/* ═══ MAGNETIC BUTTONS ═══ */
.magnetic-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-btn:hover::before {
  transform: translateX(100%);
}

.magnetic-btn .btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* ═══ PREMIUM ANIMATIONS ═══ */
.fade-in-up {
  opacity: 0;
  transform: translateY(60px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.animate {
  opacity: 1;
  transform: scale(1);
}

/* Staggered animations */
.stagger-delay-1 { transition-delay: 0.1s; }
.stagger-delay-2 { transition-delay: 0.2s; }
.stagger-delay-3 { transition-delay: 0.3s; }
.stagger-delay-4 { transition-delay: 0.4s; }

/* ═══ ENHANCED NOISE & TEXTURES ═══ */
.noise-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9997;
  mix-blend-mode: overlay;
}

.gradient-mesh {
  background: 
    radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
}

/* Premium grain texture overlay */
.grain-texture {
  position: relative;
}

.grain-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 1;
}

/* Animated gradient backgrounds */
.animated-gradient {
  background: linear-gradient(-45deg, #7c3aed, #0ea5e9, #10b981, #f59e0b);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ═══ LOADING SCREEN ═══ */
.luxury-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.luxury-loader.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 32px;
  animation: logoFloat 2s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.loader-bar {
  width: 280px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 1px;
}

.loader-text {
  margin-top: 24px;
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ═══ ENHANCED HEADER ═══ */
#header.luxury {
  backdrop-filter: blur(24px) saturate(180%);
  background: rgba(6, 6, 10, 0.85);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

#header.luxury .header-inner {
  transition: padding 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#header.scrolled.luxury {
  padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ═══ ENHANCED HERO PARALLAX ═══ */
.hero-parallax {
  will-change: transform;
}

.hero-content.parallax {
  will-change: transform;
}

/* ═══ PREMIUM GAME CARDS ═══ */
.game-card.luxury {
  background: var(--bg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.game-card.luxury::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.game-card.luxury:hover::before {
  opacity: 1;
}

.game-card.luxury .game-thumb {
  position: relative;
  overflow: hidden;
}

.game-card.luxury .game-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%) translateY(-100%);
  transition: transform 0.8s ease;
}

.game-card.luxury:hover .game-thumb::after {
  transform: translateX(100%) translateY(100%);
}

/* ═══ ENHANCED BUTTONS ═══ */
.btn.luxury {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn.luxury::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn.luxury:hover::after {
  transform: translateX(100%);
}

/* Morphing button effect */
.btn.luxury:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 10px 25px rgba(124, 58, 237, 0.3),
    0 0 0 1px rgba(124, 58, 237, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Button glow effect */
.btn-primary.luxury::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--violet), var(--cyan), var(--violet));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: blur(8px);
}

.btn-primary.luxury:hover::before {
  opacity: 0.7;
  animation: glow-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  0% { filter: blur(8px); }
  100% { filter: blur(12px); }
}

/* Color-shifting buttons */
.btn-gradient {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  border: none;
  color: white;
  font-weight: 600;
}

.btn-gradient:hover {
  animation-duration: 1s;
}

/* ═══ ANIMATED COUNTERS ═══ */
.animated-counter {
  font-family: var(--font-h);
  font-weight: 700;
  color: var(--violet-l);
}

/* ═══ SKELETON LOADERS ═══ */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.skeleton-card {
  aspect-ratio: 16/9;
  border-radius: var(--r);
}

/* ═══ HOVER TOOLTIPS ═══ */
.luxury-tooltip {
  position: relative;
}

.luxury-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(6, 6, 10, 0.95);
  backdrop-filter: blur(12px);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 1000;
  border: 1px solid var(--border-h);
}

.luxury-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ═══ SOUND DESIGN TOGGLE ═══ */
.sound-toggle {
  position: fixed;
  bottom: 120px;
  right: 28px;
  z-index: 800;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--border-h);
  color: var(--violet-l);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(12px);
}

.sound-toggle:hover {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
  transform: translateY(-2px) scale(1.05);
}

.sound-toggle.muted {
  opacity: 0.5;
}

/* ═══ RESPONSIVE LUXURY ENHANCEMENTS ═══ */
@media (max-width: 768px) {
  .luxury-cursor,
  .luxury-cursor-trail {
    display: none;
  }
  
  .magnetic-btn {
    transform: none !important;
  }
  
  .loader-bar {
    width: 200px;
  }
  
  .floating-nav {
    display: none;
  }
}

/* ═══ PREMIUM EASING CURVES ═══ */
.ease-luxury { 
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}

.ease-bounce { 
  transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); 
}

.ease-smooth { 
  transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1); 
}

.ease-elastic { 
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* ═══ ENHANCED FOCUS STATES ═══ */
*:focus-visible {
  outline: 2px solid var(--violet-l);
  outline-offset: 3px;
  outline-style: dashed;
}

button:focus-visible,
.btn:focus-visible {
  outline-style: solid;
  outline-width: 1px;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* ═══ ACCESSIBILITY ENHANCEMENTS ═══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .luxury-cursor,
  .luxury-cursor-trail,
  .floating-particle {
    display: none !important;
  }
}

@media (prefers-color-scheme: light) {
  /* Optional light mode overrides */
  :root {
    --bg: #fafafa;
    --bg2: #f5f5f7;
    --bg3: #e5e7eb;
    --white: #111827;
    --muted: rgba(17, 24, 39, 0.7);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(255, 255, 255, 0.3);
    --border-h: rgba(124, 58, 237, 1);
  }
  
  .btn {
    border-width: 2px;
  }
}

/* ═══ CUSTOM 404 DESIGN ═══ */
.luxury-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.luxury-404::before {
  content: '404';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-h);
  font-size: clamp(200px, 20vw, 400px);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(124, 58, 237, 0.1);
  z-index: 1;
  pointer-events: none;
  animation: float404 6s ease-in-out infinite;
}

@keyframes float404 {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(-50%, -50%) rotate(2deg); }
}

.luxury-404-content {
  position: relative;
  z-index: 2;
}

/* ═══ PREMIUM LOADING STATES ═══ */
.content-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg2);
  border-radius: var(--r);
}

.content-skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: loading-shimmer 2s infinite;
  transform: translateX(-100%);
}

@keyframes loading-shimmer {
  100% { transform: translateX(100%); }
}

/* ═══ ENHANCED SCROLL INDICATORS ═══ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bg2);
  z-index: 9998;
}

.scroll-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  width: 0%;
  transition: width 0.1s ease;
}

/* ═══ FLOATING ACTION ELEMENTS ═══ */
.floating-nav {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-nav-item {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.floating-nav-item:hover,
.floating-nav-item.active {
  background: var(--violet);
  border-color: var(--violet);
  transform: scale(1.3);
}

.floating-nav-item::after {
  content: attr(data-section);
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  border: 1px solid var(--border-h);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-m);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.floating-nav-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-8px);
}

/* ═══ ADVANCED HOVER STATES ═══ */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
  transform: translateY(-8px);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 
    0 0 20px rgba(124, 58, 237, 0.3),
    0 0 40px rgba(124, 58, 237, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hover-shift {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-shift:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* ═══ TEXT EFFECTS ═══ */
.text-gradient {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  animation: text-reveal-animation 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes text-reveal-animation {
  0% { transform: translateX(0); }
  50% { transform: translateX(100%); }
  51% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

/* ═══ MICRO-INTERACTIONS ═══ */
@keyframes buttonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.btn.luxury:active {
  animation: buttonPress 0.1s ease;
}

/* Focus styles */
.btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--violet-l);
  outline-offset: 2px;
}

/* ═══ ENHANCED LINK UNDERLINES & MORPHING EFFECTS ═══ */
nav a {
  position: relative;
  overflow: hidden;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* Morphing text reveal effect */
.morphing-text {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.morphing-text span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.morphing-text:hover span {
  transform: translateY(0);
}

/* Image zoom and reveal effects */
.image-morph {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
}

.image-morph img {
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: grayscale(0.3) contrast(1.1);
}

.image-morph:hover img {
  transform: scale(1.08) rotate(1deg);
  filter: grayscale(0) contrast(1.2) brightness(1.1);
}

.image-morph::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, transparent 50%, rgba(6, 182, 212, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 2;
}

.image-morph:hover::before {
  opacity: 1;
}