/* Keyframe Animations */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

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

@keyframes mouseWheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes skillLoad {
    from {
        width: 0;
    }
    to {
        width: var(--skill-level);
    }
}

@keyframes shine {
    0% {
        transform: rotate(45deg) translateY(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: rotate(45deg) translateY(100%);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(2deg);
    }
    50% {
        transform: translateY(-25px) rotate(-2deg);
    }
    75% {
        transform: translateY(-15px) rotate(1deg);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(102, 126, 234, 0.8);
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: rotate(0);
        opacity: 1;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Section Animation Classes */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section-animate.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation for Elements */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline Items */
.timeline-item {
    opacity: 0;
    animation: slideInFromLeft 0.8s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

/* Skills */
.skill-item {
    opacity: 0;
    animation: scaleIn 0.5s ease forwards;
}

.skill-item:nth-child(1) { animation-delay: 0.05s; }
.skill-item:nth-child(2) { animation-delay: 0.1s; }
.skill-item:nth-child(3) { animation-delay: 0.15s; }
.skill-item:nth-child(4) { animation-delay: 0.2s; }
.skill-item:nth-child(5) { animation-delay: 0.25s; }
.skill-item:nth-child(6) { animation-delay: 0.3s; }
.skill-item:nth-child(7) { animation-delay: 0.35s; }
.skill-item:nth-child(8) { animation-delay: 0.4s; }

/* Skill Categories */
.skill-category {
    opacity: 0;
    animation: slideInFromBottom 0.6s ease forwards;
}

.skill-category:nth-child(1) { animation-delay: 0.1s; }
.skill-category:nth-child(2) { animation-delay: 0.2s; }
.skill-category:nth-child(3) { animation-delay: 0.3s; }
.skill-category:nth-child(4) { animation-delay: 0.4s; }
.skill-category:nth-child(5) { animation-delay: 0.5s; }

/* Projects */
.project-card {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }

/* Education */
.education-card {
    opacity: 0;
    animation: slideInFromRight 0.8s ease forwards;
}

.education-card:nth-child(1) { animation-delay: 0.1s; }
.education-card:nth-child(2) { animation-delay: 0.2s; }

/* Highlight Cards */
.highlight-card {
    opacity: 0;
    animation: scaleIn 0.5s ease forwards;
}

.highlight-card:nth-child(1) { animation-delay: 0.1s; }
.highlight-card:nth-child(2) { animation-delay: 0.2s; }
.highlight-card:nth-child(3) { animation-delay: 0.3s; }

/* Contact Elements */
.contact-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.contact-item:nth-child(1) { animation-delay: 0.1s; }
.contact-item:nth-child(2) { animation-delay: 0.2s; }
.contact-item:nth-child(3) { animation-delay: 0.3s; }

.social-link {
    opacity: 0;
    animation: slideInFromBottom 0.5s ease forwards;
}

.social-link:nth-child(1) { animation-delay: 0.1s; }
.social-link:nth-child(2) { animation-delay: 0.2s; }
.social-link:nth-child(3) { animation-delay: 0.3s; }
.social-link:nth-child(4) { animation-delay: 0.4s; }

/* Form Elements */
.form-group {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

/* Floating Cards */
.floating-card {
    animation: float 4s ease-in-out infinite;
}

.card1 { animation-delay: 0s; }
.card2 { animation-delay: 1s; }
.card3 { animation-delay: 2s; }

/* Hover Animations */
.hover-grow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

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

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

/* Tech Tags */
.tech-tag {
    transition: all 0.2s ease;
}

.tech-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Project Links */
.project-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-link:hover {
    transform: translateX(5px) scale(1.05);
}

/* Button Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

/* Slide Effects */
.slide-left {
    animation: slideInFromLeft 0.6s ease forwards;
}

.slide-right {
    animation: slideInFromRight 0.6s ease forwards;
}

.slide-up {
    animation: slideInUp 0.6s ease forwards;
}

.slide-down {
    animation: slideInDown 0.6s ease forwards;
}

/* Scale Effects */
.scale-up {
    animation: scaleIn 0.5s ease forwards;
}

.scale-down {
    animation: scaleIn 0.5s ease forwards reverse;
}

/* Rotation Effects */
.rotate-in {
    animation: rotateIn 0.8s ease forwards;
}

/* Pulse Animation for Status Badge */
.status-badge {
    animation: pulse 2s infinite;
}

/* Navbar Animation */
.navbar {
    transition: all 0.3s ease;
}

/* Mouse Scroll Animation */
.mouse .wheel {
    animation: mouseWheel 2s linear infinite;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger Reveal */
.stagger-reveal > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.stagger-reveal.active > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-reveal.active > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-reveal.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-reveal.active > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-reveal.active > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-reveal.active > *:nth-child(5) { transition-delay: 0.25s; }

/* Parallax Background */
.parallax-bg {
    transform: translateY(0);
    will-change: transform;
}

/* Loading Screen */
#loading-screen {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Back to Top Button */
.back-to-top {
    transition: all 0.3s ease;
}

/* Notification Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    animation: slideInRight 0.3s ease;
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}