.flipcard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.flipcard {
    width: calc(33.333% - 14px);
    perspective: 1000px;
    margin-bottom: 20px;
    position: relative;
}

/* Hide the checkbox */
.flipcard input[type="checkbox"] {
    display: none;
}

.flipcard-inner {
    position: relative;
    width: 100%;
    height: 300px;
    /* Αυξάνουμε λίγο το ύψος */
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Flip when checkbox is checked */
.flipcard input[type="checkbox"]:checked~.flipcard-inner {
    transform: rotateY(180deg);
}

.flipcard-front,
.flipcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    /* Προσθέτουμε overflow scroll για την πίσω πλευρά */
    overflow-y: auto;
    /* Προσθέτουμε smooth scrolling */
    scroll-behavior: smooth;
}

.flipcard-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Για την μπροστινή πλευρά κρατάμε το overflow hidden */
    overflow: hidden;
}

.flipcard-front img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.flipcard-back {
    transform: rotateY(180deg);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Custom scrollbar για καλύτερη εμφάνιση */
.flipcard-back::-webkit-scrollbar {
    width: 6px;
}

.flipcard-back::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.flipcard-back::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.flipcard-back::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Εναλλακτική λύση: Αυτόματο ύψος */
.flipcard-auto-height .flipcard-inner {
    height: auto;
    min-height: 300px;
}

.flipcard-auto-height .flipcard-front,
.flipcard-auto-height .flipcard-back {
    height: auto;
    min-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flipcard {
        width: 100%;
    }

    .flipcard-inner {
        height: 350px;
        /* Περισσότερο ύψος σε κινητά */
    }
}