#projects {
    position: relative;
    overflow: hidden;
}
#projects h1{
    text-align: center;
    font-size: 3rem;
    color: #7e57c2;
}


.card-container{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 100px;
}
.card{
    width: 25rem;
    background-color: #001427;
    color: #708D81;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0px 2px 4px rgba(0,0,0,0.2);
    margin: 4em;
    z-index: 1;
}
.card img{
    width: 100%;
    height: auto;
}
.card-content{
    padding: 1rem;
}
.card-content h3{
    font-size: 23px;
    margin-bottom: 20px;
}
.card-content p{
    color: #F4FFF8;
    font-size: 12px;
    line-height: 1.3;
}
.card-content .card-btn{
    display: inline-block;
    padding: 8px 16px;
    background-color: #7e57c2;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 16px;
    color: #fff;
}
.card-content .card-btn:hover {
  background-color: #9575cd;
  color: #0c0c0c;
}


.carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}
.carousel-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    transform: translateX(100%);
    z-index: 1;
}
.carousel-img.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}
.carousel-img.slide-out-left {
    opacity: 0;
    transform: translateX(-100%);
    z-index: 1;
}
.carousel-img.slide-in-right {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    font-size: 1.5em;
    padding: 0.2em 0.6em;
    cursor: pointer;
    z-index: 2;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel:hover .carousel-btn {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 480px) {
    .card {
        width: 90%;
        margin: 1rem 0;
    }
    .card-container {
        flex-direction: column;
        align-items: center;
        margin-top: 50px;
    }
    .card img {
        height: 120px;
    }
    .card-content {
        padding: 0.8rem;
    }
    .card-content h3 {
        font-size: 18px;
    }
}