/* Common Animations */
@-webkit-keyframes fadeInUp {
    0% {
      -webkit-transform: translateY(50px);
              transform: translateY(50px);
      opacity: 0;
    }
    100% {
      -webkit-transform: translateY(0);
              transform: translateY(0);
      opacity: 1;
    }
}
@keyframes fadeInUp {
    0% {
      -webkit-transform: translateY(50px);
              transform: translateY(50px);
      opacity: 0;
    }
    100% {
      -webkit-transform: translateY(0);
              transform: translateY(0);
      opacity: 1;   
    }
}
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes cardRiseUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes rotateOrbit {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulseScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes particleFloat {
    0% { transform: translate(0, 0); }
    50% { transform: translate(5px, -5px); }
    100% { transform: translate(0, 0); }
}

/* Common Classes */
.fade-in {
    animation: fadeIn 1s ease-in;
}

/* Navbar Styles */
.navbar {
    animation: slideDown 0.5s ease;
}

.nav-link {
    position: relative;
    color: #0F172A;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #1AA371;
    transition: all 0.3s ease-in-out;
}

.nav-link:hover {
    color: #1AA371 !important;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

.nav-right a {
    display: flex;
    padding: 12px 20px;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: #1AA371;
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.3s ease-in-out, background 0.3s ease-in-out;
}

.nav-right a:hover {
    background: #158a5f;
    transform: translateY(-2px);
}

/* Hero Section */
.hero{
    animation: fadeInUp 1s ease-out forwards;
}

/* Mission Section */
.section-title {
    animation: fadeInTitle 1.5s ease-out forwards;
    animation-delay: 0.3s;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

/* Expertise Section */
.expertise-content {
    opacity: 0;
    animation: slideInFromLeft 1s ease-out forwards;
}

.expertise-image {
    opacity: 0;
    animation: slideInFromRight 1s ease-out forwards;
}

.expertise-image img {
    animation: floatUpDown 3s ease-in-out infinite;
}

/* Advantage Cards */
.advantage-card {
    opacity: 0;
    animation: cardRiseUp 0.8s ease-out forwards;
    transition: all 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-10px);
}

.advantage-card.height-1 { animation-delay: 0.2s; }
.advantage-card.height-2 { animation-delay: 0.4s; }
.advantage-card.height-3 { animation-delay: 0.6s; }

/* Diagram Items */
.diagram-item {
    opacity: 0;
    animation: cardAppear 0.8s ease-out forwards;
}

.diagram-item:nth-child(1) { animation-delay: 0.2s; }
.diagram-item:nth-child(2) { animation-delay: 0.4s; }
.diagram-item:nth-child(3) { animation-delay: 0.6s; }
.diagram-item:nth-child(4) { animation-delay: 0.8s; }

/* Orbital Elements */
.orbital-circles {
    animation: rotateOrbit 20s linear infinite;
}

.orbital-dot {
    animation: pulseScale 2s ease-in-out infinite;
}

/* Particles */
.particle {
    animation: particleFloat 3s ease-in-out infinite;
}

.particle-1 { animation-delay: 0s; }
.particle-2 { animation-delay: 0.5s; }
.particle-3 { animation-delay: 1s; }
.particle-4 { animation-delay: 1.5s; }

@media (max-width: 991px) {
    .transition-diagram {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .diagram-item {
        position: static !important;
        width: 100%;
        margin: 0 auto;
    }

    .collaborative-advantage {
        flex-direction: column;
    }
    
    .advantage-card {
        margin-left: 0 !important;
        max-width: 100%;
    }

    .hero-title { font-size: 2rem; }
    .hero-description li { font-size: 0.95rem; }
}

@media (max-width: 576px) {
    .diagram-item {
        max-width: 95%;
    }

    .advantage-card img {
        width: 60px;
        height: 60px;
    }
}

/* Utility Classes */
.card h3, .card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 992px) {
    .diagram-item .card:hover {
        transform: scale(1.05);
        box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.15);
    }
}

/* Animation cho diagram items */
@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.diagram-item {
    opacity: 0;
    animation: cardAppear 0.8s ease-out forwards;
}

.diagram-item:nth-child(1) {
    animation-delay: 0.2s;
}

.diagram-item:nth-child(2) {
    animation-delay: 0.4s;
}

.diagram-item:nth-child(3) {
    animation-delay: 0.6s;
}

.diagram-item:nth-child(4) {
    animation-delay: 0.8s;
}

/* Animation cho orbital circles */
@keyframes rotateOrbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes pulseScale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.orbital-circles {
    animation: rotateOrbit 20s linear infinite;
}

.orbital-dot {
    animation: pulseScale 2s ease-in-out infinite;
}

/* Animation cho particles */
@keyframes particleFloat {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(5px, -5px);
    }
    100% {
        transform: translate(0, 0);
    }
}

.particle {
    animation: particleFloat 3s ease-in-out infinite;
}

.particle-1 {
    animation-delay: 0s;
}

.particle-2 {
    animation-delay: 0.5s;
}

.particle-3 {
    animation-delay: 1s;
}

.particle-4 {
    animation-delay: 1.5s;
}

/* Hover effects */
.advantage-card:hover {
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Scroll reveal animation */
@keyframes revealOnScroll {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991px) {
    .transition-diagram {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .diagram-item {
        position: static !important;
        width: 100%;
        margin: 0 auto;
    }

    .diagram-item .card {
        width: 100%;
    }

    /* Căn chỉnh nội dung */
    .card-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .card-icon {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .card h3 {
        font-size: 20px;
        line-height: 1.4;
        margin: 0;
    }

    .card p {
        font-size: 16px;
        line-height: 1.5;
        margin: 0;
    }
}
/* Thêm transition mượt mà */
.diagram-item .card {
    transition: all 0.3s ease-in-out;
}

/* Hover effect */
@media (min-width: 992px) {
    .diagram-item .card:hover {
        transform: scale(1.05);
        box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.15);
    }
}

/* Đảm bảo text không bị overflow */
.card h3, .card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 991px) {
    .collaborative-advantage {
        flex-direction: column;
    }
    
    .advantage-card {
        margin-left: 0 !important; /* Reset margins */
        max-width: 100%;
    }
}
/* Responsive cho ảnh trên mobile */
@media (max-width: 576px) {
    .advantage-card img {
        width: 60px;  /* Giảm kích thước trên mobile nếu cần */
        height: 60px;
    }
}
/* Add this JavaScript to enable scroll animations */