﻿/* 
* Hiệu ứng animations cho trang web
* Website Mica Group
*/

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 1s ease forwards;
}

/* Slide up animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.animate-slide-up {
    transform: translateY(100%);
}

/* Wipe animation */
@keyframes wipeReveal {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

.wipe-animation {
    position: relative;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: wipeReveal 1.5s ease-out forwards;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    opacity: 0;
    transform: translateY(-50px);
    animation: slideDown 1s ease forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.2s);
}

/* Slide up animation for cards */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 1s ease forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.2s);
}

/* Fly up animation */
@keyframes flyUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fly-up-element {
    opacity: 0;
    transform: translateY(50px);
    animation: flyUp 1s ease forwards;
}

/* Fly up animation delays */
.fly-up-element:nth-child(1) { animation-delay: 0.1s; }
.fly-up-element:nth-child(2) { animation-delay: 0.3s; }
.fly-up-element:nth-child(3) { animation-delay: 0.5s; }
.fly-up-element:nth-child(4) { animation-delay: 0.7s; }

/* Zoom Out animation */
@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-out-animation {
    opacity: 0;
    transform: scale(1.5);
    animation: zoomOut 1.2s ease forwards;
}

/* Float Up animation */
@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.float-up-element {
    opacity: 0;
    transform: translateY(30px);
    animation: floatUp 0.8s ease-out forwards;
}

/* Animation delays for cards */
.news-card.float-up-element:nth-child(1) { animation-delay: 0.2s; }
.news-card.float-up-element:nth-child(2) { animation-delay: 0.4s; }
.side-news-item.float-up-element:nth-child(1) { animation-delay: 0.3s; }
.side-news-item.float-up-element:nth-child(2) { animation-delay: 0.5s; }
.side-news-item.float-up-element:nth-child(3) { animation-delay: 0.7s; }
.side-news-item.float-up-element:nth-child(4) { animation-delay: 0.9s; }
.float-up-element:last-child { animation-delay: 1.1s; }

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Animation delays for business cards */
.business-card:nth-child(1) { --animation-order: 1; }
.business-card:nth-child(2) { --animation-order: 2; }
.business-card:nth-child(3) { --animation-order: 3; }
.business-card:nth-child(4) { --animation-order: 4; }
.business-card:nth-child(5) { --animation-order: 5; }
.business-card:nth-child(6) { --animation-order: 6; }

/* Additional selectors for direct animation delays */
.col-md-4:nth-child(1) .business-card { --animation-order: 1; }
.col-md-4:nth-child(2) .business-card { --animation-order: 2; }
.col-md-4:nth-child(3) .business-card { --animation-order: 3; }
.col-md-4:nth-child(4) .business-card { --animation-order: 4; }
.col-md-4:nth-child(5) .business-card { --animation-order: 5; }
.col-md-4:nth-child(6) .business-card { --animation-order: 6; }

/* Initially hide elements that will be animated */
.animate-fade-in {
    opacity: 0;
}

/* Slide up animation for hero */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Wipe animation for section titles */
.wipe-animation {
    position: relative;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: wipeReveal 1.5s ease-out forwards;
}

@keyframes wipeReveal {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* Fly Up Animation for Giới thiệu tập đoàn section */
.fly-up-animation {
    overflow: hidden;
}

/* Zoom Out animation for heading */
.zoom-out-animation {
    opacity: 0;
    transform: scale(1.5);
    animation: zoomOut 1.2s ease forwards;
}

@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Float Up animation for news items */
.float-up-element {
    opacity: 0;
    transform: translateY(30px);
    animation: floatUp 0.8s ease-out forwards;
}

.news-card.float-up-element:nth-child(1) { animation-delay: 0.2s; }
.news-card.float-up-element:nth-child(2) { animation-delay: 0.4s; }
.side-news-item.float-up-element:nth-child(1) { animation-delay: 0.3s; }
.side-news-item.float-up-element:nth-child(2) { animation-delay: 0.5s; }
.side-news-item.float-up-element:nth-child(3) { animation-delay: 0.7s; }
.side-news-item.float-up-element:nth-child(4) { animation-delay: 0.9s; }
.float-up-element:last-child { animation-delay: 1.1s; }

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Set hero banner height */
.hero-banner {
    height: 100vh;
    min-height: 600px;
}

/* Responsive adjustments for animations */
@media (max-width: 768px) {
    .hero-banner {
        min-height: 500px;
    }
    .scroll-down-btn p {
        font-size: 16px;
        line-height: 22px;
        padding: 0 15px;
    }
    .scroll-down-btn img {
        width: 30px;
        height: 30px;
    }
}

/* Always ensure animations play */
.business-card.slide-down, 
.business-card.slide-up {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Make sure we have the slideInLeft animation for the news background */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Make sure we have the fadeIn animation for news titles */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Add the floatUp animation for news cards */
@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add pulse animation for the scroll down icon */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Add slide up animation for the hero background */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Add wipe reveal animation for section titles */
@keyframes wipeReveal {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    100% {
        transform: scaleX(1);
        transform-origin: left;
    }
}

/* Add zoom out animation */
@keyframes zoomOut {
    from {
        transform: scale(1.1);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fly up animation for the company intro section */
.fly-up-animation {
    overflow: hidden;
}

.fly-up-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fly-up-element.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Slide down animation for cards */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide up animation for cards */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* General fade-in animation class */
.animate-fadeIn {
    animation: fadeIn 1s ease forwards;
}

/* Staggered animation delays */
.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

.delay-5 {
    animation-delay: 1s;
} 
