/* Flashcards Section */
.flashcards-section {
    max-width: 1400px;
    margin: 2rem auto;
    text-align: center;
    padding: 0 1rem;
}

.flashcards-section h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: #000;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    margin: auto;
}

/* Flashcard Wrapper */
.flashcard-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
    gap: 1rem;
}

/* Individual Flashcard */
.flashcard {
    flex: 0 0 calc(100% / 6 - 1rem); /* 6 per row on large screens */
    width: 400px;
    height: 200px;
    background-color: transparent;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

/* Flashcard Inner Container */
.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* Flip Animation */
.flashcard:hover .flashcard-inner {
    transform: rotateY(180deg);
}

/* Front and Back of Flashcard */
.front,
.back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-radius: 15px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.front {
    background-color: #007bff;
    color: white;
    z-index: 2;
}

.back {
    background-color: #ff6347;
    color: white;
    transform: rotateY(180deg);
}

/* Carousel Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 40px;
    z-index: 10;
}

.carousel-btn.left-btn {
    left: 10px;
}

.carousel-btn.right-btn {
    right: 10px;
}

/* Dot Indicators */
.dot-indicators {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: #cccccc;
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background-color: #1e90ff;
}

/* Responsive Flashcard Layout */
@media screen and (max-width: 1200px) {
    .flashcard {
        flex: 0 0 calc(100% / 4 - 1rem); /* 4 per row on large tablets */
    }
}

@media screen and (max-width: 992px) {
    .flashcard {
        flex: 0 0 calc(100% / 3 - 1rem); /* 3 per row on small tablets */
    }
}

@media screen and (max-width: 768px) {
    .flashcard {
        flex: 0 0 calc(100% / 2 - 1rem); /* 2 per row on landscape phones */
        height: 180px;
    }
    
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
        line-height: 32px;
    }
}

@media screen and (max-width: 480px) {
    .flashcard {
        flex: 0 0 calc(100% - 1rem); /* 1 per row on mobile */
        height: 160px;
        width: 100%;
    }
    
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        line-height: 28px;
    }
    
    .dot {
        width: 8px;
        height: 8px;
    }
}
