/* Portfolio Animations - Comprehensive Animation System */

/* ===== NAVIGATION ANIMATIONS ===== */
@keyframes navItemHover {
    0% {
        transform: scale(1) translateY(0);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
    50% {
        transform: scale(1.05) translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }
    100% {
        transform: scale(1.02) translateY(-1px);
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.08);
    }
}

@keyframes navItemActive {
    0% {
        transform: scale(1.02) translateY(-1px);
    }
    50% {
        transform: scale(0.98) translateY(1px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

@keyframes navItemFocus {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    100% {
        transform: scale(1.03);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    }
}

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

@keyframes navTextSlide {
    0% {
        opacity: 0;
        transform: translateX(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes navBackgroundGlow {
    0% {
        background: rgba(43, 42, 42, 1);
    }
    50% {
        background: rgba(43, 42, 42, 0.9);
    }
    100% {
        background: rgba(43, 42, 42, 1);
    }
}

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

@keyframes mobileNavHover {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

/* ===== FADE IN ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

/* ===== COUNT UP ANIMATIONS ===== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUpScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    70% {
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== SLIDE ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* ===== ROTATE ANIMATIONS ===== */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* ===== ZOOM ANIMATIONS ===== */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomInUp {
    from {
        opacity: 0;
        transform: scale(0.3) translateY(100px);
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== HOVER ANIMATIONS ===== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-30px);
    }
    70% {
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

/* ===== ANIMATION CLASSES ===== */
.animate {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slow {
    animation-duration: 1.2s;
}

.animate-fast {
    animation-duration: 0.4s;
}

/* Fade Animations */
.fade-in { animation-name: fadeIn; }
.fade-in-up { animation-name: fadeInUp; }
.fade-in-down { animation-name: fadeInDown; }
.fade-in-left { animation-name: fadeInLeft; }
.fade-in-right { animation-name: fadeInRight; }

/* Count Up Animations */
.count-up { animation-name: countUp; }
.count-up-scale { animation-name: countUpScale; }
.bounce-in { animation-name: bounceIn; }

/* Slide Animations */
.slide-in-up { animation-name: slideInUp; }
.slide-in-down { animation-name: slideInDown; }
.slide-in-left { animation-name: slideInLeft; }
.slide-in-right { animation-name: slideInRight; }

/* Rotate Animations */
/* .rotate-in { animation-name: rotateIn; }
.flip-in-x { animation-name: flipInX; }
.flip-in-y { animation-name: flipInY; } */

/* Zoom Animations */
.zoom-in { animation-name: zoomIn; }
.zoom-in-up { animation-name: zoomInUp; }

/* Hover Animations */
.hover-pulse:hover { animation: pulse 0.4s ease-in-out; }
.hover-shake:hover { animation: shake 0.3s ease-in-out; }
.hover-swing:hover { animation: swing 0.6s ease-in-out; }

/* ===== PAGE TRANSITION ANIMATIONS ===== */
.page-transition {
    animation: fadeInUp 0.8s ease-out;
}

/* ===== NAVIGATION ANIMATIONS ===== */
.nav-item {
    transition: all 0.3s ease;
}

.nav-item:hover {
    transform: translateY(-1px);
}

.nav-item.active {
    animation: pulse 0.6s ease-in-out;
}

/* ===== PORTFOLIO GRID ANIMATIONS ===== */
.portfolio-item {
    animation: scaleIn 0.6s ease-out;
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* ===== SKILL BAR ANIMATIONS ===== */
.skill-bar {
    animation: slideInLeft 0.8s ease-out;
}

.skill-progress {
    animation: slideInRight 1s ease-out 0.3s both;
}

/* ===== CONTACT FORM ANIMATIONS ===== */
.form-group {
    animation: fadeInUp 0.6s ease-out;
}

.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; }

/* ===== BLOG POST ANIMATIONS ===== */
.blog-post {
    animation: fadeInUp 0.8s ease-out;
}

.blog-meta {
    animation: slideInLeft 0.6s ease-out 0.2s both;
}

.blog-content {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ===== BUTTON ANIMATIONS ===== */
.button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.button:hover::before {
    left: 100%;
}

/* ===== IMAGE ANIMATIONS ===== */
.img-hover-zoom {
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

/* ===== TEXT ANIMATIONS ===== */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: slideInUp 0.6s ease-out both;
}

.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }

/* ===== LOADING STATES ===== */
/* .loading {
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
} */

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (max-width: 768px) {
    .animate {
        animation-duration: 0.8s;
    }
    
    .portfolio-item:hover {
        transform: none;
    }
}

/* ===== 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; }

/* ===== ANIMATION EASING ===== */
.ease-out { animation-timing-function: ease-out; }

/* ===== NAVIGATION ANIMATION UTILITIES ===== */
.nav-animate {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-hover {
    animation: navItemHover 0.3s ease-out forwards;
}

.nav-active {
    animation: navItemActive 0.2s ease-out forwards;
}

.nav-focus {
    animation: navItemFocus 0.2s ease-out forwards;
}

.nav-icon-pulse {
    animation: navIconPulse 0.3s ease-out;
}

.nav-text-slide {
    animation: navTextSlide 0.3s ease-out forwards;
}

.nav-bg-glow {
    animation: navBackgroundGlow 0.3s ease-out;
}

.mobile-nav-slide {
    animation: mobileNavSlide 0.3s ease-out forwards;
}

.mobile-nav-hover {
    animation: mobileNavHover 0.3s ease-out;
}

/* ===== NAVIGATION HOVER STATES ===== */
.nav-item-hover:hover {
    animation: navItemHover 0.3s ease-out forwards;
}

.nav-item-hover:active {
    animation: navItemActive 0.2s ease-out forwards;
}

.nav-item-hover:focus {
    animation: navItemFocus 0.2s ease-out forwards;
}

/* ===== RESPONSIVE NAVIGATION ANIMATIONS ===== */
@media (max-width: 768px) {
    .nav-hover {
        animation: mobileNavHover 0.3s ease-out forwards;
    }
    
    .nav-text-slide {
        animation: mobileNavSlide 0.3s ease-out forwards;
    }
}

/* ===== NAVIGATION ANIMATION PRESETS ===== */
.nav-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-bounce {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-elastic {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== CARD ANIMATIONS ===== */
@keyframes cardHover {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    100% {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }
}

@keyframes cardActive {
    0% {
        transform: translateY(-4px) scale(1.01);
    }
    50% {
        transform: translateY(-2px) scale(0.98);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes cardFocus {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.2);
    }
}

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cardSlideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes cardSlideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes cardFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardRotateIn {
    0% {
        opacity: 0;
        transform: perspective(400px) rotateY(-90deg);
    }
    100% {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

@keyframes cardFlipIn {
    0% {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    100% {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

@keyframes cardZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardStaggerIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cardGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.2);
    }
}

@keyframes cardPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes cardShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

@keyframes cardWiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

/* ===== CARD ANIMATION UTILITIES ===== */
.card-animate {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, opacity;
}

.card-hover:hover {
    animation: cardHover 0.4s ease-out forwards;
}

.card-active:active {
    animation: cardActive 0.2s ease-out forwards;
}

.card-focus:focus {
    animation: cardFocus 0.2s ease-out forwards;
}

.card-slide-in {
    animation: cardSlideIn 0.6s ease-out forwards;
}

.card-slide-in-left {
    animation: cardSlideInLeft 0.6s ease-out forwards;
}

.card-slide-in-right {
    animation: cardSlideInRight 0.6s ease-out forwards;
}

.card-fade-in {
    animation: cardFadeIn 0.6s ease-out forwards;
}

.card-bounce-in {
    animation: cardBounceIn 0.8s ease-out forwards;
}

.card-rotate-in {
    animation: cardRotateIn 0.8s ease-out forwards;
}

.card-flip-in {
    animation: cardFlipIn 0.8s ease-out forwards;
}

.card-zoom-in {
    animation: cardZoomIn 0.6s ease-out forwards;
}

.card-stagger-in {
    animation: cardStaggerIn 0.6s ease-out forwards;
}

.card-glow {
    animation: cardGlow 2s ease-in-out infinite;
}

.card-pulse {
    animation: cardPulse 2s ease-in-out infinite;
}

.card-shake {
    animation: cardShake 0.5s ease-in-out;
}

.card-wiggle {
    animation: cardWiggle 1s ease-in-out;
}

/* ===== SPECIFIC CARD TYPE ANIMATIONS ===== */
/* Portfolio Cards */
.portfolio-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, opacity;
}

.portfolio-item:hover {
    animation: cardHover 0.4s ease-out forwards;
}

.portfolio-item:active {
    animation: cardActive 0.2s ease-out forwards;
}

/* Blog Post Cards */
.post-container {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, opacity;
}

.post-container:hover {
    animation: cardHover 0.4s ease-out forwards;
}

.post-container:active {
    animation: cardActive 0.2s ease-out forwards;
}

/* About Box Stats */
.box-stats {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, opacity;
}

.box-stats:hover {
    animation: cardHover 0.4s ease-out forwards;
}

.box-stats:active {
    animation: cardActive 0.2s ease-out forwards;
}

/* Resume Items */
.resume-box li {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.resume-box li:hover {
    transform: translateX(5px);
    opacity: 0.9;
}

/* Contact Form Elements */
.contact .custom-span-contact {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.contact .custom-span-contact:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Title Sections */
.title-section {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.title-section:hover {
    transform: translateY(-2px);
}

/* ===== CARD STAGGER ANIMATIONS ===== */
.card-stagger-1 { animation-delay: 0.1s; }
.card-stagger-2 { animation-delay: 0.2s; }
.card-stagger-3 { animation-delay: 0.3s; }
.card-stagger-4 { animation-delay: 0.4s; }
.card-stagger-5 { animation-delay: 0.5s; }
.card-stagger-6 { animation-delay: 0.6s; }
.card-stagger-7 { animation-delay: 0.7s; }
.card-stagger-8 { animation-delay: 0.8s; }
.card-stagger-9 { animation-delay: 0.9s; }
.card-stagger-10 { animation-delay: 1s; }

/* ===== CARD HOVER EFFECTS ===== */
.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-hover-scale:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.card-hover-rotate:hover {
    transform: rotateY(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.card-hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

/* ===== RESPONSIVE CARD ANIMATIONS ===== */
@media (max-width: 768px) {
    .card-hover:hover {
        animation: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .portfolio-item:hover {
        animation: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .post-container:hover {
        animation: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
    .card-animate,
    .portfolio-item,
    .post-container,
    .box-stats,
    .resume-box li,
    .contact .custom-span-contact,
    .title-section {
        transition: none;
        animation: none;
    }
    
    .card-hover:hover,
    .portfolio-item:hover,
    .post-container:hover,
    .box-stats:hover {
        transform: none;
        box-shadow: none;
    }
}
