/* =================================
   DEDICATED FLIP FLASHCARDS CSS
   For Literature/Humanities subjects
   ================================= */

/* Header and filter styles */
.diopanta-flashcard-call {
    text-align: center;
    margin-top: 2em;
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: 2px solid #e2e8f0;
}

.diopanta-flashcard-call h2 { 
    color: #4299e1; 
    font-size: 1.8rem; 
    margin-bottom: 0.5em;
}

.diopanta-flashcard-call p { 
    color: #718096; 
    font-size: 1rem; 
    margin: 0;
}

.diopanta-flashcard-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    margin: 1em auto 2em auto;
    max-width: 800px;
}

.diopanta-flashcard-filter p {
    font-weight: 600;
    color: #4a5568;
    font-size: 1.1rem;
    margin: 0;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8em;
    justify-content: center;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 1em;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: rgba(66, 153, 225, 0.3);
    touch-action: manipulation;
}

.radio-option:hover {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.radio-option input[type="radio"] {
    margin: 0;
    accent-color: #4299e1;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2b6cb0;
}

.radio-option:has(input:checked) {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

/* Carousel container */
.diopanta-flashcard-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5em;
    padding: 1.5em;
    margin: 0 auto;
    max-width: 100%;
}

/* Individual flip card container */
.diopanta-flashcard {
    flex: 0 0 320px;
    height: 240px;
    perspective: 1000px;
    scroll-snap-align: center;
    display: none; /* Hidden by default */
}

.diopanta-flashcard.visible {
    display: block; /* Shown when filtering */
}

.diopanta-flashcard.fade-in {
    animation: fadeInFlip 0.3s ease-out;
}

@keyframes fadeInFlip {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* The flip mechanism */
.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard-inner.flipped {
    transform: rotateY(180deg);
}

/* Front and back faces */
.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid #007BFF;
    border-radius: 12px;
    padding: 1.5em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.flashcard-front {
    background: linear-gradient(135deg, #f9fafe 0%, #ebf8ff 100%);
    color: #2d3748;
}

.flashcard-back {
    background: linear-gradient(135deg, #e8f4fd 0%, #bee3f8 100%);
    color: #2d3748;
    transform: rotateY(180deg);
}

/* Typography inside cards */
.flashcard-face strong {
    color: #007BFF;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 1em;
    display: block;
    text-align: center;
}

.flashcard-face p {
    margin: 0.8em 0;
    line-height: 1.5;
    text-align: center;
    font-size: 0.95em;
}

.flashcard-back small {
    color: #4a5568;
    font-size: 0.8em;
    font-style: italic;
    margin-bottom: 0.8em;
    display: block;
}

/* Hover effects */
.flashcard-inner:hover {
    transform: scale(1.02);
}

.flashcard-inner.flipped:hover {
    transform: rotateY(180deg) scale(1.02);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .radio-option {
        width: 90%;
        max-width: 350px;
        justify-content: flex-start;
    }
    
    .diopanta-flashcard {
        flex: 0 0 90vw;
        max-width: 300px;
        height: 220px;
    }
    
    .flashcard-face {
        padding: 1.2em;
        font-size: 0.9em;
    }
    
    .flashcard-inner:hover {
        transform: none; /* Disable hover scaling on mobile */
    }
    
    .flashcard-inner.flipped:hover {
        transform: rotateY(180deg);
    }
}