/* ============================================
   PREMIUM ANIMATIONS & EFFECTS
   The Best Portfolio Ever Created
   ============================================ */

/* ===== CUSTOM CURSOR ===== */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.1s ease;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    opacity: 0.5;
}

.custom-cursor.hover,
.cursor-follower.hover {
    transform: translate(-50%, -50%) scale(1.5);
    background: var(--primary-color);
    opacity: 0.3;
}

/* ===== SCROLL ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.zoom-in {
    animation: zoomIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Premium Animations and Effects - Enhanced & Dynamic */

/* Floating Animation - More Dynamic */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-25px) rotate(2deg);
    }

    66% {
        transform: translateY(-15px) rotate(-2deg);
    }
}

/* Pulse Animation - More Energetic */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.08);
        filter: brightness(1.1);
    }
}

/* Glow Animation - More Vibrant */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.4),
            0 0 60px rgba(var(--secondary-rgb), 0.2);
    }

    50% {
        box-shadow: 0 0 50px rgba(var(--primary-rgb), 0.7),
            0 0 100px rgba(var(--secondary-rgb), 0.4),
            0 0 150px rgba(var(--accent-rgb), 0.2);
    }
}

/* Rainbow Glow - Pakistani Flag Inspired */
@keyframes rainbowGlow {
    0% {
        box-shadow: 0 0 20px rgba(1, 87, 54, 0.5),
            0 0 40px rgba(1, 87, 54, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.6),
            0 0 80px rgba(1, 87, 54, 0.4);
    }

    100% {
        box-shadow: 0 0 20px rgba(1, 87, 54, 0.5),
            0 0 40px rgba(1, 87, 54, 0.3);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }

    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }

    70% {
        transform: scale(0.9) translateY(5px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

/* Slide Up Fade */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(60px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PARTICLE BACKGROUND ===== */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ===== PARALLAX EFFECT ===== */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 200%;
    background-size: cover;
    background-position: center;
    transition: transform 0.1s ease-out;
}

/* ===== GLASSMORPHISM CARDS ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .glass-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== ADVANCED HOVER EFFECTS ===== */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.hover-glow {
    position: relative;
    overflow: hidden;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hover-glow:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== GRADIENT ANIMATIONS ===== */
.animated-gradient {
    background: linear-gradient(270deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 800% 800%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ===== FLOATING ANIMATION ===== */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ===== PULSE ANIMATION ===== */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* ===== SHIMMER EFFECT ===== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* ===== RIPPLE EFFECT ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ===== SKILL PROGRESS ANIMATION ===== */
.skill-progress {
    position: relative;
    overflow: hidden;
}

.skill-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skillShine 2s infinite;
}

@keyframes skillShine {
    to {
        left: 100%;
    }
}

/* ===== CARD FLIP ANIMATION ===== */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ===== NEON GLOW EFFECT ===== */
.neon-text {
    text-shadow:
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 30px var(--primary-color),
        0 0 40px var(--primary-color);
    animation: neonPulse 1.5s ease-in-out infinite;
}

@keyframes neonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* ===== BOUNCING ARROW ===== */
.bouncing-arrow {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }

    .custom-cursor,
    .cursor-follower {
        display: none;
    }
}