/* ===================================
   PREMIUM ANIMATIONS & SMOOTH EFFECTS
   Enhanced animations for a smooth, cool portfolio
   =================================== */

/* ===================================
   1. REVEAL ANIMATIONS
   =================================== */

.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal {
    transform: translateY(50px);
}

.reveal-left {
    transform: translateX(-50px);
}

.reveal-right {
    transform: translateX(50px);
}

.reveal-scale {
    transform: scale(0.9);
}

.reveal.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-scale.revealed {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Stagger animation for children */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   2. CUSTOM CURSOR (Desktop Only)
   =================================== */

@media (min-width: 769px) {
    body {
        cursor: none;
    }

    .cursor-follower {
        position: fixed;
        width: 40px;
        height: 40px;
        border: 2px solid var(--primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transition: all 0.15s ease;
        transform: translate(-50%, -50%);
        opacity: 0.5;
    }

    .cursor-dot {
        position: fixed;
        width: 8px;
        height: 8px;
        background: var(--primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: 10000;
        transform: translate(-50%, -50%);
        transition: all 0.1s ease;
    }

    .cursor-follower.cursor-hover {
        width: 60px;
        height: 60px;
        background: rgba(59, 130, 246, 0.1);
        opacity: 1;
    }

    .cursor-dot.cursor-hover {
        width: 12px;
        height: 12px;
    }

    /* Re-enable cursor for inputs */
    input,
    textarea,
    button,
    a {
        cursor: pointer !important;
    }
}

/* ===================================
   3. MAGNETIC BUTTON EFFECT
   =================================== */

.btn,
.social-pill,
.project-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ===================================
   4. 3D CARD TILT EFFECT
   =================================== */

.project-card,
.cert-card,
.skill-category {
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.project-card::before,
.cert-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.project-card:hover::before,
.cert-card:hover::before {
    opacity: 1;
}

/* ===================================
   5. RIPPLE EFFECT
   =================================== */

.btn,
button {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===================================
   6. FLOATING ANIMATION
   =================================== */

.floating {
    animation: float-gentle 3s ease-in-out infinite;
}

@keyframes float-gentle {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Apply to specific elements */
.skill-tag:nth-child(odd),
.tech-pill:nth-child(odd) {
    animation-delay: 0.5s;
}

.skill-tag:nth-child(even),
.tech-pill:nth-child(even) {
    animation-delay: 1s;
}

/* ===================================
   7. GRADIENT ANIMATION
   =================================== */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-text,
.section-title {
    background-size: 200% 200%;
    transition: background-size 0.3s ease;
}

/* ===================================
   8. SMART NAVBAR ANIMATION
   =================================== */

.navbar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.navbar.scroll-down {
    transform: translateY(-100%);
}

.navbar.scroll-up {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ===================================
   9. SMOOTH HOVER EFFECTS
   =================================== */

/* Enhanced button hover */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Card hover effects */
.project-card,
.cert-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover,
.cert-card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Social pill smooth slide */
.social-pill {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-pill:hover {
    transform: translateX(8px) scale(1.02);
}

/* ===================================
   10. LOADING ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   11. GLOW EFFECTS
   =================================== */

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* Glow on hover for cards */
.project-card,
.cert-card {
    position: relative;
}

.project-card::after,
.cert-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(20px);
    transition: opacity 0.3s ease;
}

.project-card:hover::after,
.cert-card:hover::after {
    opacity: 0.3;
}

/* ===================================
   12. TEXT ANIMATIONS
   =================================== */

.hero-title {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.hero-description {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-buttons {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

/* ===================================
   13. SCROLL PROGRESS BAR ANIMATION
   =================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--primary);
}

/* ===================================
   14. SMOOTH TRANSITIONS
   =================================== */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth color transitions */
a,
button,
.nav-link,
.social-pill {
    transition: color 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   15. PARALLAX EFFECT
   =================================== */

.gradient-orb {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ===================================
   16. MOBILE OPTIMIZATIONS
   =================================== */

@media (max-width: 768px) {

    /* Disable heavy animations on mobile */
    .cursor-follower,
    .cursor-dot {
        display: none;
    }

    /* Simpler animations for mobile */
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        animation: fadeIn 0.6s ease both;
    }

    /* Reduce motion for better performance */
    .floating {
        animation: none;
    }

    /* Disable 3D effects on mobile */
    .project-card,
    .cert-card,
    .skill-category {
        transform: none !important;
    }
}

/* ===================================
   17. ACCESSIBILITY - REDUCED MOTION
   =================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cursor-follower,
    .cursor-dot {
        display: none;
    }
}

/* ===================================
   18. PERFORMANCE OPTIMIZATIONS
   =================================== */

/* GPU acceleration for animated elements */
.btn,
.project-card,
.cert-card,
.social-pill,
.gradient-orb {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Contain layout shifts */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
    content-visibility: auto;
}