/* Cool Additional Animations & Effects */
/* ==================================== */

/* Page entrance animation */
@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main {
    animation: pageSlideIn 0.8s ease-out;
}

/* Staggered card animations */
@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.item-box:nth-child(1) { animation: cardSlideUp 0.6s ease-out 0.1s both; }
.item-box:nth-child(2) { animation: cardSlideUp 0.6s ease-out 0.2s both; }
.item-box:nth-child(3) { animation: cardSlideUp 0.6s ease-out 0.3s both; }
.item-box:nth-child(4) { animation: cardSlideUp 0.6s ease-out 0.4s both; }
.item-box:nth-child(5) { animation: cardSlideUp 0.6s ease-out 0.5s both; }
.item-box:nth-child(6) { animation: cardSlideUp 0.6s ease-out 0.6s both; }
.item-box:nth-child(7) { animation: cardSlideUp 0.6s ease-out 0.7s both; }
.item-box:nth-child(8) { animation: cardSlideUp 0.6s ease-out 0.8s both; }
.item-box:nth-child(n+9) { animation: cardSlideUp 0.6s ease-out 0.9s both; }

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

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: float-particle 20s infinite linear;
}

.particle:nth-child(1) {
    width: 4px;
    height: 4px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    width: 6px;
    height: 6px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 30s;
}

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

.particle:nth-child(4) {
    width: 5px;
    height: 5px;
    left: 40%;
    animation-delay: 6s;
    animation-duration: 35s;
}

.particle:nth-child(5) {
    width: 4px;
    height: 4px;
    left: 50%;
    animation-delay: 8s;
    animation-duration: 25s;
}

.particle:nth-child(6) {
    width: 7px;
    height: 7px;
    left: 60%;
    animation-delay: 10s;
    animation-duration: 40s;
}

.particle:nth-child(7) {
    width: 3px;
    height: 3px;
    left: 70%;
    animation-delay: 12s;
    animation-duration: 22s;
}

.particle:nth-child(8) {
    width: 5px;
    height: 5px;
    left: 80%;
    animation-delay: 14s;
    animation-duration: 28s;
}

.particle:nth-child(9) {
    width: 4px;
    height: 4px;
    left: 90%;
    animation-delay: 16s;
    animation-duration: 32s;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Glowing border effect for focused elements */
.glow-focus:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4),
                0 0 20px rgba(102, 126, 234, 0.3),
                inset 0 0 20px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

/* Magnetic hover effect for buttons */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.magnetic-btn:hover {
    transform: scale(1.05) translateZ(0);
}

/* Typewriter effect for titles */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #667eea; }
}

.typewriter-text {
    overflow: hidden;
    border-right: 3px solid #667eea;
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* Ripple effect for clickable items */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::before {
    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;
}

.ripple-effect:active::before {
    width: 300px;
    height: 300px;
}

/* Smooth color transitions */
.smooth-gradient {
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
}

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

/* Bouncy hover effect */
@keyframes bouncy-hover {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.bouncy:hover {
    animation: bouncy-hover 1s ease-in-out;
}

/* Glow pulse effect */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
                    0 0 30px rgba(102, 126, 234, 0.4);
    }
}

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

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

.text-shimmer {
    background: linear-gradient(90deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 75%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: text-shimmer 3s ease-in-out infinite;
}

/* Morphing shapes */
@keyframes morph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }
    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }
}

.morphing-shape {
    animation: morph 8s ease-in-out infinite;
}

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

.float-action {
    animation: float-action 3s ease-in-out infinite;
}

/* Neon glow effect */
.neon-glow {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px #667eea,
        0 0 35px #667eea,
        0 0 40px #667eea;
    animation: neon-flicker 2s ease-in-out infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px #667eea,
            0 0 35px #667eea,
            0 0 40px #667eea;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Perspective tilt effect */
.tilt-effect {
    transition: transform 0.3s ease-out;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg) scale(1.02);
}

/* Sliding underline effect */
.slide-underline {
    position: relative;
}

.slide-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-underline:hover::after {
    width: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Reduce or disable heavy animations on mobile */
    .floating-particles {
        display: none;
    }
    
    .item-box:nth-child(n) {
        animation-duration: 0.3s;
    }
    
    .morphing-shape,
    .glow-pulse,
    .neon-glow {
        animation: none;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-particles,
    .particle {
        display: none;
    }
}
