/* ============================================
   FAMILY HUB - PAGE-SPECIFIC ENHANCEMENTS
   Advanced animations and particle effects
   ============================================ */

/* === PARTICLES BACKGROUND === */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat 20s infinite ease-in-out;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* Generate particles with random positions and delays */
.particle:nth-child(1) {
    left: 10%;
    --tx: 30px;
    --ty: -100px;
    animation-delay: 0s;
    animation-duration: 15s;
}

.particle:nth-child(2) {
    left: 20%;
    --tx: -20px;
    --ty: -120px;
    animation-delay: 2s;
    animation-duration: 18s;
}

.particle:nth-child(3) {
    left: 30%;
    --tx: 40px;
    --ty: -90px;
    animation-delay: 4s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    left: 40%;
    --tx: -30px;
    --ty: -110px;
    animation-delay: 1s;
    animation-duration: 17s;
}

.particle:nth-child(5) {
    left: 50%;
    --tx: 25px;
    --ty: -95px;
    animation-delay: 3s;
    animation-duration: 19s;
}

.particle:nth-child(6) {
    left: 60%;
    --tx: -35px;
    --ty: -105px;
    animation-delay: 5s;
    animation-duration: 16s;
}

.particle:nth-child(7) {
    left: 70%;
    --tx: 20px;
    --ty: -115px;
    animation-delay: 2.5s;
    animation-duration: 18s;
}

.particle:nth-child(8) {
    left: 80%;
    --tx: -25px;
    --ty: -100px;
    animation-delay: 4.5s;
    animation-duration: 17s;
}

.particle:nth-child(9) {
    left: 90%;
    --tx: 35px;
    --ty: -108px;
    animation-delay: 1.5s;
    animation-duration: 19s;
}

.particle:nth-child(10) {
    left: 15%;
    --tx: -40px;
    --ty: -98px;
    animation-delay: 3.5s;
    animation-duration: 20s;
}

/* === ENHANCED CARD ANIMATIONS === */
.stagger-animation>* {
    opacity: 0;
    animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.stagger-animation>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animation>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animation>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animation>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animation>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animation>*:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-animation>*:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-animation>*:nth-child(8) {
    animation-delay: 0.8s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === LOADING STATES === */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: var(--radius-lg);
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* === PAGE TRANSITIONS === */
.page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === INTERACTIVE ELEMENTS === */
.interactive-card {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.interactive-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(59, 130, 246, 0.3);
}

.interactive-card:active {
    transform: translateY(-4px) scale(1);
    transition: transform 0.1s;
}

/* === SCROLL REVEAL === */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === COUNTER ANIMATION === */
@keyframes countUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-count {
    animation: countUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === PULSE RING === */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-primary-400);
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* === MAGNETIC CURSOR EFFECT === */
@media (hover: hover) and (pointer: fine) {
    .magnetic-element {
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

/* === SUCCESS CHECKMARK ANIMATION === */
.success-checkmark {
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === NOTIFICATION SLIDE === */
.notification-enter {
    animation: notificationSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes notificationSlide {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {

    /* Reduce animation intensity on mobile for performance */
    .particle {
        animation-duration: 25s;
    }

    .interactive-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    /* Disable some hover effects on touch devices */
    @media (hover: none) {
        .hover-tilt:hover {
            transform: none;
        }
    }
}