/* Animations.css - Custom animation keyframes and utility classes */

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

/* Slide Up */
@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from { 
        opacity: 0;
        transform: translateX(-50px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(50px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Blur In */
@keyframes blurIn {
    from { 
        opacity: 0;
        filter: blur(10px);
    }
    to { 
        opacity: 1;
        filter: blur(0);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from { 
        opacity: 0;
        transform: rotate(-10deg);
    }
    to { 
        opacity: 1;
        transform: rotate(0);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* Pulse */
@keyframes pulse {
    0% {transform: scale(1);}
    50% {transform: scale(1.05);}
    100% {transform: scale(1);}
}

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Performance optimized animations */

/* Simplified Fade In (for low quality) */
@keyframes simpleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Simplified Slide Up (for low quality) */
@keyframes simpleSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Text reveal animation classes */
.text-reveal-container {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Animation quality classes */

/* Low quality animations - simpler, less CPU intensive */
.animation-quality-low .gsap-animated {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.animation-quality-low .fade-in {
    animation: simpleFadeIn 0.4s ease forwards;
}

.animation-quality-low .slide-up {
    animation: simpleSlideUp 0.4s ease forwards;
}

/* Medium quality animations - balanced performance */
.animation-quality-medium .gsap-animated {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Reduced motion preferences */
@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;
    }
}

.reduced-motion *, 
.reduced-motion *::before, 
.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Fallback classes for when GSAP is disabled */
.gsap-fallback {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gsap-fallback.visible {
    opacity: 1;
}

.gsap-fallback.slide-up {
    transform: translateY(20px);
}

.gsap-fallback.slide-up.visible {
    transform: translateY(0);
}

.gsap-fallback.slide-left {
    transform: translateX(-20px);
}

.gsap-fallback.slide-left.visible {
    transform: translateX(0);
}

.gsap-fallback.slide-right {
    transform: translateX(20px);
}

.gsap-fallback.slide-right.visible {
    transform: translateX(0);
}

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

/* Animation Classes */
.animate {
    opacity: 0;
    will-change: transform, opacity;
}

.animate.fade-in {
    animation: fadeIn 1s ease forwards;
}

.animate.slide-up {
    animation: slideUp 1s ease forwards;
}

.animate.slide-left {
    animation: slideInLeft 1s ease forwards;
}

.animate.slide-right {
    animation: slideInRight 1s ease forwards;
}

.animate.scale-in {
    animation: scaleIn 1s ease forwards;
}

.animate.blur-in {
    animation: blurIn 1s ease forwards;
}

.animate.rotate-in {
    animation: rotateIn 1s ease forwards;
}

.animate.bounce {
    animation: bounce 2s ease infinite;
    opacity: 1;
}

.animate.pulse {
    animation: pulse 2s ease infinite;
    opacity: 1;
}

.animate.float {
    animation: float 3s ease-in-out infinite;
    opacity: 1;
}

/* Staggered Animation Delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

.delay-900 {
    animation-delay: 0.9s;
}

.delay-1000 {
    animation-delay: 1s;
}

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-fast);
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(0, 113, 227, 0.5);
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Parallax Effect */
.parallax {
    transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: transform;
}

/* Scroll-triggered animations */
.reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
}

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered reveal delays */
.reveal-delay-100 {
    transition-delay: 0.1s;
}

.reveal-delay-200 {
    transition-delay: 0.2s;
}

.reveal-delay-300 {
    transition-delay: 0.3s;
}

.reveal-delay-400 {
    transition-delay: 0.4s;
}

.reveal-delay-500 {
    transition-delay: 0.5s;
}

.reveal-delay-600 {
    transition-delay: 0.6s;
}

.reveal-delay-700 {
    transition-delay: 0.7s;
}

.reveal-delay-800 {
    transition-delay: 0.8s;
}

.reveal-delay-900 {
    transition-delay: 0.9s;
}

.reveal-delay-1000 {
    transition-delay: 1s;
}

/* Specific Element Animations */

/* Hero Section */
.hero-title {
    opacity: 0;
    animation: slideInLeft 1s ease 0.2s forwards;
}

.hero-subtitle {
    opacity: 0;
    animation: slideInLeft 1s ease 0.4s forwards;
}

.hero-description {
    opacity: 0;
    animation: slideInLeft 1s ease 0.6s forwards;
}

.hero-cta {
    opacity: 0;
    animation: fadeIn 1s ease 0.8s forwards;
}

/* About Section */
.about-visual-element {
    position: relative;
    overflow: hidden;
}

.about-visual-element::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--color-primary) 0%, transparent 70%);
    opacity: 0.1;
    animation: pulse 5s ease-in-out infinite;
}

/* Skills Cards */
.skill-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background-color: rgba(0, 113, 227, 0.1);
}

.skill-icon {
    transition: transform 0.3s ease;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1);
}

/* Timeline Items */
.timeline-content {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Contact Form */
.contact-form .btn {
    position: relative;
    overflow: hidden;
}

.contact-form .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0) 100%);
    transition: left 0.5s ease;
}

.contact-form .btn:hover::after {
    left: 100%;
}

/* Advanced Animations CSS */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in down animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in left animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in right animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.7);
    }
    
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 113, 227, 0);
    }
    
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0);
    }
}

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

/* Rotate animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer animation for text */
@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Typing cursor animation */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Ripple effect animation */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Flip animation */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* Morph animation */
@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* 3D Hover effect */
.hover-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.hover-3d:hover {
    transform: translateY(-5px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Animated gradient text */
.gradient-text {
    background: linear-gradient(
        to right,
        #0071e3,
        #42a5f5,
        #ff375f,
        #0071e3
    );
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    animation: shimmer 8s ease-in-out infinite;
}

/* Animated underline effect */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #0071e3, #42a5f5);
    transition: width 0.3s ease;
}

.animated-underline:hover::after,
.animated-underline.active::after {
    width: 100%;
}

/* Glow effect */
.glow {
    box-shadow: 0 0 15px rgba(0, 113, 227, 0.5);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(0, 113, 227, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 113, 227, 0.8), 0 0 30px rgba(0, 113, 227, 0.6);
    }
}

/* Floating effect */
.floating {
    animation: float 6s ease-in-out infinite;
}

/* Pulse effect */
.pulse {
    animation: pulse 2s infinite;
}

/* Modern button hover effect */
.btn-modern {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #0071e3, #42a5f5);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.3);
    z-index: 1;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #42a5f5, #0071e3);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 113, 227, 0.4);
}

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

.btn-modern:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(0, 113, 227, 0.3);
}

/* Ripple effect for buttons */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

.btn-ripple:focus:not(:active)::after {
    animation: ripple 1s;
}

/* Neumorphic design */
.neumorphic {
    background: linear-gradient(145deg, #1a1a1a, #2c2c2c);
    box-shadow: 8px 8px 16px #121212, -8px -8px 16px #383838;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.neumorphic:hover {
    box-shadow: 12px 12px 20px #101010, -12px -12px 20px #3a3a3a;
}

.neumorphic-inset {
    background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
    box-shadow: inset 5px 5px 10px #121212, inset -5px -5px 10px #383838;
    border-radius: 10px;
    padding: 5px 10px;
}

/* Modern card design */
.modern-card {
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.modern-card::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: all 0.6s;
    z-index: -1;
}

.modern-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modern-card:hover::before {
    left: 100%;
}

/* Text reveal animation */
.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: revealText 0.8s forwards;
}

@keyframes revealText {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Staggered animations for multiple elements */
.stagger-fade-in > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-fade-in.active > *:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.stagger-fade-in.active > *:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.stagger-fade-in.active > *:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.stagger-fade-in.active > *:nth-child(4) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.stagger-fade-in.active > *:nth-child(5) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* Reveal animations for sections */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Morphing background */
.morphing-bg {
    background: linear-gradient(-45deg, #0071e3, #42a5f5, #ff375f, #9c27b0);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

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

/* Shiny effect */
.shiny {
    position: relative;
    overflow: hidden;
}

.shiny::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shinyEffect 6s ease-in-out infinite;
}

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

/* Advanced hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.6);
}

/* Performance considerations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive animations */
@media (max-width: 768px) {
    .btn-modern {
        padding: 10px 20px;
    }
    
    .modern-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .hover-3d:hover {
        transform: translateY(-3px) rotateX(3deg) rotateY(3deg);
    }
}