/*!
 * i3nb Premium Entrance Effects CSS
 * Hero state styling and transition animations
 * Cinematic entrance experience with particle effects
 */

/* Global entrance mode styles with CLS prevention */
body.entrance-mode {
  /* CLS Prevention: Layout containment and size reservations */
  contain: layout style paint;
  
  background: radial-gradient(circle at center, #1a1a2e 0%, #16213e 50%, #0f0f1e 100%);
  background-attachment: fixed;
  perspective: 1000px;
  
  /* Prevent layout shifts from background changes */
  will-change: background;
  
  /* Fixed: Remove overflow hidden and size constraints that cause scroll bars */
  height: 100vh;
  width: 100vw;
}

/* Exception: Allow modal dock to be visible in entrance mode */
body.entrance-mode .i3nb-minimize-dock {
  overflow: visible !important;
}

body.entrance-mode .i3nb-minimized-modal {
  overflow: visible !important;
}

/* Adjust dock position in entrance mode to avoid navigation conflicts */
@media (max-width: 768px) {
  body.entrance-mode .i3nb-minimize-dock {
    bottom: 20px; /* Keep away from centered navigation */
    right: 20px; /* Move to right side to avoid navigation */
    left: auto;
  }
}

@media (max-width: 480px) {
  body.entrance-mode .i3nb-minimize-dock {
    bottom: 15px;
    right: 15px;
    left: auto;
  }
}

body.entrance-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(79, 172, 254, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(0, 242, 254, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(79, 172, 254, 0.05) 0%, transparent 70%);
  background-size: 60vw 60vh, 70vw 70vh, 100vw 100vh;
  /* Cosmic drift disabled for performance */
  pointer-events: none;
  z-index: 0;
}

@keyframes cosmic-drift {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.8;
  }
  25% {
    transform: translate(-10px, -20px) rotate(1deg) scale(1.02);
    opacity: 1;
  }
  50% {
    transform: translate(20px, 10px) rotate(-1deg) scale(0.98);
    opacity: 0.9;
  }
  75% {
    transform: translate(-5px, 15px) rotate(0.5deg) scale(1.01);
    opacity: 1;
  }
}

body.app-mode {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  overflow: auto;
}

/* Hero state navigation styling - highest specificity with CLS prevention */
body.entrance-mode .bottom-nav.hero-state {
  /* CLS Prevention: Layout containment and sizing */
  contain: layout style paint size;
  content-visibility: auto;
  
  /* Enhanced gradient with cosmic feel */
  background: linear-gradient(135deg, 
    rgba(45, 45, 45, 0.95) 0%, 
    rgba(139, 134, 128, 0.95) 30%,
    rgba(79, 172, 254, 0.15) 70%,
    rgba(139, 134, 128, 0.95) 100%
  );
  
  /* Performance optimizations with CLS prevention */
  will-change: transform, opacity, filter;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  
  /* Optimized backdrop effects */
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  
  /* Cinematic border - clean rounded border */
  border: 1px solid rgba(79, 172, 254, 0.3);
  
  /* Premium shadow stack with proper glow */
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 0 60px rgba(79, 172, 254, 0.3),
    0 0 100px rgba(79, 172, 254, 0.1);
  
  /* Enhanced border radius */
  border-radius: 50px;
  
  /* Cinematic padding */
  padding: 20px 40px;
  gap: 50px;
  
  /* CRITICAL: Perfect viewport center positioning - applied immediately */
  position: fixed !important;
  top: 50vh !important;
  left: 50vw !important;
  bottom: auto !important;
  right: auto !important;
  margin: 0 !important;
  
  /* Hero scaling - absolute center with translate */
  transform: translate(-50%, -50%) scale(1.2) !important;
  
  /* Size reservations to prevent layout shifts */
  min-width: 400px;
  max-width: 90vw;
  min-height: 80px;
  
  /* Floating animation disabled for performance */
}

@keyframes hero-float {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1.2) translateY(0px);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2) translateY(-8px);
  }
}

/* Optimized particle background for hero state */
body.entrance-mode .bottom-nav.hero-state::before {
  background-size: 60px 60px, 55px 55px, 70px 70px, 65px 65px;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(79, 172, 254, 0.25) 2px, transparent 2px),
    radial-gradient(circle at 80% 20%, rgba(0, 242, 254, 0.2) 1.5px, transparent 1.5px),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.15) 1.8px, transparent 1.8px),
    radial-gradient(circle at 60% 80%, rgba(79, 172, 254, 0.1) 1.2px, transparent 1.2px);
  /* Cosmic rotation disabled for performance */
}

@keyframes cosmic-rotation {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1.05);
  }
}

/* Hero state nav items with CLS prevention */
body.entrance-mode .hero-state .nav-item {
  /* CLS Prevention: Layout containment and sizing */
  contain: layout style paint;
  content-visibility: auto;
  
  font-size: 16px;
  gap: 8px;
  padding: 15px 20px;
  border-radius: 25px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  
  /* Performance optimization */
  will-change: transform, background, box-shadow;
  backface-visibility: hidden;
  
  /* Prevent layout shifts on hover */
  min-width: 0;
  flex-shrink: 0;
}

body.entrance-mode .hero-state .nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s;
  z-index: 0;
}

body.entrance-mode .hero-state .nav-item:hover::before {
  left: 100%;
}

body.entrance-mode .hero-state .nav-item:hover {
  background: rgba(79, 172, 254, 0.15);
  transform: translateY(-5px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(79, 172, 254, 0.4),
    0 5px 15px rgba(0, 0, 0, 0.3);
}

body.entrance-mode .hero-state .nav-item svg,
body.entrance-mode .hero-state .nav-item span {
  position: relative;
  z-index: 1;
}

body.entrance-mode .hero-state .nav-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 10px rgba(79, 172, 254, 0.5));
}

body.entrance-mode .hero-state .nav-item span {
  font-weight: 500;
  font-size: 14px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Logo hero state with CLS prevention */
body.entrance-mode .logo-container.hero-state {
  /* CLS Prevention: Layout containment */
  contain: layout style paint;
  content-visibility: auto;
  
  position: fixed !important;
  top: 50vh !important;
  left: 50vw !important;
  transform: translate(-50%, -50%) translateY(-120px) !important;
  z-index: 10001 !important;
  
  /* Performance optimization */
  will-change: transform;
  backface-visibility: hidden;
}

body.entrance-mode .hero-state .logo {
  height: 80px !important;
  filter: 
    brightness(1.4) 
    contrast(1.3)
    drop-shadow(0 0 40px rgba(79, 172, 254, 1))
    drop-shadow(0 0 80px rgba(79, 172, 254, 0.6))
    drop-shadow(0 0 120px rgba(79, 172, 254, 0.3))
    drop-shadow(0 10px 40px rgba(0, 0, 0, 0.4)) !important;
  /* Logo pulse disabled for performance */
}

@keyframes hero-logo-pulse {
  0%, 100% {
    transform: scale(1) rotateY(0deg);
    filter: 
      brightness(1.4) 
      contrast(1.3)
      drop-shadow(0 0 40px rgba(79, 172, 254, 1))
      drop-shadow(0 0 80px rgba(79, 172, 254, 0.6))
      drop-shadow(0 0 120px rgba(79, 172, 254, 0.3))
      drop-shadow(0 10px 40px rgba(0, 0, 0, 0.4));
  }
  50% {
    transform: scale(1.1) rotateY(5deg);
    filter: 
      brightness(1.6) 
      contrast(1.4)
      drop-shadow(0 0 60px rgba(79, 172, 254, 1))
      drop-shadow(0 0 120px rgba(79, 172, 254, 0.8))
      drop-shadow(0 0 180px rgba(79, 172, 254, 0.4))
      drop-shadow(0 15px 50px rgba(0, 0, 0, 0.5));
  }
}

/* Entrance particles with CLS prevention */
.entrance-particles {
  z-index: 1 !important;
  
  /* CLS Prevention: Full containment and positioning */
  contain: layout style paint size;
  content-visibility: auto;
  
  /* Ensure particles don't affect layout */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.entrance-particles > div {
  /* CLS Prevention for particle elements */
  contain: layout style paint size;
  position: absolute;
  
  animation: particle-float 4s ease-in-out infinite;
  /* GPU acceleration */
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  
  /* Ensure particles don't affect layout */
  pointer-events: none;
}

@keyframes particle-float {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Transition states */
.transition-in {
  animation: entrance-transition-in 2.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes entrance-transition-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) rotate(-5deg);
    filter: blur(10px);
  }
  50% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.1) rotate(0deg);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
    filter: blur(0px);
  }
}

.transition-out {
  animation: entrance-transition-out 1.5s cubic-bezier(0.6, 0, 0.74, 0.2) forwards;
}

@keyframes entrance-transition-out {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1) translateY(100vh);
  }
}

/* Responsive hero state */
@media (max-width: 768px) {
  body.entrance-mode .bottom-nav.hero-state {
    min-width: 350px;
    max-width: 95vw;
    padding: 15px 30px;
    gap: 30px;
    top: 50vh !important;
    left: 50vw !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
  }
  
  body.entrance-mode .hero-state .nav-item {
    font-size: 14px;
    padding: 12px 15px;
  }
  
  body.entrance-mode .hero-state .nav-icon {
    width: 28px;
    height: 28px;
  }
  
  body.entrance-mode .hero-state .logo {
    height: 60px !important;
  }
  
  body.entrance-mode .logo-container.hero-state {
    transform: translate(-50%, -50%) translateY(-100px);
  }
}

@media (max-width: 480px) {
  body.entrance-mode .bottom-nav.hero-state {
    min-width: 320px;
    padding: 12px 25px;
    gap: 20px;
    top: 50vh !important;
    left: 50vw !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
  
  body.entrance-mode .hero-state .nav-item {
    font-size: 12px;
    padding: 10px 12px;
  }
  
  body.entrance-mode .hero-state .nav-icon {
    width: 24px;
    height: 24px;
  }
  
  body.entrance-mode .hero-state .logo {
    height: 50px !important;
  }
  
  body.entrance-mode .logo-container.hero-state {
    transform: translate(-50%, -50%) translateY(-80px);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  body.entrance-mode .bottom-nav.hero-state {
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid white;
    box-shadow: 0 0 0 1px black, 0 10px 30px rgba(0, 0, 0, 0.8);
  }
  
  body.entrance-mode .hero-state .nav-item {
    color: white;
  }
  
  body.entrance-mode .hero-state .nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  body.entrance-mode .bottom-nav.hero-state,
  body.entrance-mode .hero-state .logo,
  .entrance-particles > div,
  body.entrance-mode::before {
    animation: none !important;
  }
  
  body.entrance-mode .bottom-nav.hero-state {
    transform: translate(-50%, -50%) scale(1.2) !important;
  }
  
  body.entrance-mode .hero-state .nav-item:hover {
    transform: none;
  }
  
  .entrance-particles {
    display: none;
  }
}

/* Print styles */
@media print {
  .entrance-particles,
  body.entrance-mode::before {
    display: none;
  }
  
  body.entrance-mode .bottom-nav.hero-state {
    position: static;
    transform: none;
    background: white;
    color: black;
    box-shadow: none;
    border: 1px solid black;
  }
}