/* Flashcard container */ 
.flashcards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Individual flashcard */
.flashcard {
    perspective: 1000px;
    height: 300px;
    overflow: hidden; /* Ensure nothing overflows */
}

/* Flashcard inner container with vendor prefixes */
.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Flip effect */
.flashcard.flipped .flashcard-inner {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

/* Front and back faces */
.flashcard-front,
.flashcard-back {
    position: absolute !important;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Flashcard front styling */
.flashcard-front {
    background: #f8f8f8;
    border: 2px solid #2c3e50;
    color: #2c3e50;
    direction: rtl;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Center the Arabic word */
.flashcard-front .word-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
}

/* Arabic word styling */
.flashcard-front .word {
    font-size: 4em !important;
    margin: 0;
    word-wrap: break-word;
}

/* Click message styling (modified) */
.flashcard-front .click-message {
    position: absolute;
    left: 0;       /* Force full-width spanning */
    right: 0;
    bottom: 10px;
    font-size: 1em !important;
    text-align: center;
    word-wrap: break-word;
}

/* Level buttons container */
.levels-container {
    text-align: center;
    margin: 20px 0;
}

/* Level button styling */
.level-button {
    display: inline-block;
    background-color: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    margin: 5px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.level-button:hover {
    background-color: #34495e;
}

/* Flashcard back styling */
.flashcard-back {
    background: #2c3e50;
    color: white;
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    transform: rotateY(180deg);
    text-align: center;
    overflow: hidden;
}

/* Translation styling on back */
.flashcard-back .translation {
    display: block;
    font-size: 1.4em !important;
    margin-bottom: 1em !important;
    word-wrap: break-word;
}

/* Example Arabic usage styling */
.flashcard-back .example .example-arabic {
    font-size: 1.1em !important;
    margin-bottom: 0.5em !important;
    word-wrap: break-word;
}

/* Example translation styling */
.flashcard-back .example .example-translation {
    font-size: 0.9em !important;
    word-wrap: break-word;
}

/* Responsive design for devices up to 768px */
@media (max-width: 768px) {
    .flashcards-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .level-button {
        padding: 8px 16px;
        margin: 3px;
    }
}

/* Additional responsive adjustments for very small screens */
@media (max-width: 480px) {
    .flashcard {
        height: 220px; /* reduce height for smaller screens */
    }
    .flashcard-front .word {
        font-size: 4em !important; /* reduce word size */
    }
    .flashcard-front .click-message {
        font-size: 0.9em !important; /* reduce click message size */
        bottom: 5px;
    }
    .flashcard-back .translation {
        font-size: 1.2em !important;
    }
    .flashcard-back .example .example-arabic {
        font-size: 1.5em !important;
    }
    .flashcard-back .example .example-translation {
        font-size: 0.8em !important;
    }
    .flashcards-container {
        padding: 10px;
    }
}

/* --- MCQ Test Styles --- */
.mcq-question {
    background-color: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.mcq-question-text {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #333;
}

.mcq-option {
    display: block;
    margin: 5px 0;
    font-size: 1em;
    color: #555;
    cursor: pointer;
}

.mcq-option input[type="radio"] {
    margin-right: 10px;
}

.mcq-separator {
    border: none;
    border-bottom: 1px solid #ccc;
    margin: 20px 0;
}

/* Style for the submit button in MCQ forms */
.mcq-form input[type="submit"],
input[type="submit"] {
    background-color: #2c3e50;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
}

.mcq-form input[type="submit"]:hover,
.level-button:hover {
    background-color: #34495e;
}

/* Ensure MCQ result headings are styled */
h2, h3 {
    color: #2c3e50;
}
