/* css/animations.css - Keyframes, animation classes, preloader */

/* === KEYFRAMES === */

/* Star twinkling effect */
@keyframes twinkle {
    from { opacity: 0.4; }
    to { opacity: 0.8; }
}

/* Floating shapes animation */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-30px) rotate(18deg) scale(1.08); }
}

/* Alternance info box background rotation */
@keyframes rotateAlternance {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade-in effect for tab panes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Preloader spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typed.js cursor blinking */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Scroll-to-top button pulse effect */
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* Optional: Subtle glow animation for profile pic */
@keyframes subtleGlow {
    from {
        /* Adjust colors/spread based on theme variables if needed */
        box-shadow: 0 0 15px rgba(143, 148, 251, 0.3), 0 0 5px rgba(255,255,255,0.5);
        border-color: rgba(255, 255, 255, 0.8);
    }
    to {
        box-shadow: 0 0 25px rgba(143, 148, 251, 0.5), 0 0 10px rgba(255,255,255,0.7);
        border-color: rgba(255, 255, 255, 1);
    }
}


/* === ANIMATION UTILITY CLASSES === */

/* Scroll animation trigger class */
.animate-on-scroll {
    opacity: 0; /* Start hidden */
    transform: translateY(40px); /* Start slightly lower */
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.1); /* Smooth transition */
    will-change: opacity, transform; /* Performance hint */
}
.animate-on-scroll.visible { /* Class added by JS when element is intersecting */
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays */
.delay-1 { transition-delay: 0.1s !important; } /* Use !important cautiously if needed */
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
/* Add more delays if needed */


/* === PRELOADER === */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--preloader-bg); /* Themeable background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Highest z-index */
    transition: opacity 0.7s ease 0.3s, visibility 0.7s ease 0.3s; /* Fade out transition with delay */
    opacity: 1;
    visibility: visible;
}
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Preloader Spinner */
.loader {
    width: 60px;
    height: 60px;
    border: 5px solid transparent; /* Transparent base border */
    border-top-color: var(--primary); /* Primary color for outer ring */
    border-radius: 50%;
    animation: spin 1.1s linear infinite; /* Use spin animation */
    position: relative; /* For pseudo-elements */
}
/* Inner spinner rings */
.loader::before,
.loader::after {
    content: "";
    position: absolute;
    border: 5px solid transparent;
    border-radius: 50%;
}
.loader::before { /* Middle ring */
    top: 7px; left: 7px; right: 7px; bottom: 7px;
    border-top-color: var(--secondary); /* Secondary color */
    animation: spin 0.9s linear infinite reverse; /* Spin reverse and faster */
}
.loader::after { /* Inner ring */
    top: 21px; left: 21px; right: 21px; bottom: 21px;
    border-top-color: var(--accent); /* Accent color */
    animation: spin 1.4s linear infinite; /* Spin slower */
}