/* GSAP SCRAMBLE TEXT ANIMATION STYLES */

/* Name element specific styles for ScrambleText */
.name {
  /* Hardware acceleration for smooth animations */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Prevent text selection during animation */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  
  /* Text rendering optimization */
  text-rendering: optimizeLegibility;
  
  /* Ensure consistent spacing during scramble */
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  
  /* Responsive font sizing */
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: var(--fw-500, 500);
  line-height: 1.2;
  
  /* Smooth transitions for theme changes */
  transition: color var(--transition-theme, 0.6s cubic-bezier(0.4, 0, 0.2, 1));
  
  /* Enhanced 3D perspective for hover effects */
  transform-style: preserve-3d;
  perspective: 1000px;
  
  /* Cursor interaction */
  cursor: pointer;
}

/* Enhanced name visibility during animation states */
.name.gsap-scrambling {
  /* Slightly increase opacity during scramble for better visibility */
  opacity: 0.95;
  
  /* Subtle glow effect during scramble (theme-aware) */
  text-shadow: 0 0 1px currentColor;
}

.name.gsap-revealing {
  /* Full opacity when revealing */
  opacity: 1;
  text-shadow: none;
}

.name.gsap-concealing {
  /* Slightly reduced opacity when concealing */
  opacity: 0.85;
}

/* Name hovering state for advanced effects */
.name.gsap-name-hovering {
  /* Enhanced cursor style */
  cursor: grab;
  
  /* Subtle text enhancement during hover */
  text-shadow: 0 0 8px currentColor;
}

/* Name effect layers styling */
.gsap-name-ambient-glow,
.gsap-name-hover-glow {
  /* Ensure proper layering */
  z-index: -1;
  
  /* Prevent interaction */
  pointer-events: none;
  
  /* Smooth transitions */
  transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
  
  /* Hardware acceleration */
  will-change: transform, opacity;
  transform: translateZ(0);
}

.gsap-name-text-shadow {
  /* Ensure proper text shadow positioning */
  z-index: -1;
  pointer-events: none;
  
  /* Text properties inheritance */
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  
  /* Smooth transitions */
  transition: opacity 0.4s ease;
  
  /* Hardware acceleration */
  will-change: opacity;
  transform: translateZ(0);
}

.gsap-name-particles {
  /* Ensure particles are above text */
  z-index: 1;
  pointer-events: none;
  
  /* Container for particle animations */
  overflow: visible;
  
  /* Hardware acceleration */
  will-change: opacity;
  transform: translateZ(0);
}

.gsap-name-particle {
  /* Individual particle styling */
  pointer-events: none;
  
  /* Ensure smooth animations */
  will-change: transform, opacity;
  transform: translateZ(0);
  
  /* Subtle glow effect */
  box-shadow: 0 0 4px currentColor;
  
  /* Smooth opacity transitions */
  transition: opacity 0.3s ease;
}

.gsap-name-energy-field {
  /* Energy field background effect */
  z-index: -2;
  pointer-events: none;
  
  /* Smooth animations */
  will-change: transform, opacity;
  transform: translateZ(0);
  
  /* Subtle animation */
  animation: energyFieldPulse 6s ease-in-out infinite;
}

/* Keyframe animations for name effects */
@keyframes nameAmbientPulse {
  0%, 100% { 
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.4;
  }
}

@keyframes energyFieldPulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    opacity: 0.1;
  }
  33% { 
    transform: scale(1.05) rotate(120deg);
    opacity: 0.2;
  }
  66% { 
    transform: scale(0.95) rotate(240deg);
    opacity: 0.15;
  }
}

/* Responsive adjustments for name effects */
@media (max-width: 768px) {
  .name {
    /* Reduced font size on mobile */
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    
    /* Simplified effects on mobile */
    letter-spacing: 0.01em;
  }
  
  .gsap-name-ambient-glow,
  .gsap-name-hover-glow {
    /* Reduced glow size on mobile */
    width: 110%;
    height: 110%;
    filter: blur(15px);
  }
  
  .gsap-name-particle {
    /* Smaller particles on mobile */
    width: 3px;
    height: 3px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .name.gsap-name-hovering {
    text-shadow: 0 0 2px currentColor;
  }
  
  .gsap-name-ambient-glow,
  .gsap-name-hover-glow {
    opacity: 0.1 !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .name {
    /* Disable all animations */
    animation: none !important;
    transition: color 0.3s ease;
  }
  
  .gsap-name-ambient-glow,
  .gsap-name-hover-glow,
  .gsap-name-energy-field {
    animation: none !important;
    transition: opacity 0.3s ease;
  }
  
  .gsap-name-particle {
    animation: none !important;
    transition: none;
  }
}

/* Theme-specific enhancements */
[data-theme="light"] .name.gsap-scrambling {
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .name.gsap-name-hovering {
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

/* Default/dark theme */
:not([data-theme="light"]) .name.gsap-scrambling,
[data-theme="dark"] .name.gsap-scrambling {
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
}

:not([data-theme="light"]) .name.gsap-name-hovering,
[data-theme="dark"] .name.gsap-name-hovering {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Theme transition compatibility */
html[data-theme-transitioning] .name {
  /* Ensure smooth color transitions during theme changes */
  transition: color var(--theme-transition-duration, 0.8s) var(--theme-transition-easing, cubic-bezier(0.25, 0.46, 0.45, 0.94)),
              text-shadow var(--theme-transition-duration, 0.8s) var(--theme-transition-easing, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}

/* PAGE LOAD ANIMATION STYLES */

/* Loading Overlay */
.page-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--smoky-black, hsl(0, 0%, 7%));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  
  /* Theme compatibility */
  background: var(--bg-primary, var(--smoky-black, hsl(0, 0%, 7%)));
}

[data-theme="light"] .page-loading-overlay {
  background: var(--white-1, hsl(0, 0%, 100%));
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loading-logo {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo-letter {
  font-size: 3rem;
  font-weight: 600;
  font-family: var(--ff-poppins, sans-serif);
  color: var(--orange-yellow-crayola, hsl(0, 0%, 85%));
  transform-origin: center;
  
  /* Hardware acceleration */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

[data-theme="light"] .logo-letter {
  color: var(--smoky-black, hsl(0, 0%, 7%));
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .loading-progress {
  background: rgba(0, 0, 0, 0.1);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, 
    var(--orange-yellow-crayola, hsl(0, 0%, 85%)) 0%,
    var(--vegas-gold, hsl(0, 0%, 85%)) 100%);
  border-radius: 2px;
  position: relative;
  
  /* Smooth animation */
  will-change: width;
}

[data-theme="light"] .progress-bar {
  background: linear-gradient(90deg, 
    var(--smoky-black, hsl(0, 0%, 7%)) 0%,
    var(--eerie-black-1, hsl(240, 2%, 13%)) 100%);
}

/* Progress bar glow effect */
.progress-bar::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  width: 20px;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%);
  transform: translateX(100%);
  animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200px); }
}

/* Content Animation Optimization */
.sidebar,
.main-content,
.timeline-item,
.contact-item,
.social-item {
  /* Hardware acceleration for smooth animations */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Text animation enhancements */
.char {
  display: inline-block;
  transform-origin: bottom center;
  will-change: transform, opacity;
}

/* Handle spaces in character animation */
.char-space {
  /* Ensure spaces maintain proper width during animation */
  min-width: 0.3em;
  text-align: center;
}

/* Prevent character animation breaking on special characters */
.char:empty {
  display: inline;
  min-width: 0.2em;
}

/* Timeline items animation enhancement */
.timeline-item {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover {
  transform: perspective(1000px) rotateY(2deg) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .timeline-item:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Social items animation enhancement */
.social-item {
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* Enhanced hover effects for sidebar items */
.social-item:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Contact items animation - Enhanced for GSAP with immediate CSS fallback */
.contact-item {
  transform-origin: left center;
  transition: background-color 0.3s ease, border-radius 0.3s ease;
  padding: 8px;
  margin: -8px;
  border-radius: 0;
  will-change: transform;
}

/* Immediate CSS-only hover effect as fallback */
.contact-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.contact-item:hover .icon-box {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

.contact-item:hover .contact-title {
  color: var(--orange-yellow-crayola);
  transition: color 0.2s ease;
}

/* Enhanced properties for GSAP (will override above when GSAP loads) */
.contact-item .icon-box {
  will-change: transform, filter;
  transform-origin: center center;
}

.contact-item .contact-info {
  will-change: transform;
}

.contact-item .contact-title,
.contact-item .contact-copyable,
.contact-item time,
.contact-item address,
.contact-item .copy-btn {
  will-change: color, transform;
  transition: color 0.2s ease;
}

/* Disable basic CSS hover effects when GSAP effects are active */
.gsap-hover-effects-active .contact-item:hover {
  background-color: transparent;
  border-radius: 0;
}

.gsap-hover-effects-active .contact-item:hover .icon-box {
  transform: none;
  transition: none;
}

.gsap-hover-effects-active .contact-item:hover .contact-title {
  color: inherit;
  transition: none;
}

/* Social items animation enhancement - Enhanced for GSAP with immediate CSS fallback */
.social-item {
  transform-origin: center;
  transition: background-color 0.3s ease, border-radius 0.3s ease, padding 0.3s ease;
  border-radius: 0;
  padding: 0;
  will-change: transform;
}

/* Immediate CSS-only hover effect as fallback */
.social-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  padding: 8px;
}

.social-item:hover .social-link {
  transform: scale(1.1);
  color: var(--white-1);
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Enhanced properties for GSAP (will override above when GSAP loads) */
.social-item .social-link {
  will-change: transform, color, filter;
  display: block;
  transform-origin: center center;
}

.social-item .social-link i {
  will-change: filter;
  transition: filter 0.3s ease;
}

/* Disable basic CSS hover effects when GSAP effects are active */
.gsap-hover-effects-active .social-item:hover {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
}

.gsap-hover-effects-active .social-item:hover .social-link {
  transform: none;
  color: inherit;
  transition: none;
}

/* Responsive considerations */
@media (max-width: 768px) {
  .logo-letter {
    font-size: 2.5rem;
  }
  
  .loading-progress {
    width: 150px;
    height: 3px;
  }
  
  .loading-content {
    gap: 1.5rem;
  }
  
  /* Reduce 3D effects on mobile for better performance */
  .timeline-item:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  }
  
  [data-theme="light"] .timeline-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 480px) {
  .logo-letter {
    font-size: 2rem;
  }
  
  .loading-logo {
    gap: 0.5rem;
  }
  
  /* Minimal effects on small mobile devices */
  .timeline-item:hover,
  .social-item:hover,
  .contact-item:hover {
    transform: none;
    box-shadow: none;
    background-color: transparent;
    border-radius: 0;
    padding: 0;
  }
  
  /* Reset hover states for mobile */
  .contact-item {
    margin: 0;
    padding: 0;
  }
  
  .social-item {
    padding: 0;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .name {
    /* Disable all animations if user prefers reduced motion */
    animation: none !important;
    transition: color 0.2s ease !important;
  }
  
  .name.gsap-scrambling,
  .name.gsap-revealing,
  .name.gsap-concealing {
    opacity: 1 !important;
    text-shadow: none !important;
  }
  
  /* Simplify hover effects for reduced motion users */
  .contact-item,
  .social-item {
    transition: color 0.2s ease !important;
  }
  
  .contact-item:hover .contact-title,
  .contact-item:hover .contact-copyable,
  .contact-item:hover time,
  .contact-item:hover address {
    color: var(--orange-yellow-crayola) !important;
  }
  
  .social-item:hover .social-link {
    color: var(--white-1) !important;
  }
  
  .page-loading-overlay {
    display: none !important;
  }
  
  .sidebar,
  .main-content,
  .timeline-item,
  .contact-item,
  .social-item {
    opacity: 1 !important;
    transform: none !important;
    will-change: auto !important;
  }
  
  .timeline-item:hover,
  .social-item:hover,
  .contact-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .progress-bar::after {
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .name.gsap-scrambling {
    text-shadow: none;
  }
  
  .loading-overlay {
    background: black;
  }
  
  [data-theme="light"] .loading-overlay {
    background: white;
  }
  
  .logo-letter {
    color: white;
  }
  
  [data-theme="light"] .logo-letter {
    color: black;
  }
}

/* Theme-aware hover effects */
[data-theme="light"] .contact-item:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .social-item:hover {
  background-color: rgba(0, 0, 0, 0.08) !important;
}

/* Performance optimizations for hover effects */
.contact-item,
.social-item {
  contain: layout style;
  isolation: isolate;
}

/* Hardware acceleration for better performance */
.contact-item .icon-box ion-icon,
.social-item .social-link i {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Performance optimization for mobile devices */
@media (max-width: 480px) {
  .name {
    /* Reduce effects on mobile for better performance */
    transform: none;
    will-change: auto;
  }
  
  .sidebar,
  .main-content,
  .timeline-item,
  .contact-item,
  .social-item {
    will-change: auto;
  }
}

/* Page animation completion state */
.page-animations-complete {
  /* Mark that page load animations are finished */
  opacity: 1;
}

.page-animations-complete .sidebar,
.page-animations-complete .main-content,
.page-animations-complete .timeline-item,
.page-animations-complete .contact-item,
.page-animations-complete .social-item {
  will-change: auto;
}

/* ========================================
   PRODUCTION-LEVEL GSAP HOVER EFFECTS
   ======================================== */

/* Enhanced base styles for premium buttons */
.theme-toggle-btn,
.pdf-download-btn,
.lang-btn {
  /* Ensure proper positioning for multiple effect layers */
  position: relative;
  overflow: hidden;
  
  /* Hardware acceleration and 3D context */
  will-change: transform, filter, box-shadow;
  transform: translateZ(0);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  
  /* Smooth transitions with premium easing */
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
  
  /* Isolation for blend modes */
  isolation: isolate;
  
  /* Enhanced perspective for 3D effects */
  perspective: 1000px;
}

/* Performance-based classes */
.gsap-high-performance .theme-toggle-btn,
.gsap-high-performance .pdf-download-btn,
.gsap-high-performance .lang-btn {
  /* Enable advanced features for high-performance devices */
  filter: contrast(1) brightness(1) saturate(1);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1),
              filter 0.3s ease,
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

.gsap-medium-performance .theme-toggle-btn,
.gsap-medium-performance .pdf-download-btn,
.gsap-medium-performance .lang-btn {
  /* Balanced effects for medium performance */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gsap-low-performance .theme-toggle-btn,
.gsap-low-performance .pdf-download-btn,
.gsap-low-performance .lang-btn {
  /* Minimal effects for low performance devices */
  transition: transform 0.2s ease;
  will-change: transform;
}

/* Effect layer base styles */
.gsap-bg-layer,
.gsap-shine-layer,
.gsap-particle-layer,
.gsap-glow-layer,
.gsap-ripple-container {
  /* Performance optimization for all layers */
  will-change: opacity, transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: strict;
  
  /* Prevent interference with button functionality */
  pointer-events: none !important;
  user-select: none;
}

/* Background layer */
.gsap-bg-layer {
  /* Smooth background transitions */
  transition: opacity 0.3s ease, transform 0.3s ease;
  mix-blend-mode: multiply;
}

[data-theme="light"] .gsap-bg-layer {
  mix-blend-mode: overlay;
}

/* Advanced shine layer */
.gsap-shine-layer {
  /* Complex shine effects with multiple elements */
  mix-blend-mode: overlay;
}

.gsap-shine-element {
  /* Individual shine elements */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: none;
}

.gsap-shine-element.shine-0 {
  /* Primary shine - brightest */
  opacity: 1;
  mix-blend-mode: overlay;
}

.gsap-shine-element.shine-1 {
  /* Secondary shine - colored */
  opacity: 0.7;
  mix-blend-mode: soft-light;
}

.gsap-shine-element.shine-2 {
  /* Accent shine - subtle */
  opacity: 0.4;
  mix-blend-mode: color-dodge;
}

/* Particle layer */
.gsap-particle-layer {
  /* Container for particle effects */
  mix-blend-mode: screen;
}

.gsap-particle {
  /* Individual particles */
  will-change: transform, opacity;
  transform: translateZ(0);
  box-shadow: 0 0 6px currentColor;
  transition: none;
}

/* High performance particle enhancements */
.gsap-high-performance .gsap-particle {
  filter: blur(0.5px);
  box-shadow: 0 0 8px currentColor, 0 0 12px currentColor;
}

/* Glow layer */
.gsap-glow-layer {
  /* Ambient glow effect */
  mix-blend-mode: soft-light;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-theme="light"] .gsap-glow-layer {
  mix-blend-mode: multiply;
  opacity: 0.6 !important;
}

/* Advanced ripple effects */
.gsap-ripple-container {
  /* Container for click ripples */
  mix-blend-mode: normal;
}

.gsap-advanced-ripple {
  /* Multi-layered ripple effect */
  will-change: width, height, opacity, transform;
  transform: translateZ(0);
  transition: none;
}

/* Enhanced button states during advanced interactions */
.theme-toggle-btn.gsap-hovering,
.pdf-download-btn.gsap-hovering,
.lang-btn.gsap-hovering {
  /* Premium hover state with multiple effects */
  transform: perspective(1000px) rotateX(2deg) rotateY(1deg) scale(1.05) translateZ(20px);
  filter: brightness(1.1) contrast(1.05) saturate(1.1);
  
  /* Advanced shadow system */
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 10px 30px rgba(0, 0, 0, 0.1),
    0 5px 15px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle-btn.gsap-hovering,
[data-theme="light"] .pdf-download-btn.gsap-hovering,
[data-theme="light"] .lang-btn.gsap-hovering {
  filter: brightness(1.05) contrast(1.08) saturate(1.05);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.05),
    0 5px 15px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

/* Button-specific enhanced hover states */
.theme-toggle-btn.gsap-hovering {
  /* Theme toggle specific enhancements */
  transform: perspective(1000px) rotateX(3deg) rotateY(2deg) scale(1.08) translateZ(25px);
}

.theme-toggle-btn.gsap-hovering ion-icon {
  transform: scale(1.1) rotate(10deg);
  filter: drop-shadow(0 0 8px currentColor);
}

.pdf-download-btn.gsap-hovering {
  /* PDF download specific enhancements */
  background: linear-gradient(135deg, 
    rgba(74, 144, 226, 0.1) 0%, 
    rgba(0, 123, 255, 0.05) 100%);
}

[data-theme="light"] .pdf-download-btn.gsap-hovering {
  background: linear-gradient(135deg, 
    rgba(13, 110, 253, 0.08) 0%, 
    rgba(0, 86, 179, 0.04) 100%);
}

.lang-btn.gsap-hovering {
  /* Language button specific enhancements */
  background: linear-gradient(135deg, 
    rgba(255, 165, 0, 0.1) 0%, 
    rgba(255, 140, 0, 0.05) 100%);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.5);
}

[data-theme="light"] .lang-btn.gsap-hovering {
  background: linear-gradient(135deg, 
    rgba(255, 140, 0, 0.08) 0%, 
    rgba(255, 108, 0, 0.04) 100%);
  color: rgba(0, 0, 0, 0.9);
  text-shadow: 0 0 6px rgba(255, 140, 0, 0.3);
}

/* Active language button with premium effects */
.lang-btn.active.gsap-hovering {
  /* Enhanced active state with premium glow */
  box-shadow: 
    var(--shadow-1),
    0 0 30px rgba(255, 165, 0, 0.4),
    0 0 60px rgba(255, 165, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  
  background: linear-gradient(135deg,
    rgba(255, 165, 0, 0.2) 0%,
    rgba(255, 140, 0, 0.1) 100%);
}

[data-theme="light"] .lang-btn.active.gsap-hovering {
  box-shadow: 
    var(--shadow-1),
    0 0 30px rgba(255, 140, 0, 0.3),
    0 0 60px rgba(255, 140, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Content enhancement during hover */
.gsap-hovering ion-icon,
.gsap-hovering span {
  /* Text and icon enhancements */
  position: relative;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

/* Ensure proper z-index layering for all effects */
.gsap-glow-layer { z-index: 0; }
.gsap-bg-layer { z-index: 1; }
.gsap-ripple-container { z-index: 2; }
.gsap-shine-layer { z-index: 3; }
.gsap-particle-layer { z-index: 4; }

/* Button content above all effects */
.theme-toggle-btn ion-icon,
.pdf-download-btn span,
.pdf-download-btn ion-icon,
.lang-btn {
  position: relative;
  z-index: 10;
}

/* Responsive optimizations for production */
@media (max-width: 1024px) {
  /* Tablet optimizations */
  .gsap-high-performance .theme-toggle-btn.gsap-hovering,
  .gsap-high-performance .pdf-download-btn.gsap-hovering,
  .gsap-high-performance .lang-btn.gsap-hovering {
    transform: perspective(800px) rotateX(1deg) scale(1.04) translateZ(15px);
  }
  
  .gsap-particle-layer {
    display: none; /* Disable particles on tablets */
  }
}

@media (max-width: 768px) {
  /* Mobile optimizations */
  .theme-toggle-btn.gsap-hovering,
  .pdf-download-btn.gsap-hovering,
  .lang-btn.gsap-hovering {
    transform: scale(1.02) translateZ(5px);
    filter: brightness(1.05) contrast(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  }
  
  .gsap-glow-layer,
  .gsap-particle-layer {
    display: none;
  }
  
  .gsap-shine-element.shine-1,
  .gsap-shine-element.shine-2 {
    display: none; /* Only primary shine on mobile */
  }
}

@media (max-width: 480px) {
  /* Small mobile optimizations */
  .gsap-shine-layer,
  .gsap-bg-layer,
  .gsap-glow-layer,
  .gsap-particle-layer {
    display: none !important;
  }
  
  .theme-toggle-btn.gsap-hovering,
  .pdf-download-btn.gsap-hovering,
  .lang-btn.gsap-hovering {
    transform: scale(1.01);
    filter: none;
    box-shadow: none;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .gsap-shine-layer,
  .gsap-particle-layer,
  .gsap-glow-layer {
    display: none;
  }
  
  /* PDF dropdown touch behavior */
  .pdf-download-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .pdf-language-selector {
    /* Ensure dropdown works properly on touch */
    touch-action: manipulation;
    z-index: 9900 !important;
  }
  
  .pdf-lang-option {
    /* Increase touch target size */
    min-height: 44px;
    display: flex;
    align-items: center;
    -webkit-touch-callout: none;
    touch-action: manipulation;
  }
  
  /* Enhanced focus states for accessibility */
  .theme-toggle-btn:focus-visible,
  .pdf-download-btn:focus-visible,
  .lang-btn:focus-visible {
    outline: 3px solid var(--orange-yellow-crayola);
    outline-offset: 3px;
    box-shadow: 
      0 0 0 6px rgba(255, 165, 0, 0.2),
      0 8px 25px rgba(255, 165, 0, 0.3);
  }
}

/* Accessibility - Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .gsap-bg-layer,
  .gsap-shine-layer,
  .gsap-particle-layer,
  .gsap-glow-layer,
  .gsap-ripple-container {
    display: none !important;
  }
  
  .theme-toggle-btn,
  .pdf-download-btn,
  .lang-btn {
    transition: background-color 0.2s ease, 
                color 0.2s ease, 
                box-shadow 0.2s ease !important;
    will-change: auto !important;
    transform: none !important;
    perspective: none !important;
  }
  
  .theme-toggle-btn.gsap-hovering,
  .pdf-download-btn.gsap-hovering,
  .lang-btn.gsap-hovering {
    transform: none !important;
    filter: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gsap-bg-layer,
  .gsap-shine-layer,
  .gsap-particle-layer,
  .gsap-glow-layer {
    display: none !important;
  }
  
  .theme-toggle-btn.gsap-hovering,
  .pdf-download-btn.gsap-hovering,
  .lang-btn.gsap-hovering {
    background: white;
    color: black;
    border: 2px solid black;
    filter: none !important;
  }
  
  [data-theme="light"] .theme-toggle-btn.gsap-hovering,
  [data-theme="light"] .pdf-download-btn.gsap-hovering,
  [data-theme="light"] .lang-btn.gsap-hovering {
    background: black;
    color: white;
    border: 2px solid white;
  }
}

/* Performance optimization classes */
.gsap-effects-initializing {
  /* Prevent layout shift during initialization */
  contain: layout style;
}

.gsap-effects-initializing .theme-toggle-btn,
.gsap-effects-initializing .pdf-download-btn,
.gsap-effects-initializing .lang-btn {
  will-change: transform, opacity;
}

/* Debug mode styles (development only) */
.gsap-debug-mode .gsap-bg-layer,
.gsap-debug-mode .gsap-shine-layer,
.gsap-debug-mode .gsap-particle-layer,
.gsap-debug-mode .gsap-glow-layer,
.gsap-debug-mode .gsap-ripple-container {
  outline: 1px solid red !important;
  outline-offset: 2px !important;
}

/* Fallback for browsers without GSAP */
.no-gsap .theme-toggle-btn:hover,
.no-gsap .pdf-download-btn:hover,
.no-gsap .lang-btn:hover {
  transform: scale(1.05);
  transition: transform 0.2s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Print media - disable all effects */
@media print {
  .gsap-bg-layer,
  .gsap-shine-layer,
  .gsap-particle-layer,
  .gsap-glow-layer,
  .gsap-ripple-container {
    display: none !important;
  }
  
  .theme-toggle-btn,
  .pdf-download-btn,
  .lang-btn {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
  }
}