/*
FILE: app/static/css/animations.css
DESCRIPTION: Animation styles for DevHub
DEVELOPER: DevHub.com
*/

/* ===== 3D Card Tilt ===== */
.project-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card .project-image,
.project-card .project-body {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* ===== Particle Background ===== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ===== Float Animation ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* ===== Pulse Animation ===== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(108, 99, 255, 0.4);
    }
}

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

/* ===== Shimmer Animation ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--surface) 25%,
        var(--surface-hover) 50%,
        var(--surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* ===== Fade In Scale ===== */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in-scale {
    animation: fadeInScale 0.5s ease forwards;
}

/* ===== Slide In Left ===== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

/* ===== Slide In Right ===== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

/* ===== Rotate In ===== */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.6s ease forwards;
}

/* ===== Stagger Children ===== */
.stagger-children > * {
    opacity: 0;
}

.stagger-children > *:nth-child(1) { animation: fadeInUp 0.5s ease 0.05s forwards; }
.stagger-children > *:nth-child(2) { animation: fadeInUp 0.5s ease 0.10s forwards; }
.stagger-children > *:nth-child(3) { animation: fadeInUp 0.5s ease 0.15s forwards; }
.stagger-children > *:nth-child(4) { animation: fadeInUp 0.5s ease 0.20s forwards; }
.stagger-children > *:nth-child(5) { animation: fadeInUp 0.5s ease 0.25s forwards; }
.stagger-children > *:nth-child(6) { animation: fadeInUp 0.5s ease 0.30s forwards; }
.stagger-children > *:nth-child(7) { animation: fadeInUp 0.5s ease 0.35s forwards; }
.stagger-children > *:nth-child(8) { animation: fadeInUp 0.5s ease 0.40s forwards; }
.stagger-children > *:nth-child(9) { animation: fadeInUp 0.5s ease 0.45s forwards; }
.stagger-children > *:nth-child(10) { animation: fadeInUp 0.5s ease 0.50s forwards; }

/* ===== Hover Animations ===== */
.hover-grow {
    transition: transform var(--transition);
}

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

.hover-lift {
    transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.hover-glow {
    transition: box-shadow var(--transition);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.3);
}

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

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
}

.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* ===== Skeleton Loading ===== */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton {
    background: var(--surface);
    border-radius: var(--radius-sm);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 16px;
    margin: 4px 0;
    background: var(--surface);
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    padding-top: 56.25%;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Progress Bar Animation ===== */
@keyframes progress-fill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress);
    }
}

.progress-fill-animated {
    animation: progress-fill 1s ease forwards;
}

/* ===== Typing Animation ===== */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary); }
}

.typing-effect {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: typing 3s steps(40) forwards, blink 0.8s step-end infinite;
}

/* ===== 3D Flip Animation ===== */
.flip-container {
    perspective: 1000px;
}

.flip-container:hover .flipper {
    transform: rotateY(180deg);
}

.flipper {
    transition: 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

.flipper-front,
.flipper-back {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.flipper-back {
    transform: rotateY(180deg);
}

/* ===== Confetti Animation ===== */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== Particle Burst ===== */
@keyframes burst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.burst {
    animation: burst 0.6s ease forwards;
}

/* END OF FILE - Signed DevHub.com */