/* Advanced 3D Animations and Effects for Rimal Website - Updated with more blue */

/* 3D Button Effects */
.btn {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              box-shadow 0.3s ease,
              background-color 0.3s ease;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(56, 182, 255, 0.6) 0%, rgba(156, 106, 222, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.btn:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 25px rgba(56, 182, 255, 0.5), 
              0 0 15px rgba(56, 182, 255, 0.4);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 8px 15px rgba(56, 182, 255, 0.5);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.8);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0) translate(-50%, -50%);
    opacity: 1;
  }
  100% {
    transform: scale(20) translate(-50%, -50%);
    opacity: 0;
  }
}

/* 3D Card Effects */
.character-card, .map-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.6s ease;
}

.character-card:hover, .map-card:hover {
  transform: translateY(-15px) rotateX(5deg) rotateY(-5deg);
  box-shadow: 20px 20px 30px rgba(0, 0, 0, 0.4),
              -5px -5px 30px rgba(56, 182, 255, 0.2);
}

.character-card::after, .map-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
                rgba(56, 182, 255, 0.3) 0%, 
                rgba(56, 182, 255, 0.2) 50%,
                rgba(74, 30, 127, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;
  pointer-events: none;
  border-radius: 10px;
}

.character-card:hover::after, .map-card:hover::after {
  opacity: 1;
}

.character-img, .map-img {
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.character-card:hover .character-img, .map-card:hover .map-img {
  transform: scale(1.05) translateZ(20px);
}

.character-info, .map-info {
  transform: translateZ(10px);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.character-card:hover .character-info {
  transform: translateZ(30px);
}

/* Floating Animation for Logo */
.logo img {
  animation: float 6s ease-in-out infinite;
}

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

/* Glowing Text Effect */
.hero-title {
  position: relative;
  text-shadow: 0 0 10px rgba(56, 182, 255, 0.7),
               0 0 20px rgba(56, 182, 255, 0.5),
               0 0 30px rgba(56, 182, 255, 0.3);
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px rgba(56, 182, 255, 0.7),
                 0 0 20px rgba(56, 182, 255, 0.5),
                 0 0 30px rgba(56, 182, 255, 0.3);
  }
  to {
    text-shadow: 0 0 20px rgba(56, 182, 255, 0.9),
                 0 0 30px rgba(56, 182, 255, 0.7),
                 0 0 40px rgba(56, 182, 255, 0.5);
  }
}

/* 3D Parallax Effect */
.hero {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.hero-content {
  transform: translateZ(50px);
  transition: transform 0.3s ease;
}

.hero::before {
  transform: translateZ(-50px);
}

/* Enhanced Particle System */
.particle {
  box-shadow: 0 0 10px rgba(56, 182, 255, 0.7),
              0 0 20px rgba(56, 182, 255, 0.5);
  background: radial-gradient(circle at center, 
              rgba(56, 182, 255, 0.9) 0%, 
              rgba(56, 182, 255, 0.5) 70%, 
              transparent 100%);
}

/* Advanced Hover Effects for Navigation */
.nav-links a {
  position: relative;
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
  transform: translateY(-3px);
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #38B6FF, #38B6FF, #9C6ADE);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* 3D Section Transitions */
.section-title h2 {
  position: relative;
  transform-style: preserve-3d;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) translateZ(-5px);
  width: 100px;
  height: 4px;
  background: linear-gradient(to right, #38B6FF, #9C6ADE, #4A1E7F);
}

/* Animated Background Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
              rgba(56, 182, 255, 0.07) 0%, 
              rgba(56, 182, 255, 0.05) 50%, 
              rgba(74, 30, 127, 0.03) 100%);
  z-index: -1;
  animation: gradientShift 15s ease infinite;
}

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

/* 3D Flip Cards */
.team-member {
  perspective: 1000px;
}

.team-member-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.team-member:hover .team-member-inner {
  transform: rotateY(180deg);
}

.team-member-front, .team-member-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.team-member-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #38B6FF 0%, #4A1E7F 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border-radius: 10px;
}

/* Animated Form Fields */
.form-input, .form-textarea {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(56, 182, 255, 0.3);
}

/* Animated Progress Bars */
.skill-bar {
  height: 10px;
  background: rgba(56, 182, 255, 0.2);
  border-radius: 5px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(to right, #38B6FF, #9C6ADE, #4A1E7F);
  border-radius: 5px;
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  transition: width 1.5s ease;
}

/* 3D Social Icons */
.footer-social a {
  transform-style: preserve-3d;
  transition: transform 0.5s ease, background-color 0.3s ease;
}

.footer-social a:hover {
  transform: translateY(-8px) rotateY(15deg);
  background-color: #38B6FF;
}

.footer-social a i {
  transition: transform 0.5s ease;
}

.footer-social a:hover i {
  transform: translateZ(10px);
}

/* Mouse Parallax Effect */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.1s ease-out;
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Neon Glow Effect for Buttons */
.btn-neon {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid #38B6FF;
  box-shadow: 0 0 5px #38B6FF,
              0 0 10px #38B6FF,
              0 0 15px #38B6FF;
}

.btn-neon:hover {
  background-color: #38B6FF;
  box-shadow: 0 0 10px #38B6FF,
              0 0 20px #38B6FF,
              0 0 30px #38B6FF;
}

/* 3D Text Effect */
.text-3d {
  text-shadow: 1px 1px 1px rgba(0,0,0,0.3),
               2px 2px 2px rgba(0,0,0,0.3),
               3px 3px 3px rgba(0,0,0,0.3);
  transform: translateZ(20px);
}

/* Animated Background Shapes */
.bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  opacity: 0.2;
  animation: shapeFloat 15s infinite linear;
}

.shape1 {
  top: 20%;
  left: 10%;
  width: 80px;
  height: 80px;
  background: #38B6FF;
  border-radius: 50%;
  animation-duration: 20s;
}

.shape2 {
  top: 60%;
  left: 80%;
  width: 120px;
  height: 120px;
  background: #38B6FF;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation-duration: 25s;
  animation-delay: 2s;
}

.shape3 {
  top: 80%;
  left: 30%;
  width: 60px;
  height: 60px;
  background: #38B6FF;
  border-radius: 30% 70% 30% 70% / 70% 30% 70% 30%;
  animation-duration: 18s;
  animation-delay: 4s;
}

@keyframes shapeFloat {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(10px, -30px) rotate(90deg) scale(1.1);
  }
  50% {
    transform: translate(30px, 10px) rotate(180deg) scale(0.9);
  }
  75% {
    transform: translate(-10px, 30px) rotate(270deg) scale(1.1);
  }
  100% {
    transform: translate(0, 0) rotate(360deg) scale(1);
  }
}

/* Blue glow effect for elements */
.blue-glow {
  box-shadow: 0 0 10px rgba(56, 182, 255, 0.5),
              0 0 20px rgba(56, 182, 255, 0.3);
  transition: box-shadow 0.3s ease;
}

.blue-glow:hover {
  box-shadow: 0 0 15px rgba(56, 182, 255, 0.7),
              0 0 30px rgba(56, 182, 255, 0.5);
}

/* Blue pulse animation */
.blue-pulse {
  animation: bluePulse 2s infinite;
}

@keyframes bluePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 182, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(56, 182, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 182, 255, 0);
  }
}

/* Blue highlight effect */
.blue-highlight {
  position: relative;
  overflow: hidden;
}

.blue-highlight::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(56, 182, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: blueHighlight 3s infinite;
}

@keyframes blueHighlight {
  0% {
    transform: translateX(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) rotate(30deg);
  }
}

/* Responsive adjustments for animations */
@media screen and (max-width: 768px) {
  .hero-content {
    transform: translateZ(20px);
  }
  
  .character-card:hover, .map-card:hover {
    transform: translateY(-10px) rotateX(3deg) rotateY(-3deg);
  }
  
  .btn:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

@media (prefers-reduced-motion) {
  .logo img,
  .hero-title,
  .particle,
  .character-card,
  .map-card,
  .btn,
  .nav-links a,
  .form-input,
  .form-textarea,
  .footer-social a,
  .reveal,
  .shape {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* Animations for Rimal Website */

/* Fade In Down Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Sand Drift Animation */
@keyframes sandDrift {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0.7;
    }
    50% {
        transform: translateX(20px) translateY(-10px);
        opacity: 0.9;
    }
    100% {
        transform: translateX(0px) translateY(0);
        opacity: 0.7;
    }
}

/* Desert Mirage Animation */
@keyframes desertMirage {
    0% {
        opacity: 0.5;
        filter: blur(0px);
    }
    50% {
        opacity: 0.8;
        filter: blur(2px);
    }
    100% {
        opacity: 0.5;
        filter: blur(0px);
    }
}

/* Shimmer Animation for golden elements */
@keyframes goldShimmer {
    0% {
        background-position: -100px;
    }
    100% {
        background-position: 200px;
    }
}

/* Heat Wave Animation */
@keyframes heatWave {
    0% {
        transform: scale(1) skew(0deg);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05) skew(2deg);
        opacity: 0.6;
    }
    100% {
        transform: scale(1) skew(0deg);
        opacity: 0.5;
    }
}

/* Sand Particle Animation */
.sand-particle {
    position: absolute;
    background-color: var(--sand-gold);
    border-radius: 50%;
    opacity: 0.3;
    z-index: 1;
    animation: sandDrift 15s infinite ease-in-out;
}

/* Apply animations to elements */
.hero-title {
    animation: fadeInDown 1.2s ease;
}

.hero-subtitle {
    animation: fadeInUp 1.2s ease 0.3s forwards;
    opacity: 0;
}

.hero-btn {
    animation: fadeIn 1.2s ease 0.6s forwards;
    opacity: 0;
}

.character-card {
    animation: fadeIn 1s ease;
    transition: all 0.5s ease;
}

.character-card:hover {
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.map-card {
    animation: fadeIn 1s ease;
    transition: all 0.5s ease;
}

.map-card:hover {
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Add desert mirage effect to hero section background */
.hero::before {
    animation: desertMirage 8s infinite ease-in-out;
}

/* Add shimmer effect to golden elements */
.shimmer-effect {
    background: linear-gradient(
        to right,
        var(--sand-gold) 0%,
        var(--white-sand) 20%,
        var(--sand-gold) 40%
    );
    background-size: 300px 100%;
    animation: goldShimmer 3s infinite linear;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Add heat wave effect for background elements */
.heat-wave {
    animation: heatWave 8s infinite ease-in-out;
}

/* CSS for sand particles in hero section */
.sand-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Generate sand particles with JavaScript */
document.addEventListener('DOMContentLoaded', function() {
    const heroSection = document.querySelector('.hero');
    const sandParticles = document.querySelector('.sand-particles');
    
    if (heroSection && sandParticles) {
        const numberOfParticles = 30;
        
        for (let i = 0; i < numberOfParticles; i++) {
            const particle = document.createElement('div');
            particle.classList.add('sand-particle');
            
            // Random position
            const posX = Math.random() * 100;
            const posY = Math.random() * 100;
            
            // Random size
            const size = Math.random() * 8 + 2;
            
            // Random animation delay
            const delay = Math.random() * 10;
            
            // Random animation duration
            const duration = Math.random() * 10 + 10;
            
            // Set styles
            particle.style.width = `${size}px`;
            particle.style.height = `${size}px`;
            particle.style.left = `${posX}%`;
            particle.style.top = `${posY}%`;
            particle.style.opacity = Math.random() * 0.5 + 0.1;
            particle.style.animationDelay = `${delay}s`;
            particle.style.animationDuration = `${duration}s`;
            
            sandParticles.appendChild(particle);
        }
    }
});
