/* Interactive Effects and Animations */

/* Tilt Effect - 3D Transform */
.tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.tilt-card.tilting {
    transition: transform 0.1s ease-out;
}

/* Shimmer Effect for AWS Badge */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 153, 0, 0.6) 50%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmerMove 3s infinite;
    transform: rotate(30deg);
}

@keyframes shimmerMove {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(30deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(30deg);
    }
}

/* Glow Pulse Effect */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 153, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(255, 153, 0, 0.8));
    }
}

/* Border Glow Animation (Moving Gradient) */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
        from 0deg at 50% 50%,
        var(--aws-orange) 0deg,
        var(--aws-blue) 90deg,
        var(--aws-orange) 180deg,
        var(--aws-blue) 270deg,
        var(--aws-orange) 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Floating Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Slide In Animations */
.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-in-up {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

/* Scale In Animation */
.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Project Expansion Animation */
.project-tile {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-tile.expanding {
    transform: scale(1.02);
    z-index: 100;
}

.project-tile.expanded {
    animation: expandProject 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes expandProject {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1);
    }
}

/* Circuit Pattern Background (Subtle) */
.circuit-bg {
    position: relative;
    overflow: hidden;
}

.circuit-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(255, 153, 0, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(255, 153, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
    pointer-events: none;
}

/* Tech Stack Item Entrance Animation */
.tech-item {
    animation: techItemEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

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

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

/* Particle Effect (Optional Enhancement) */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--aws-orange);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 3s linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(50px);
    }
}

/* Loading Skeleton (for future enhancements) */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 153, 0, 0.05) 25%,
        rgba(255, 153, 0, 0.1) 50%,
        rgba(255, 153, 0, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeletonLoad 1.5s ease-in-out infinite;
}

@keyframes skeletonLoad {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 153, 0, 0.3);
}

/* Glow on Hover for Interactive Elements */
.glow-hover {
    position: relative;
    transition: all 0.3s ease;
}

.glow-hover::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(circle at center, rgba(255, 153, 0, 0.4), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: inherit;
    filter: blur(10px);
}

.glow-hover:hover::after {
    opacity: 1;
}

/* Text Gradient Animation */
.text-gradient-animate {
    background: linear-gradient(
        90deg,
        var(--text-primary),
        var(--aws-orange),
        var(--text-primary)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradientShift 3s linear infinite;
}

@keyframes textGradientShift {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Stagger Animation for Grid Items */
.stagger-item {
    animation: staggerFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

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

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

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

/* Performance Optimization - GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
