/* ===================================
   Keyframe Animations
   =================================== */

/* Blob floating animation */
@-webkit-keyframes blobFloat {
    0%, 100% {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1);
    }
    25% {
        -webkit-transform: translate(30px, -50px) scale(1.05);
        transform: translate(30px, -50px) scale(1.05);
    }
    50% {
        -webkit-transform: translate(-20px, 20px) scale(0.95);
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        -webkit-transform: translate(-40px, -30px) scale(1.02);
        transform: translate(-40px, -30px) scale(1.02);
    }
}
@keyframes blobFloat {
    0%, 100% {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1);
    }
    25% {
        -webkit-transform: translate(30px, -50px) scale(1.05);
        transform: translate(30px, -50px) scale(1.05);
    }
    50% {
        -webkit-transform: translate(-20px, 20px) scale(0.95);
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        -webkit-transform: translate(-40px, -30px) scale(1.02);
        transform: translate(-40px, -30px) scale(1.02);
    }
}

/* Motion lines animation */
@keyframes motionLines {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 100px 100px, 100px 100px, 100px 100px, 100px 100px;
    }
}

/* Slow spin for decorative ring */
@-webkit-keyframes spinSlow {
    from {
        -webkit-transform: translate(-50%, -50%) rotate(0deg);
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        -webkit-transform: translate(-50%, -50%) rotate(360deg);
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
@keyframes spinSlow {
    from {
        -webkit-transform: translate(-50%, -50%) rotate(0deg);
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        -webkit-transform: translate(-50%, -50%) rotate(360deg);
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

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

/* Scroll arrow animation */
@-webkit-keyframes scrollArrow {
    0%, 100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        -webkit-transform: translateY(5px);
        transform: translateY(5px);
    }
}
@keyframes scrollArrow {
    0%, 100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        -webkit-transform: translateY(5px);
        transform: translateY(5px);
    }
}

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

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

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

/* Slide in from left */
@-webkit-keyframes slideInLeft {
    from {
        opacity: 0;
        -webkit-transform: translateX(-30px);
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}
@keyframes slideInLeft {
    from {
        opacity: 0;
        -webkit-transform: translateX(-30px);
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}

/* Slide in from right */
@-webkit-keyframes slideInRight {
    from {
        opacity: 0;
        -webkit-transform: translateX(30px);
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}
@keyframes slideInRight {
    from {
        opacity: 0;
        -webkit-transform: translateX(30px);
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}

/* Pulse glow effect */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
    }
}

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

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

/* ===================================
   Scroll Reveal Classes
   =================================== */

/* Base reveal state - hidden */
.reveal-text,
.reveal-slide,
.reveal-scale {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-text {
    transform: translateY(30px);
}

.reveal-slide {
    transform: translateX(-30px);
}

.reveal-scale {
    transform: scale(0.95);
}

/* Revealed state */
.reveal-text.revealed,
.reveal-slide.revealed,
.reveal-scale.revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Staggered delays for child elements */
.reveal-text:nth-child(1) { transition-delay: 0s; }
.reveal-text:nth-child(2) { transition-delay: 0.1s; }
.reveal-text:nth-child(3) { transition-delay: 0.2s; }
.reveal-text:nth-child(4) { transition-delay: 0.3s; }
.reveal-text:nth-child(5) { transition-delay: 0.4s; }
.reveal-text:nth-child(6) { transition-delay: 0.5s; }

.reveal-slide:nth-child(1) { transition-delay: 0s; }
.reveal-slide:nth-child(2) { transition-delay: 0.15s; }
.reveal-slide:nth-child(3) { transition-delay: 0.3s; }
.reveal-slide:nth-child(4) { transition-delay: 0.45s; }
.reveal-slide:nth-child(5) { transition-delay: 0.6s; }

.reveal-scale:nth-child(1) { transition-delay: 0s; }
.reveal-scale:nth-child(2) { transition-delay: 0.1s; }
.reveal-scale:nth-child(3) { transition-delay: 0.2s; }
.reveal-scale:nth-child(4) { transition-delay: 0.3s; }
.reveal-scale:nth-child(5) { transition-delay: 0.4s; }
.reveal-scale:nth-child(6) { transition-delay: 0.5s; }

/* ===================================
   Interactive Hover Animations
   =================================== */

/* Card hover lift effect */
.work-card,
.skills-category,
.education-card,
.cert-card,
.volunteer-card,
.stat-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease;
}

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300%;
    height: 300%;
}

/* Link underline animation */
.nav-link,
.contact-item a {
    position: relative;
}

/* Image hover zoom */
.work-image {
    overflow: hidden;
}

.work-placeholder {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Timeline marker pulse on hover */
.timeline-item:hover .timeline-marker {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===================================
   Loading Animation
   =================================== */

/* Page load animation */
body {
    animation: fadeIn 0.8s ease-out;
}

/* Skeleton loading effect */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ===================================
   Hero Section Specific Animations
   =================================== */

.hero-greeting {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-headline {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-subheadline {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.hero-visual {
    animation: scaleIn 1s ease-out 0.6s both;
}

/* Hero decoration animations */
.deco-ring {
    opacity: 0.3;
}

.deco-dots {
    animation: float 4s ease-in-out infinite;
}

/* ===================================
   Scroll Indicator Animation
   =================================== */

.scroll-indicator {
    animation: fadeIn 1s ease-out 1.5s both;
}

/* ===================================
   Navbar Animations
   =================================== */

.navbar {
    animation: fadeIn 0.5s ease-out;
}

.nav-menu.active {
    animation: slideInRight 0.3s ease-out;
}

/* ===================================
   Form Focus Animations
   =================================== */

.form-group input,
.form-group textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
}

/* ===================================
   Reduced Motion Preferences
   =================================== */

@media (prefers-reduced-motion: reduce) {
    /* Disable all animations */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Keep elements visible */
    .reveal-text,
    .reveal-slide,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
    
    /* Disable blob animations */
    .gradient-blob {
        animation: none;
    }
    
    /* Disable motion lines */
    .motion-lines {
        animation: none;
    }
    
    /* Disable decorative animations */
    .deco-ring {
        animation: none;
    }
    
    .deco-dots {
        animation: none;
    }
    
    /* Disable hover transforms */
    .work-card:hover,
    .skills-category:hover,
    .education-card:hover,
    .cert-card:hover,
    .volunteer-card:hover,
    .stat-card:hover {
        transform: none;
    }
    
    .work-card:hover .work-placeholder {
        transform: none;
    }
    
    .timeline-content:hover {
        transform: none;
    }
    
    /* Keep visual feedback without motion */
    .btn:hover {
        transform: none;
    }
    
    .btn::before {
        display: none;
    }
}

/* ===================================
   Custom Cursor Effects (Optional)
   =================================== */

/* Uncomment if you want custom cursor effects
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}
*/

/* ===================================
   Text Gradient Animation
   =================================== */

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

.hero-title,
.section-title {
    background-size: 200% 200%;
}

/* Uncomment for animated gradient text
.hero-title,
.section-title {
    animation: gradientShift 8s ease infinite;
}
*/

/* ===================================
   Particle Effects (CSS Only)
   =================================== */

/* Floating particles container */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 10s ease-in-out infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: -2s;
    animation-duration: 14s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: -4s;
    animation-duration: 11s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: -1s;
    animation-duration: 13s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: -3s;
    animation-duration: 15s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: -5s;
    animation-duration: 10s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: -2s;
    animation-duration: 12s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: -4s;
    animation-duration: 14s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: -1s;
    animation-duration: 11s;
}
