/* ===== Animation Library - POS Landing Page ===== */

/* ===== Fade & Slide Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* ===== Scale & Zoom Animations ===== */
@keyframes scaleInUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes scaleHover {
    to {
        transform: scale(1.05);
    }
}

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

/* ===== Float & Bounce Animations ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-30px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

/* ===== Pulse & Glow Animations ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(45, 106, 122, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(45, 106, 122, 0.6);
    }
}

@keyframes glowText {
    0%, 100% {
        text-shadow: 0 0 10px rgba(45, 106, 122, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(45, 106, 122, 0.6);
    }
}

/* ===== Slide Animations ===== */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Parallax-like Motion ===== */
@keyframes parallaxSlow {
    to {
        transform: translateY(50px);
    }
}

@keyframes parallaxFast {
    to {
        transform: translateY(-50px);
    }
}

/* ===== Rotate Animations ===== */
@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

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

/* ===== Gradient Shift Animation ===== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===== Text Reveal Animations ===== */
@keyframes textReveal {
    from {
        opacity: 0;
        clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    }
    to {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* ===== Stagger Animation (for use with nth-child) ===== */
@keyframes staggerFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Whole-section viewport fade (Home, Features, Plans, …) ===== */
body > section.section-viewport-fade {
    opacity: 0;
    transition: opacity 1.45s ease;
}
body > section.section-viewport-fade.is-section-visible {
    opacity: 1;
}

/* Turn off per-element entry animations inside sections — only the section fades */
body > section.section-viewport-fade .animate-fade-in-up,
body > section.section-viewport-fade .animate-fade-in-down,
body > section.section-viewport-fade .animate-fade-in,
body > section.section-viewport-fade .animate-scale-in-up,
body > section.section-viewport-fade .animate-bounce-in {
    animation: none !important;
    opacity: 1;
    transform: none;
}

/* ===== Utility Classes ===== */
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-scale-in-up {
    animation: scaleInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.6s ease-out forwards;
}

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

.animate-float-slow {
    animation: floatSlow 5s ease-in-out infinite;
}

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

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

.animate-rotate {
    animation: rotate360 2s linear infinite;
}

/* ===== Stagger Delays ===== */
.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;
}
.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}
.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* ===== Respect Prefers Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    body > section.section-viewport-fade {
        opacity: 1 !important;
        transition: none !important;
    }
}
