/* 
 * Animations for domain.com
 * All CSS animations used throughout the website
 */

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s forwards;
    animation-delay: 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Up Animation */
.slide-up {
    opacity: 0;
    transform: translateY(40px);
    animation: slideUp 0.8s forwards;
    animation-delay: 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.6s forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Gradient Shift Animation */
.gradient-shift {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Scale On Hover */
.scale-on-hover {
    transition: transform 0.3s ease;
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

/* Number Counter Animation (CSS Only) */
.counter {
    counter-reset: count var(--num-start);
    animation: counter-animation 2s forwards;
    display: inline-block;
}

.counter::after {
    content: counter(count);
}

@keyframes counter-animation {
    from {
        counter-increment: count var(--num-start);
    }
    to {
        counter-increment: count var(--num-end);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Rotating Animation */
.rotate {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Highlight Animation */
.highlight {
    position: relative;
}

.highlight::before {
    content: "";
    position: absolute;
    width: 0;
    height: 100%;
    bottom: 0;
    left: 0;
    background-color: rgba(46, 196, 182, 0.2);
    z-index: -1;
    transition: width 0.3s ease;
}

.highlight:hover::before {
    width: 100%;
}

/* Mobile Menu Toggle Animation */
.menu-toggle {
    width: 30px;
    height: 20px;
    position: relative;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--text);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.menu-toggle span:nth-child(1) {
    top: 0px;
}

.menu-toggle span:nth-child(2),
.menu-toggle span:nth-child(3) {
    top: 9px;
}

.menu-toggle span:nth-child(4) {
    top: 18px;
}

.menu-toggle.open span:nth-child(1) {
    top: 9px;
    width: 0%;
    left: 50%;
}

.menu-toggle.open span:nth-child(2) {
    transform: rotate(45deg);
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg);
}

.menu-toggle.open span:nth-child(4) {
    top: 9px;
    width: 0%;
    left: 50%;
}

/* FAQ Accordion Animation */
.faq-question::after {
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    transform: rotate(45deg);
}

/* Page Transition */
@keyframes pageTransition {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageTransition 0.5s ease-out;
}
