.flip-box {
    perspective: 1000px;
    height: 300px;
    position: relative;
    cursor: pointer;
}
.flip-box-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flip-box:hover .flip-box-inner,
.flip-box.active .flip-box-inner {
    transform: rotateY(180deg);
}
.flip-box-front, .flip-box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.flip-box-front {
    display: flex;
    flex-direction: column;
}
.flip-box-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-grow: 1;
}
.flip-box-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    color: white;
    padding: 15px;
    margin: 0;
    font-size: 1.2rem;
}
.flip-box-back {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transform: rotateY(180deg);
    text-align: center;
}
@media (max-width: 767.98px) {
    .flip-box {
        height: auto;
    }
    .flip-box-title {
        font-size: 1rem;
        padding: 10px;
    }
}