.projects {
    width: 70%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 999;
    padding-top: 10%;
}

.projects-header {
    font-size: 6vw;
    color: white !important;
    margin-right: 2%;
    display: block;
}

.animation-header {
    display: inline-block;
    opacity: 0;
    transform: translateY(-1vw);
    transition: opacity 0.5s ease, transform 0.5s ease;

}

.animation-header.animated {
    transform: translateY(0);
    opacity: 1;
}


.projects-content {
    width: 100%;
    text-align: justify;
    margin-top: 2%;
    margin-bottom: 2%;
    color: white !important;
    font-size: 1vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    transform-style: preserve-3d;
}

.earth {
    position: relative;
    width: 25vw;
    height: 25vw;
    max-width: 18vw;
    max-height: 18vw;
    background: url("../assets/earth.png");
    background-size: cover;
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 1), 0 0 30px #ed16fc;
    margin-top: -10%;
    background-size: 200%;
    background-position: 15% 0;
}

.earth-pin {
    position: absolute;
    width: 2.5rem !important;
    right: 40%;
    top: 40%;
    filter: drop-shadow(0 0 3px #ff0482);
    animation: jump 1s infinite ease-in-out;
    z-index: 1;
}

.earth-greetings {
    position: absolute;
    width: 40vw !important;
    right: 35%;
    bottom: 55%
}

.projects-decorative-bar {
    width: 28%;
    height: 2px;
    color: white;
    background: linear-gradient(to right, #7c4bfa, #ff4387);
    transform-origin: center;
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.projects-decorative-bar.animated {
    transform: none;
}

.projects-decorative-bar-div {
    position: absolute;
    bottom: -10%;
    left: 40%;
    width: 100%;
}


.projects-hint-span {
    width: 50%;
    opacity: 0;
    transform: translateY(-1vw);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.projects-hint-span.animated {
    transform: translateY(0);
    opacity: 1;
}

.globe-image {
    width: 50% !important;
    height: auto;
    margin-top: -10%;
}


.projects-carousel {
    overflow-x: hidden;   
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch;      
    width: 100%;
    padding: 2rem 0;
    position: relative;
    scroll-behavior: smooth;
    scrollbar-width: none;

}

.projects-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.carousel-track {
    display: flex;
    gap: 1rem;
    animation: scroll 25s linear infinite;
    width: max-content;
}

.carousel-item {
    position: relative;
    scroll-snap-align: start; /* Snap each slide to start */
    flex: 0 0 auto;
    width: 250px;
    height: 160px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    user-select: none;         
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Overlay that appears on hover */
.carousel-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.3s ease;
    transform: translate(-50%, -50%); /* 👈 centers it */
    border-radius: 8px; /* optional, looks cleaner */


}

.projects-carousel:hover .carousel-track {
    animation-play-state: paused;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

.carousel-item:hover .carousel-overlay {
    opacity: 1;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Duplicate content trick for seamless loop */
.carousel-track::after {
    content: "";
    display: block;
}



@keyframes jump {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@media (max-width: 970px) {
    .projects {
        width: 100%;
        margin-top: 10%;
        margin-left: auto;
        margin-right: auto;
        position: relative;
    }

    .projects-header {
        font-size: 12vw;
        color: white;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    .projects-content {
        width: 100%;
        text-align: justify;
        margin-top: 2%;
        margin-bottom: 2%;
        color: white;
        font-size: 3vw;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .projects-hint-span {
        width: 80%;
    }

    .globe-image {
        width: 50% !important;
        height: auto;
        margin-top: 5%;
    }

    .earth {
        margin-top: 5%;
        width: 50vw;
        height: 50vw;
        max-width: none;
        max-height: none;
    }

    .earth-pin {
        width: 5vw !important;
        height: auto !important;
    }

    .projects-decorative-flexbox {
        display: flex;
        justify-content: center;
    }
}