<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flashcard System with Pagination and Review Tracking</title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        /* General Styles */
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
            overflow-x: hidden;
        }
        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            padding: 20px;
            box-sizing: border-box;
        }
        .app-header {
            width: auto;
            background-color: #6200ea;
            padding: 15px 20px;
            box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
            color: white;
            font-size: 24px;
            font-weight: 500;
            text-align: center;
        }
        .log-container {
            margin-top: 20px;
            width: 100%;
            max-width: 600px;
            background-color: #ffffff;
            border-radius: 8px;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
            padding: 15px;
            overflow-y: auto;
            max-height: 200px;
        }
        .log {
            font-size: 14px;
            color: #333;
            line-height: 1.5;
        }
    </style>

    <style>
/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}



.date-changer {
    margin-bottom: 20px;
    font-size: 16px;
}

.topic-filter, #layout-select {
    width: 100%;
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #ffffff;
    color: #333;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    appearance: none;
    cursor: pointer;
    text-align: left;
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.filter-btn, .show-all-btn, .apply-btn {
    background-color: #6200ea;
    color: #fff;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.15);
}

.filter-btn:hover, .apply-btn:hover {
    background-color: #3700b3;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* Show All Button Distinct Style */
.show-all-btn {
    background-color: #03dac6;
    color: #fff;
}

.show-all-btn:hover {
    background-color: #018786;
}

.badge {
    background-color: #fff;
    color: #6200ea;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.modern-card {
    position: relative;
    background-color: white;
    border-radius: 15px;
    width: 100%; /* Use full width */
    max-width: 800px; /* Full width to avoid scrolling in vertical layout */
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s;
    border: 2px solid #ddd;
    box-sizing: border-box; /* Ensure padding is contained within the card */
}

.question {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    padding-right: 30px; /* Space for the bookmark */
}

.answer {
    font-size: 18px;
    color: #333;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: none;
}

.buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.dont-know-btn, .know-btn {
    padding: 10px 20px;
    width: auto;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
}

.dont-know-btn {
    background-color: #e53935;
}

.know-btn {
    background-color: #388e3c;
}

/* Hover effect for dont-know-btn */
.dont-know-btn:hover {
    background-color: #d32f2f; /* Darker shade of red */
}

/* Hover effect for know-btn */
.know-btn:hover {
    background-color: #2e7d32; /* Darker shade of green */
}


.bookmark {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px;
    color: #ddd;
    cursor: default;
    transition: color 0.3s;
}

.review-metric {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    margin-top: 15px;
}

.filter-info {
    background-color: #e3f2fd;
    color: #1e88e5;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    width: 95%;
    max-width: 600px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.topic-header {
    font-size: 24px;
    font-weight: 700;
    color: #6200ea;
    margin: 20px 0 10px;
    text-align: center;
    width: 100%;
}






/* Hide extra elements in horizontal layout */
.horizontal-layout .modern-card {
    display: none; /* Only the current flashcard will be displayed in the horizontal layout */
}

.horizontal-layout .navigation-buttons {
    display: flex; /* Show navigation buttons in horizontal layout */
}

.horizontal-layout .flashcard-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110%; /* Use full width */
    max-width: none; /* Adjust max-width if needed for screen fit */
    padding: 0 20px;
    box-sizing: border-box;
}

.horizontal-layout .modern-card {
    width: 110%; /* Stretch to fill container */
    max-width: 800px; /* Optional: adjust for full screen width */
}

/* Horizontal layout info box styling */
#horizontal-info {
    display: none; /* Only visible in horizontal layout */
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', sans-serif;
}

#horizontal-topic {
    font-size: 20px;
    font-weight: 700;
    color: #6200ea;
    margin-bottom: 5px;
}

#horizontal-position {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}


 .navigation-buttons {
    display: flex;
    justify-content: center; /* Center buttons on smaller screens */
        gap: 30px;
    width: 100%;
    max-width: 800px; /* Adjust as needed */
    margin: 20px auto;
    padding: 10px 20px;
    box-sizing: border-box;
    margin-bottom: 40px;
}

.navigation-buttons button {
    background-color: #6200ea; /* Primary color */
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.15);
}

.navigation-buttons button:disabled {
    background-color: #9e9e9e; /* Gray color when disabled */
    cursor: not-allowed;
    box-shadow: none;
}

.navigation-buttons button:hover:not(:disabled) {
    background-color: #3700b3; /* Darker color on hover */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}


/* Dropdown container styling */
.dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: #ffffff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
    width: 600px;
    z-index: 1000;
}

.dropdown-content {
    color: #333;
    font-size: 16px;
}

.close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}



  /* Ensure flashcards-container stretches fully in vertical layout */
.vertical-layout .flashcard-container {
    width: 100%; /* Use full width in vertical layout */
    max-width: none; /* Remove max-width constraint */
    padding: 0; /* Optional: remove padding if added */
    box-sizing: border-box;
    margin: 0 auto; /* Center align in the container */
}

/* Ensure container and flashcards align correctly in all layouts */
.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Add this class to body or main container when in vertical layout mode */
.vertical-layout .container {
    width: 100%; /* Ensure container width is full */
}



    #toggleButton {
        background-color: #4CAF50; /* Green background */
        border: none;
        color: white; /* White text color */
        padding: 12px 24px; /* Padding for better spacing */
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px; /* Font size */
        cursor: pointer; /* Pointer cursor on hover */
        border-radius: 8px; /* Rounded corners */
        transition: background-color 0.3s ease; /* Smooth transition on hover */
    }

    #toggleButton:hover {
        background-color: #45a049; /* Darker green on hover */
    }

    #toggleButton:focus {
        outline: none; /* Remove outline on focus */
    }

    #toggleButton:active {
        background-color: #388e3c; /* Even darker green when button is clicked */
    }


    .star-btn {
    color: lightgray;
    font-size: 20px;
    margin: 0 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.star-btn.active {
    color: gold;
}

.bookmark {
    cursor: pointer;
    margin-left: auto;
}

/* Emoji styling */
        .emoji {
            font-size: 24px;  /* Larger font size */
            vertical-align: middle;
            display: inline-block;
            animation: slow-bounce 2s infinite;  /* Animation applied */
        }

        /* Slow bounce animation */
        @keyframes slow-bounce {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-5px); /* Small bounce */
            }
        }




    </style>

    <style>
      .header-image, .hr-image {
            width: 50px;
            height: 50px;
            cursor: pointer;
            vertical-align: middle;
            margin-right: 10px;
        }

         /* Modal Styles */
        .modal97 {
            display: none;
            position: fixed;
            z-index: 10;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.9);
        }

        .modal-top-bar97 {
            width: 80%;
            max-width: 700px;
            margin: auto;
            padding: 10px;
            display: flex;
            justify-content: flex-end;
            border-bottom: 5px solid #007bff;
            background-color: rgba(255, 255, 255, 0.8);
            z-index: 20;
            position: relative;
        }

        .modal-controls97 {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        .close97 {
            color: #333;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            margin-bottom: 5px;
        }

        .zoom-buttons97 {
            display: flex;
            gap: 5px;
        }

        .zoom-button97 {
            background-color: #007bff;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
        }

        .zoom-button97:hover {
            background-color: #0056b3;
        }

        .modal-content-wrapper97 {
            position: relative;
            width: 80%;
            max-width: 700px;
            margin: auto;
        }

        .modal-content97 {
            display: block;
            width: 100%;
            height: auto;
            margin: auto;
        }

         .header-image, .hr-image {
            width: 50px;
            height: 50px;
            cursor: pointer;
            vertical-align: middle;
            margin-right: 10px;
        }

        .popup {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
        }

        .popup-content {
            position: relative;
            margin: 10% auto;
            width: 80%;
            max-width: 600px;
            background-color: #fff;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
        }

        .popup-image {
            width: 100%;
            height: auto;
        }

        .close {
            position: absolute;
            top: 1px;
            right: 8px;
            color: #333;
            font-size: 24px;
            font-weight: bold;
            cursor: pointer;
        }

</style>
</head>
<body>

<!-- App Header -->
<div class="app-header">
    <img src="https://firebasestorage.googleapis.com/v0/b/akrass-plus.appspot.com/o/ContentImage%2Fkmc_20240901_152317.png?alt=media&token=74a10ca6-8504-49c3-9580-d2122f1eeba5" alt="Header Image" class="header-image" onclick="openModal('header-popup-97')" />
    MBBS Flashcards Study
</div>

<hr>
<p style="margin-left: 20px;"><b>Subject</b>: ANATOMY</p>
<p style="margin-left: 20px;"><b>Chapter</b>: 3. LOWER LIMB</p>
<p style="margin-left: 20px;"><b>BOOK Reference</b>: All 3 coaching institute Notes , <img src="https://firebasestorage.googleapis.com/v0/b/akrass-plus.appspot.com/o/ContentImage%2FIMG_20241226_130132_759.jpg?alt=media&token=3a1239cf-8495-41d9-b2f5-e90c60f659ac" alt="HR Image" class="hr-image" onclick="openModal('hr-popup-97')" />👈                                                                                                              </p>
<p style="margin-left: 20px;"><b>Total Flashcards</b>: 398</p>
<hr>


    <!-- Modal Pop-Up for Header Image -->
    <div id="header-popup-97" class="modal97">
        <div class="modal-top-bar97">
            <div class="modal-controls97">
                <span class="close97" onclick="closeModal('header-popup-97')">Close</span>
                 <div class="zoom-buttons97">
                    <button class="zoom-button97" onclick="zoomImage('header-popup-97', 0.9)">zoom -</button>
                    <button class="zoom-button97" onclick="zoomImage('header-popup-97', 1.1)">+</button>
                </div>
             </div>
        </div>
      <div class="modal-content-wrapper97">
             <img class="modal-content97" src="https://firebasestorage.googleapis.com/v0/b/akrass-plus.appspot.com/o/ContentImage%2Fkmc_20240901_152317.png?alt=media&token=74a10ca6-8504-49c3-9580-d2122f1eeba5" alt="Header Image Full View" class="popup-image" />
         </div>
    </div>

    <!-- Modal Pop-Up for HR Image -->
    <div id="hr-popup-97" class="modal97">
         <div class="modal-top-bar97">
             <div class="modal-controls97">
               <span class="close97" onclick="closeModal('hr-popup-97')">Close</span>
                <div class="zoom-buttons97">
                 <button class="zoom-button97" onclick="zoomImage('hr-popup-97', 0.9)">zoom -</button>
                    <button class="zoom-button97" onclick="zoomImage('hr-popup-97', 1.1)">+</button>
                 </div>
            </div>
         </div>
      <div class="modal-content-wrapper97">
            <img class="modal-content97" src="
https://firebasestorage.googleapis.com/v0/b/akrass-plus.appspot.com/o/ContentImage%2FIMG_20241226_130132_759.jpg?alt=media&token=3a1239cf-8495-41d9-b2f5-e90c60f659ac" alt="HR Image Full View" class="popup-image" />
       </div>
   </div>


<!-- Main Container -->
<div class="container">

<button id="toggleButton" onclick="toggleDropdownContent(event)">How to Use the Flashcard System (Step-by-Step - Click Here👈)</button>

<div id="dropdownContent" class="dropdown" style="display: none;">
    <div class="dropdown-content">
        <button class="close" onclick="closeDropdown('dropdownContent')">Close</button>
        <br><h2>How to Use the Flashcard System</h2>

        <ol>
            <li><strong>Select Layout:</strong>
                <ul>
                    <li>Choose how you want to view flashcards:</li>
                    <li><strong>Horizontal Layout:</strong> One flashcard displayed at a time.</li>
                    <li><strong>Vertical Layout (Default):</strong> Flashcards shown one below another.</li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #007BFF;">

            <li><strong>Select Topics:</strong>
                <ul>
                    <li>Pick multiple topics you want to study.</li>
                    <li>At the end of each topic, you’ll see:
                        <ul>
                            <li>Total flashcards in that topic.</li>
                            <li>Flashcards you’ve reviewed at least once (e.g., <strong>(2/6)</strong> means 2 out of 6 reviewed).</li>
                        </ul>
                    </li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #28A745;">

            <li><strong>Apply Filter:</strong>
                <ul>
                    <li>Click <strong>Apply Filter</strong> to display selected topics.</li>
                    <li>All Flashcards of selected topics will appear in your chosen layout (horizontal or vertical).</li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #DC3545;">

            <li><strong>Review Flashcards:</strong>
                <ul>
                    <li>View the flashcard to read the question and try to recall the answer.</li>
        <li>After attempting to recall, use the buttons:</li>
                    <li>Use the buttons:
                        <ul>
                            <li><strong>Know:</strong> If you know the answer.</li>
                            <li><strong>Don’t Know:</strong> If unsure or don’t know the answer.</li>
                            <li>If you initially clicked "Know" but later feel unsure, click "Don’t Know" to adjust your response.</li>
                        </ul>
                    </li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #FFC107;">

            <li><strong>Review Stages:</strong>
                <ul>
                    <li>Each reviewed flashcard shows the next review date.</li>
                    <li>Review stages based on time intervals:
                        <ul>
                            <li><strong>First Review:</strong> 3 days after the first read.</li>
                            <li><strong>Second Review:</strong> 7 days after the first review.</li>
                            <li><strong>Third Review:</strong> 14 days after the second review.</li>
                            <li><strong>Final Review:</strong> 28 days after the third review.</li>
                            <li><strong>Completed:</strong> No further reviews needed.</li>
                        </ul>
                    </li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #17A2B8;">

            <li><strong>Pending Review Flashcards:</strong>
                <ul>
                    <li>Flashcards ready for review are shown in the <strong>Pending Review</strong> section.</li>
                    <li>Pending cards only show from selected topics.</li>
                    <li>To view all pending flashcards from all topics, select and apply <strong>"All Topics"</strong> in the topic section (by default, "All Topics" is applied).</li>
                    <li>When you are inside the Pending Flashcards Review section, to exit this section, click the <strong>"Show All Flashcards"</strong> button. It displays all flashcards (including pending flashcards) from the selected topics.</li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #6C757D;">

            <li><strong>Bookmark Colors:</strong>
                <ul>
                    <li>Flashcard review stages are visually represented:</li>
                    <li><strong>Red:</strong> First Review.</li>
                    <li><strong>Pink:</strong> Second Review.</li>
                    <li><strong>Blue:</strong> Third Review.</li>
                    <li><strong>Green:</strong> Final Review.</li>
                    <li><strong>Gold:</strong> Completed.</li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #343A40;">

             <li><strong>Star Mark Flashcards:</strong>
                <ul>
                    <li>Mark very important or difficult flashcards using the <strong>Star Mark</strong> button.</li>
                    <li>These star-marked flashcards are ideal for focused review before exams.</li>
                    <li>Click the <strong>Starred Flashcards</strong> button to filter and view only the star-marked flashcards from the selected topics.</li>
                    <li>When you click <strong>Starred Ready for Review</strong>, it displays all star-marked flashcards that are ready for review, including those in any review stage (First, Second, Third, or Final).</li>
                    <li>This feature ensures you spend your time efficiently by focusing on critical flashcards when time is limited.</li>
                </ul>
            </li>
            <br>
            <hr style="border: 1px solid #007BFF;">

            <li><strong>Efficient Learning:</strong>
                <ul>
                    <li>The system ensures:</li>
                    <li><strong>Easy Points Flashcards:</strong> Reviewed in fewer rounds.</li>
                    <li><strong>Moderate/Difficult Points:</strong> Reviewed more frequently in more number of rounds.</li>
                    <li>Saves your time by allocating appropriate focus on difficult flashcards.</li>
                    <li>You can utilize your time efficiently and complete your syllabus within your time schedule.</li>
                </ul>
            </li>


        </ol>
    </div>
</div>

 <br>




     <!-- Dropdown for Layout Selection -->
    <div class="custom-select-container">
        <label for="layout-select"><b>Select Layout:</b></label>
        <select id="layout-select" class="custom-select" onchange="selectLayout(this.value)">
            <option value="vertical">Vertical Layout</option>
            <option value="horizontal">Horizontal Layout</option>
        </select>
    </div>

    <!-- Topic Selection Multi-select -->
    <div class="custom-select-container">
        <label for="topic-filter"><b>Select Multiple Topics & Apply Filter:</b></label>
        <select id="topic-filter" class="topic-filter" multiple>
            <!-- Options will be dynamically populated -->
        </select>
    </div>

    <!-- Apply Filter and Show All Buttons -->
    <button class="apply-btn" onclick="applySelectedTopics()">Apply Selected Topics</button><br>
    <button class="show-all-btn" onclick="showAllFlashcards()">Show All Flashcards</button>

     <div class="filter-container">
        <button class="filter-btn" onclick="filterFlashcards(0)">First Review<br> (Red) <span id="count-stage-0" class="badge">0</span></button>
        <button class="filter-btn" onclick="filterFlashcards(1)">Second Review<br> (Pink) <span id="count-stage-1" class="badge">0</span></button>
        <button class="filter-btn" onclick="filterFlashcards(2)">Third Review<br> (Blue) <span id="count-stage-2" class="badge">0</span></button>
        <button class="filter-btn" onclick="filterFlashcards(3)">Final Review<br> (Green) <span id="count-stage-3" class="badge">0</span></button>
        <button class="filter-btn" id="completed-flashcards-btn" onclick="filterFlashcards(4)">Completed Flashcards<br> 🏆 <span id="count-completed" class="badge">0 completed</span></button>
     </div>
 <div class="filter-container">
    <button class="filter-btn" onclick="showStarredFlashcards()">⭐ Starred Flashcards: <span id="count-starred" class="badge">0 Marked</span>, <span id="count-pending" class="badge">0 Pending</span></button>
    <button class="filter-btn" onclick="showStarredReadyFlashcards()">🌟 Starred Ready Review: <span id="count-starred-ready" class="badge">0 Marked</span>, <span id="count-ready-pending" class="badge">0 Pending</span></button>
</div>


    <div id="filter-info-container"></div> <!-- Filter info container for separate line display -->

<div id="horizontal-info" style="display: none;">
    <div id="horizontal-topic"></div>
    <div id="horizontal-position"></div>
</div>



    <!-- Flashcard Display Area -->
    <div id="flashcards-container" class="flashcard-container">
        <!-- Flashcards will be rendered here dynamically -->
    </div>

    <!-- Navigation for Horizontal Layout -->
    <div class="navigation-buttons" style="display: none;">
        <button id="prev-btn" onclick="navigateFlashcards('prev')" disabled>Previous</button>
        <button id="next-btn" onclick="navigateFlashcards('next')">Next</button>
    </div>
</div>




<!-- Dropdown content that replaces the modal -->
<div id="bookmarkDropdown1" class="dropdown">
    <div class="dropdown-content">
        <!-- Close button -->
        <span class="close" onclick="closeDropdown('bookmarkDropdown1')">×</span>
        <h2>Review Stage Colors</h2>
        <ul>
            <li><span style="color: red;"><i class="fas fa-bookmark"></i></span> First Review</li>
            <li><span style="color: pink;"><i class="fas fa-bookmark"></i></span> Second Review</li>
            <li><span style="color: blue;"><i class="fas fa-bookmark"></i></span> Third Review</li>
            <li><span style="color: green;"><i class="fas fa-bookmark"></i></span> Final Review</li>
            <li><span style="color: gold;"><i class="fas fa-bookmark"></i></span> Completed</li>
        </ul>
    </div>
</div>



<!-- Dropdown for Inactive Know Button Click -->
<div id="inactiveKnowDropdown" class="dropdown">
    <div class="dropdown-content">
        <span class="close" onclick="closeDropdown('inactiveKnowDropdown')">&times;</span>
        <h2>Button Inactive</h2>
        <p>The "Know" button is inactive until the review is ready. Please wait until the next review date.</p>
    </div>
</div>


<script>

 document.addEventListener('DOMContentLoaded', () => {
    openDatabase();
    const layoutSelect = document.getElementById('layout-select');
    const initialLayout = layoutSelect.value || 'vertical';
    selectLayout(initialLayout);
});

const dbName = "FlashcardDB1NPG3";
const storeName = "flashcardProgress";

const flashcards = [
    {
        "id": 1,
        "topic": "topic1",
        "question": "What are the principal nerves of the lower limb?",
        "answer": "<li>The principal nerves of the lower limb are the Obturator Nerve, Femoral nerve, Sciatic Nerve, and their branches.</li>",
        "memoryTip": "Think of the lower limb nerves as a \"sciatic\" party where everyone is invited: Obturator, Femoral, and Sciatic!",
        "emoji": "🎉"
    },
    {
        "id": 2,
        "topic": "topic1",
        "question": "Where does the lumbar plexus lie?",
        "answer": "<li>The lumbar plexus lies in the posterior part of the psoas major, anterior to the lumbar transverse processes.</li>",
        "memoryTip": "The lumbar plexus is like a shy friend hiding behind the psoas major at a party!",
        "emoji": "🙈"
    },
    {
        "id": 3,
        "topic": "topic1",
        "question": "What spinal nerves form the lumbar plexus?",
        "answer": "<li>The lumbar plexus is formed by the anterior rami of spinal nerves L1 through L4 and some fibers from T12.</li>",
        "memoryTip": "Think of L1 to L4 as the \"lumbar squad\" with T12 as the honorary member!",
        "emoji": "🕺"
    },
    {
        "id": 4,
        "topic": "topic1",
        "question": "What type of rami communicantes do the lumbar plexus rami receive?",
        "answer": "<li>All these rami receive gray rami communicantes from the sympathetic trunks, and the superior two send white rami communicantes to these trunks.</li>",
        "memoryTip": "Gray rami are like the wise old sages, while white rami are the energetic youngsters!",
        "emoji": "🧙‍♂️"
    },
    {
        "id": 5,
        "topic": "topic2",
        "question": "What is the largest branch of the lumbar plexus?",
        "answer": "<li>The Femoral nerve is the largest branch of the lumbar plexus.</li>",
        "memoryTip": "The Femoral nerve is the \"big boss\" of the lumbar plexus!",
        "emoji": "👑"
    },
    {
        "id": 6,
        "topic": "topic2",
        "question": "From which division of the lumbar plexus does the Femoral nerve arise?",
        "answer": "<li>The Femoral nerve arises from the posterior division of the lumbar plexus.</li>",
        "memoryTip": "The Femoral nerve is a \"poster child\" for the posterior division!",
        "emoji": "📸"
    },
    {
        "id": 7,
        "topic": "topic2",
        "question": "What areas does the Femoral nerve provide cutaneous innervation to?",
        "answer": "<li>The Femoral nerve provides cutaneous innervation to the anterior and lateral thigh and the medial leg and foot.</li>",
        "memoryTip": "The Femoral nerve is like a friendly tour guide for your thigh and leg!",
        "emoji": "🗺️"
    },
    {
        "id": 8,
        "topic": "topic2",
        "question": "What muscles receive motor innervation from the Femoral nerve?",
        "answer": "<li>The Femoral nerve provides motor innervation to the anterior muscles of the thigh, including the iliopsoas, Sartorius, and the quadriceps femoris group.</li>",
        "memoryTip": "The Femoral nerve is the \"personal trainer\" for your thigh muscles!",
        "emoji": "💪"
    },
    {
        "id": 9,
        "topic": "topic3",
        "question": "From which division of the lumbar plexus does the Obturator nerve arise?",
        "answer": "<li>The Obturator nerve arises from the anterior division of the lumbar plexus.</li>",
        "memoryTip": "The Obturator nerve is the \"front runner\" of the anterior division!",
        "emoji": "🏃‍♂️"
    },
    {
        "id": 10,
        "topic": "topic3",
        "question": "What area does the Obturator nerve provide cutaneous innervation to?",
        "answer": "<li>The Obturator nerve provides cutaneous innervation to the medial thigh.</li>",
        "memoryTip": "The Obturator nerve is like a cozy blanket for your medial thigh!",
        "emoji": "🛌"
    },
    {
        "id": 11,
        "topic": "topic3",
        "question": "What muscles receive motor innervation from the Obturator nerve?",
        "answer": "<li>The Obturator nerve provides motor innervation to the adductor muscles of the thigh, including gracilis, Pectineus, and obturator externus.</li>",
        "memoryTip": "The Obturator nerve is the \"adductor coach\" for your thigh muscles!",
        "emoji": "🏋️‍♂️"
    },
    {
        "id": 12,
        "topic": "topic4",
        "question": "What does the lumbosacral trunk participate in?",
        "answer": "<li>The lumbosacral trunk participates in the formation of the sacral plexus along with the ventral rami of S1 through S4 nerves.</li>",
        "memoryTip": "The lumbosacral trunk is like a bridge connecting the lumbar and sacral \"cities\"!",
        "emoji": "🌉"
    },
    {
        "id": 13,
        "topic": "topic4",
        "question": "Where does the lumbosacral trunk pass?",
        "answer": "<li>The lumbosacral trunk passes over the ala of the sacrum.</li>",
        "memoryTip": "The lumbosacral trunk is like a traveler crossing over the \"sacrum highway\"!",
        "emoji": "🛣️"
    },
    {
        "id": 14,
        "topic": "topic5",
        "question": "From where do the ilioinguinal and iliohypogastric nerves arise?",
        "answer": "<li>The ilioinguinal and iliohypogastric nerves arise from the ventral ramus of L1.</li>",
        "memoryTip": "Think of these nerves as the \"L1 twins\" entering the abdomen together!",
        "emoji": "👯‍♂️"
    },
    {
        "id": 15,
        "topic": "topic5",
        "question": "Where do the ilioinguinal and iliohypogastric nerves enter the abdomen?",
        "answer": "<li>They enter the abdomen posterior to the medial arcuate ligaments.</li>",
        "memoryTip": "These nerves sneak into the abdomen like ninjas behind the \"arcuate curtains\"!",
        "emoji": "🥷"
    },
    {
        "id": 16,
        "topic": "topic5",
        "question": "What muscles do the ilioinguinal and iliohypogastric nerves pierce?",
        "answer": "<li>They pierce the transverse abdominal muscles near the anterior superior iliac spines and pass through the internal and external oblique muscles.</li>",
        "memoryTip": "These nerves are like little spies sneaking through the abdominal \"muscle fortress\"!",
        "emoji": "🕵️‍♂️"
    },
    {
        "id": 17,
        "topic": "topic5",
        "question": "What area do the ilioinguinal and iliohypogastric nerves supply?",
        "answer": "<li>They supply the skin of the suprapubic and inguinal region.</li>",
        "memoryTip": "Think of these nerves as the \"skin guardians\" of your suprapubic and inguinal areas!",
        "emoji": "🛡️"
    },
    {
        "id": 18,
        "topic": "topic6",
        "question": "What is the origin of the genitofemoral nerve?",
        "answer": "<li>The genitofemoral nerve originates from the L2 spinal nerve.</li>",
        "memoryTip": "Think of the genitofemoral nerve as the \"L2 VIP\" that gets to the party first!",
        "emoji": "🎉"
    },
    {
        "id": 19,
        "topic": "topic6",
        "question": "Where does the genitofemoral nerve pierce?",
        "answer": "<li>It pierces the anterior surface of the psoas major.</li>",
        "memoryTip": "The genitofemoral nerve is like a needle in a haystack, piercing right through the psoas!",
        "emoji": "🪡"
    },
    {
        "id": 20,
        "topic": "topic6",
        "question": "What is the path of the genitofemoral nerve after it pierces the psoas major?",
        "answer": "<li>It runs inferiorly on the psoas major, deep to the psoas fascia.</li>",
        "memoryTip": "The genitofemoral nerve is on a downward journey, like a slide at the playground!",
        "emoji": "⛷️"
    },
    {
        "id": 21,
        "topic": "topic6",
        "question": "Into what branches does the genitofemoral nerve divide?",
        "answer": "<li>It divides into femoral and genital branches.</li>",
        "memoryTip": "The genitofemoral nerve splits like a fork in the road, choosing between \"femoral\" and \"genital\"!",
        "emoji": "🍴"
    },
    {
        "id": 22,
        "topic": "topic6",
        "question": "What does the genital branch of the genitofemoral nerve supply?",
        "answer": "<li>The genital branch supplies the cremaster muscle and the skin over the scrotum and labium majus.</li>",
        "memoryTip": "The genital branch is like a tailor, fitting the cremaster and skin just right!",
        "emoji": "👖"
    },
    {
        "id": 23,
        "topic": "topic6",
        "question": "What does the femoral branch of the genitofemoral nerve supply?",
        "answer": "<li>The femoral branch supplies the skin over the femoral triangle.</li>",
        "memoryTip": "The femoral branch is the \"fashion police\" for the femoral triangle, making sure it looks good!",
        "emoji": "👗"
    },
    {
        "id": 24,
        "topic": "topic7",
        "question": "What spinal nerves contribute to the lateral femoral cutaneous nerve?",
        "answer": "<li>The lateral femoral cutaneous nerve is formed from the L2 and L3 spinal nerves.</li>",
        "memoryTip": "The lateral femoral cutaneous nerve is like a duo, always hanging out with L2 and L3!",
        "emoji": "👯"
    },
    {
        "id": 25,
        "topic": "topic7",
        "question": "Where does the lateral femoral cutaneous nerve enter the thigh?",
        "answer": "<li>It enters the thigh posterior to the inguinal ligament, just medial to the anterior superior iliac spine.</li>",
        "memoryTip": "The lateral femoral cutaneous nerve sneaks into the thigh like a ninja, just behind the inguinal ligament!",
        "emoji": "🥷"
    },
    {
        "id": 26,
        "topic": "topic7",
        "question": "What area does the lateral femoral cutaneous nerve supply?",
        "answer": "<li>It supplies the skin on the anterolateral surface of the thigh.</li>",
        "memoryTip": "The lateral femoral cutaneous nerve is like a sunbather, covering the anterolateral surface of the thigh!",
        "emoji": "☀️"
    },
    {
        "id": 27,
        "topic": "topic8",
        "question": "Where is the sacral plexus located in relation to the lumbar plexus?",
        "answer": "<li>The sacral plexus lies immediately inferior to the lumbar plexus.</li>",
        "memoryTip": "The sacral plexus is like the basement of the lumbar plexus, always hanging out below!",
        "emoji": "🏠"
    },
    {
        "id": 28,
        "topic": "topic8",
        "question": "What spinal nerves form the sacral plexus?",
        "answer": "<li>The sacral plexus is formed by the anterior rami of spinal nerves L4, L5, S1, S2, S3, and S4.</li>",
        "memoryTip": "The sacral plexus is a big family reunion of L4 to S4, all together in one place!",
        "emoji": "👨‍👩‍👧‍👦"
    },
    {
        "id": 29,
        "topic": "topic8",
        "question": "How are the lumbar and sacral plexuses related?",
        "answer": "<li>They contain fibers from the nerves of the lumbar plexus through the lumbosacral trunk, and are described collectively as the lumbosacral plexus.</li>",
        "memoryTip": "The lumbar and sacral plexuses are like best friends, always sharing fibers and hanging out together!",
        "emoji": "🤝"
    },
    {
        "id": 30,
        "topic": "topic9",
        "question": "What muscles does the sacral plexus supply?",
        "answer": "<li>The sacral plexus supplies the quadratus femoris, inferior gemellus, obturator internus, levator ani, coccygeus, and external anal sphincter muscles.</li>",
        "memoryTip": "The sacral plexus is like a personal trainer for all these muscles, keeping them in shape!",
        "emoji": "🏋️"
    },
    {
        "id": 31,
        "topic": "topic9",
        "question": "Which nerves are part of the sacral plexus?",
        "answer": "<li>The sacral plexus includes the posterior femoral cutaneous nerve and the pudendal nerve.</li>",
        "memoryTip": "The sacral plexus is like a party with the posterior femoral cutaneous and pudendal nerves as the guests of honor!",
        "emoji": "🎊"
    },
    {
        "id": 32,
        "topic": "topic9",
        "question": "What do the pelvic splanchnic nerves supply?",
        "answer": "<li>The pelvic splanchnic nerves supply the pelvic organs.</li>",
        "memoryTip": "The pelvic splanchnic nerves are like delivery drivers, bringing supplies to the pelvic organs!",
        "emoji": "🚚"
    },
    {
        "id": 33,
        "topic": "topic9",
        "question": "What does the perforating cutaneous nerve supply?",
        "answer": "<li>The perforating cutaneous nerve supplies the skin of the gluteal region.</li>",
        "memoryTip": "The perforating cutaneous nerve is like a tailor for the gluteal region, making sure it fits just right!",
        "emoji": "👖"
    },
    {
        "id": 34,
        "topic": "topic10",
        "question": "What is the sciatic nerve also known as?",
        "answer": "<li>The nerve of ischium.</li>",
        "memoryTip": "Think of the sciatic nerve as the \"ischium's best friend\" – always hanging out together!",
        "emoji": "👫"
    },
    {
        "id": 35,
        "topic": "topic10",
        "question": "What spinal levels does the sciatic nerve originate from?",
        "answer": "<li>L4, L5, S1, S2, S3.</li>",
        "memoryTip": "Remember \"L4, L5, S1, S2, S3\" as the sciatic nerve's secret code to get into the nerve club!",
        "emoji": "🔑"
    },
    {
        "id": 36,
        "topic": "topic10",
        "question": "What is the thickness and significance of the sciatic nerve?",
        "answer": "<li>It is the thickest nerve in the body and the largest branch of the sacral plexus.</li>",
        "memoryTip": "The sciatic nerve is so thick, it could be a bodybuilder in the nerve world!",
        "emoji": "💪"
    },
    {
        "id": 37,
        "topic": "topic11",
        "question": "What are the two main branches of the sciatic nerve?",
        "answer": "<li>Tibial Nerve and Common Peroneal Nerve.</li>",
        "memoryTip": "Think of the sciatic nerve as a tree with two big branches: Tibial and Common Peroneal – both ready to leaf!",
        "emoji": "🌳"
    },
    {
        "id": 38,
        "topic": "topic12",
        "question": "Where does the sciatic nerve lie in the pelvis?",
        "answer": "<li>It lies in front of the piriformis muscle.</li>",
        "memoryTip": "The sciatic nerve is like a front-row seat at a concert, always in front of the piriformis!",
        "emoji": "🎤"
    },
    {
        "id": 39,
        "topic": "topic12",
        "question": "How does the sciatic nerve enter the gluteal region?",
        "answer": "<li>It enters through the greater sciatic foramen below the piriformis.</li>",
        "memoryTip": "The sciatic nerve sneaks into the gluteal region like a ninja through a secret door!",
        "emoji": "🥷"
    },
    {
        "id": 40,
        "topic": "topic13",
        "question": "What is located superficially or posteriorly to the sciatic nerve in the gluteal region?",
        "answer": "<li>Gluteus maximus.</li>",
        "memoryTip": "The gluteus maximus is like a big cushion behind the sciatic nerve, always ready to support!",
        "emoji": "🛋️"
    },
    {
        "id": 41,
        "topic": "topic13",
        "question": "What structures are located deep or anterior to the sciatic nerve in the gluteal region?",
        "answer": "<li>Body of the ischium, tendon of obturator internus with gemelli, Quadratus femoris, obturator externus, capsule of hip joint, and upper transverse fibers of adductor magnus.</li>",
        "memoryTip": "The sciatic nerve has a deep relationship with many muscles – it's like a muscle party down there!",
        "emoji": "🎉"
    },
    {
        "id": 42,
        "topic": "topic13",
        "question": "What is located medially to the sciatic nerve in the gluteal region?",
        "answer": "<li>Inferior gluteal nerve and vessels.</li>",
        "memoryTip": "The inferior gluteal nerve is like the sciatic nerve's neighbor, always hanging out on the side!",
        "emoji": "🏡"
    },
    {
        "id": 43,
        "topic": "topic14",
        "question": "Where does the sciatic nerve enter the thigh?",
        "answer": "<li>At the lower border of the gluteus maximus.</li>",
        "memoryTip": "The sciatic nerve takes the \"low road\" into the thigh, just like a sneaky raccoon!",
        "emoji": "🦝"
    },
    {
        "id": 44,
        "topic": "topic15",
        "question": "What crosses the sciatic nerve superficially or posteriorly in the thigh?",
        "answer": "<li>Long head of biceps femoris.</li>",
        "memoryTip": "The long head of biceps femoris is like a tall friend who always stands in front of you at a concert!",
        "emoji": "🎶"
    },
    {
        "id": 45,
        "topic": "topic15",
        "question": "Where does the sciatic nerve lie in relation to the adductor magnus in the thigh?",
        "answer": "<li>It lies on the adductor magnus.</li>",
        "memoryTip": "The sciatic nerve is like a passenger on the adductor magnus bus, always riding along!",
        "emoji": "🚌"
    },
    {
        "id": 46,
        "topic": "topic15",
        "question": "What muscles are located medially to the sciatic nerve in the thigh?",
        "answer": "<li>Semimembranosus and semitendinosus.</li>",
        "memoryTip": "The semimembranosus and semitendinosus are like the sciatic nerve's close friends, always sticking together!",
        "emoji": "👯"
    },
    {
        "id": 47,
        "topic": "topic15",
        "question": "What is located laterally to the sciatic nerve in the thigh?",
        "answer": "<li>Biceps femoris.</li>",
        "memoryTip": "The biceps femoris is like the sciatic nerve's \"cool\" friend, always hanging out on the side!",
        "emoji": "😎"
    },
    {
        "id": 48,
        "topic": "topic16",
        "question": "Where does the sciatic nerve lie in the buttock?",
        "answer": "<li>The sciatic nerve lies deep to the gluteus maximus muscle, midway between the greater trochanter and the ischial tuberosity.</li>",
        "memoryTip": "Imagine the sciatic nerve as a shy person hiding behind the gluteus maximus at a party, trying to stay out of sight!",
        "emoji": "🕵️‍♂️"
    },
    {
        "id": 49,
        "topic": "topic16",
        "question": "What type of injury can generally occur from a posterior dislocation of the hip joint?",
        "answer": "<li>A posterior dislocation of the hip joint will generally injure the sciatic nerve.</li>",
        "memoryTip": "Think of the sciatic nerve as a party guest who gets hurt when the door swings open too fast—watch out for those dislocations!",
        "emoji": "🚪"
    },
    {
        "id": 50,
        "topic": "topic16",
        "question": "What conditions can damage the nerve roots leading to sciatica?",
        "answer": "<li>A herniated disc or pressure from the uterus during pregnancy may damage the nerve roots, resulting in sciatica.</li>",
        "memoryTip": "Sciatica is like a surprise party for your nerves—unexpected and painful when the pressure builds up!",
        "emoji": "🎉"
    },
    {
        "id": 51,
        "topic": "topic16",
        "question": "How can an improperly administered injection affect the sciatic nerve?",
        "answer": "<li>An improperly administered injection into the buttock may injure the sciatic nerve.</li>",
        "memoryTip": "Think of the sciatic nerve as a delicate balloon—one wrong poke and it’s a painful pop!",
        "emoji": "🎈"
    },
    {
        "id": 52,
        "topic": "topic17",
        "question": "What are the primary nerve roots that form the common peroneal nerve?",
        "answer": "<li>The common peroneal nerve is formed from the dorsal divisions of the anterior primary rami of L4, L5, S1, and S2.</li>",
        "memoryTip": "Remember the common peroneal nerve as the \"L4-L5-S1-S2 club\"—only the cool nerves get in!",
        "emoji": "🎉"
    },
    {
        "id": 53,
        "topic": "topic17",
        "question": "What muscles does the common peroneal nerve innervate?",
        "answer": "<li>The common peroneal nerve innervates the extensors of the thigh and flexors of the leg, including the biceps femoris (short head).</li>",
        "memoryTip": "Picture the common peroneal nerve as a personal trainer for your thigh muscles—always flexing and extending!",
        "emoji": "💪"
    },
    {
        "id": 54,
        "topic": "topic17",
        "question": "What is the cutaneous innervation provided by the common peroneal nerve?",
        "answer": "<li>The common peroneal nerve provides cutaneous innervation to the lateral surface of the knee and the great and second toe.</li>",
        "memoryTip": "Think of the common peroneal nerve as a friendly tour guide for your leg—showing off the knee and toes!",
        "emoji": "🦶"
    },
    {
        "id": 55,
        "topic": "topic17",
        "question": "What movements are facilitated by the common peroneal nerve?",
        "answer": "<li>The common peroneal nerve facilitates dorsiflexion of the foot (Tibialis anterior and Peroneus tertius) and extends the toes (Ext. digitorum brevis and longus, Ext. hallucis longus).</li>",
        "memoryTip": "Imagine the common peroneal nerve as a dance instructor teaching your foot to \"point\" and \"flex\" like a ballerina!",
        "emoji": "🩰"
    },
    {
        "id": 56,
        "topic": "topic17",
        "question": "Where is the common peroneal nerve most easily injured?",
        "answer": "<li>The common peroneal nerve is easily injured at the fibular neck.</li>",
        "memoryTip": "Think of the fibular neck as a narrow alley where the common peroneal nerve gets stuck—watch your step!",
        "emoji": "🚧"
    },
    {
        "id": 57,
        "topic": "topic18",
        "question": "What is the role of the femoral nerve?",
        "answer": "<li>The femoral nerve innervates the muscles of the thigh.</li>",
        "memoryTip": "Picture the femoral nerve as the \"thigh boss,\" making sure all the thigh muscles are working hard!",
        "emoji": "👖"
    },
    {
        "id": 58,
        "topic": "topic18",
        "question": "What does the sciatic nerve innervate?",
        "answer": "<li>The sciatic nerve innervates the posterior compartment of the thigh, leg, and sole of the foot.</li>",
        "memoryTip": "Think of the sciatic nerve as the \"backstage pass\" for your leg—controlling all the behind-the-scenes action!",
        "emoji": "🎭"
    },
    {
        "id": 59,
        "topic": "topic18",
        "question": "What are the branches of the common fibular nerve?",
        "answer": "<li>The common fibular nerve has a superficial branch for the lateral compartment of the leg and a deep branch for the anterior compartment of the leg.</li>",
        "memoryTip": "Imagine the common fibular nerve as a split personality—one side loves the lateral leg, while the other is all about the anterior!",
        "emoji": "🎭"
    },
    {
        "id": 60,
        "topic": "topic19",
        "question": "Which muscles are innervated by the tibial nerve that act as extensors of the thigh and flexors of the leg?",
        "answer": "<li>The biceps femoris (long head) acts as an extensor of the thigh and flexor of the leg.</li>",
        "memoryTip": "Think of the biceps as the \"long arm\" of the leg, flexing and extending like a superhero!",
        "emoji": "🦸‍♂️"
    },
    {
        "id": 61,
        "topic": "topic19",
        "question": "What are the adductors of the thigh innervated by the tibial nerve?",
        "answer": "<li>The adductor magnus is innervated by the tibial nerve.</li>",
        "memoryTip": "The adductor magnus is like a \"magnificent\" friend who always brings the group together!",
        "emoji": "🤝"
    },
    {
        "id": 62,
        "topic": "topic19",
        "question": "Which muscles are responsible for plantar flexion of the foot and are innervated by the tibial nerve?",
        "answer": "<li>The plantaris, gastrocnemius, soleus, and tibialis posterior are responsible for plantar flexion.</li>",
        "memoryTip": "Think of these muscles as the \"planting crew\" that helps your foot dig into the ground!",
        "emoji": "🌱"
    },
    {
        "id": 63,
        "topic": "topic19",
        "question": "What is the function of the popliteus muscle?",
        "answer": "<li>The popliteus muscle acts as a flexor of the leg.</li>",
        "memoryTip": "The popliteus is like a \"pop\" that helps your leg bend when you sit down!",
        "emoji": "🪑"
    },
    {
        "id": 64,
        "topic": "topic19",
        "question": "Which muscles are involved in flexing the toes and are innervated by the tibial nerve?",
        "answer": "<li>The flexor digitorum longus and flexor hallucis longus are involved in flexing the toes.</li>",
        "memoryTip": "These toe flexors are like \"toe-tally\" flexible friends who can bend in all directions!",
        "emoji": "🦶"
    },
    {
        "id": 65,
        "topic": "topic20",
        "question": "What is the cutaneous innervation provided by the medial and lateral plantar nerve?",
        "answer": "<li>The medial and lateral plantar nerve provides sensory innervation to the sole of the foot and innervates the plantar muscles.</li>",
        "memoryTip": "Think of the plantar nerves as the \"sole\" mates of your feet, always there to feel the ground!",
        "emoji": "👣"
    },
    {
        "id": 66,
        "topic": "topic20",
        "question": "What area does the sural nerve provide sensory innervation to?",
        "answer": "<li>The sural nerve provides sensory innervation to the lateral and posterior one-third of the leg and the lateral side of the foot.</li>",
        "memoryTip": "The sural nerve is like a \"sura-lot\" of help for your leg and foot's sensation!",
        "emoji": "🦵"
    },
    {
        "id": 67,
        "topic": "topic21",
        "question": "What spinal components make up the superior gluteal nerve?",
        "answer": "<li>The superior gluteal nerve is made up of spinal components L4, L5, and S1.</li>",
        "memoryTip": "The superior gluteal nerve is like the \"A-team\" of the glutes, always ready to lift!",
        "emoji": "🍑"
    },
    {
        "id": 68,
        "topic": "topic21",
        "question": "Which muscles are innervated by the inferior gluteal nerve?",
        "answer": "<li>The inferior gluteal nerve innervates the gluteus maximus muscle.</li>",
        "memoryTip": "The gluteus maximus is the \"maxi\" muscle that helps you sit down and stand up with style!",
        "emoji": "🪑"
    },
    {
        "id": 69,
        "topic": "topic21",
        "question": "What is the function of the nerve to piriformis?",
        "answer": "<li>The nerve to piriformis innervates the piriformis muscle, which acts as an abductor and rotator of the thigh.</li>",
        "memoryTip": "The piriformis is like a \"pirate\" that helps your thigh rotate and move sideways!",
        "emoji": "🏴‍☠️"
    },
    {
        "id": 70,
        "topic": "topic21",
        "question": "What muscles are innervated by the nerve to quadratus femoris?",
        "answer": "<li>The nerve to quadratus femoris innervates the gemellus inferior and quadratus femoris muscles, which are rotators of the thigh.</li>",
        "memoryTip": "Think of these muscles as the \"quad squad\" that helps your thigh rotate like a pro!",
        "emoji": "🔄"
    },
    {
        "id": 71,
        "topic": "topic21",
        "question": "What area does the posterior cutaneous femoral nerve provide sensory innervation to?",
        "answer": "<li>The posterior cutaneous femoral nerve provides sensory innervation to the lower lateral surface of the buttock, anal region, upper posterior surface of the thigh, upper aspect of the calf, scrotum in males, and labia majora in females.</li>",
        "memoryTip": "This nerve is like a \"posterior tour guide,\" covering all the important areas in the back!",
        "emoji": "🗺️"
    },
    {
        "id": 72,
        "topic": "topic21",
        "question": "What is the composition of the sciatic nerve?",
        "answer": "<li>The sciatic nerve is composed of two nerves: the tibial nerve and the common fibular nerve.</li>",
        "memoryTip": "The sciatic nerve is like a \"two-for-one\" deal, bringing two nerves together for double the fun!",
        "emoji": "🎉"
    },
    {
        "id": 73,
        "topic": "topic21",
        "question": "What muscles does the sacral muscular nerve innervate?",
        "answer": "<li>The sacral muscular nerve innervates the levator ani and external anal sphincter muscles.</li>",
        "memoryTip": "Think of these muscles as the \"support team\" for your pelvic floor, keeping everything in place!",
        "emoji": "🏋️‍♂️"
    },
    {
        "id": 74,
        "topic": "topic22",
        "question": "What is the saphenous nerve known for?",
        "answer": "<li>The saphenous nerve is the longest cutaneous branch of the femoral nerve.</li>",
        "memoryTip": "The saphenous nerve is like the \"long-distance runner\" of nerves, going the extra mile for sensation!",
        "emoji": "🏃‍♂️"
    },
    {
        "id": 75,
        "topic": "topic22",
        "question": "Where does the saphenous nerve descend in relation to the femoral artery?",
        "answer": "<li>The saphenous nerve descends lateral to the femoral artery into the adductor canal.</li>",
        "memoryTip": "Picture the saphenous nerve as a \"sidekick\" always staying close to the femoral artery!",
        "emoji": "🤝"
    },
    {
        "id": 76,
        "topic": "topic22",
        "question": "What does the saphenous nerve supply after it leaves the adductor canal?",
        "answer": "<li>After leaving the adductor canal, the saphenous nerve supplies the prepatellar skin.</li>",
        "memoryTip": "The saphenous nerve is like a \"preppy\" friend, always dressed to impress the skin around the knee!",
        "emoji": "👖"
    },
    {
        "id": 77,
        "topic": "topic23",
        "question": "What does the posterior branch of the obturator nerve supply?",
        "answer": "<li>The posterior branch supplies the obturator externus and adductor brevis muscles, as well as part of the adductor magnus.</li>",
        "memoryTip": "The obturator nerve is like a \"team player,\" helping multiple muscles work together for adduction!",
        "emoji": "🤼‍♂️"
    },
    {
        "id": 78,
        "topic": "topic23",
        "question": "What does the anterior branch of the obturator nerve innervate?",
        "answer": "<li>The anterior branch supplies the adductor longus, gracilis, and adductor brevis muscles, and often contributes to the supply of the pectineus muscle.</li>",
        "memoryTip": "The anterior branch is like the \"front line\" of adductor muscles, always ready to pull things together!",
        "emoji": "🔗"
    },
    {
        "id": 79,
        "topic": "topic23",
        "question": "What type of cutaneous branches does the obturator nerve provide?",
        "answer": "<li>The obturator nerve provides cutaneous branches that innervate the skin on the medial side of the thigh.</li>",
        "memoryTip": "The obturator nerve is like a \"medial messenger,\" delivering sensation to the inner thigh!",
        "emoji": "📬"
    },
    {
        "id": 80,
        "topic": "topic24",
        "question": "What is the origin of the lateral rotators of the thigh?",
        "answer": "<li>The origin of the lateral rotators of the thigh is the lumbo-sacral plexus (L2, L3, L4).</li>",
        "memoryTip": "Think of the lumbo-sacral plexus as the \"lumberjack\" of the thigh, always rotating things around!",
        "emoji": "🪓"
    },
    {
        "id": 81,
        "topic": "topic24",
        "question": "Which muscles are innervated by the obturator nerve?",
        "answer": "<li>The obturator nerve innervates the adductor magnus, adductor longus, adductor brevis, and obturator externus.</li>",
        "memoryTip": "The obturator is like a \"door\" that opens up the adductor family!",
        "emoji": "🚪"
    },
    {
        "id": 82,
        "topic": "topic24",
        "question": "What movements are associated with the adductors of the thigh?",
        "answer": "<li>The adductors of the thigh are responsible for adduction and flexion of the thigh.</li>",
        "memoryTip": "Adductors are like a team of friends pulling you back in for a group hug!",
        "emoji": "🤗"
    },
    {
        "id": 83,
        "topic": "topic24",
        "question": "What area does the cutaneous innervation of the lumbo-sacral plexus supply?",
        "answer": "<li>The cutaneous innervation supplies the superior and medial side of the thigh.</li>",
        "memoryTip": "Think of the superior and medial side of the thigh as the VIP section of the leg!",
        "emoji": "🎟️"
    },
    {
        "id": 84,
        "topic": "topic25",
        "question": "What is the origin of the flexors of the thigh?",
        "answer": "<li>The origin of the flexors of the thigh is the lumbo-sacral plexus (L2, L3, L4).</li>",
        "memoryTip": "Flexors are like the \"bending buddies\" of the thigh, always ready to help you sit down!",
        "emoji": "🧘"
    },
    {
        "id": 85,
        "topic": "topic25",
        "question": "Which muscles are included in the extensors of the leg?",
        "answer": "<li>The extensors of the leg include the vastus lateralis, vastus intermedius, and vastus medialis.</li>",
        "memoryTip": "The vastus muscles are like the \"vast\" army of leg extensions ready to march!",
        "emoji": "🪖"
    },
    {
        "id": 86,
        "topic": "topic25",
        "question": "What movements do the flexors of the thigh and leg perform?",
        "answer": "<li>The flexors of the thigh and leg perform flexion of the thigh and leg.</li>",
        "memoryTip": "Flexors are like the \"flexible friends\" who can bend over backwards for you!",
        "emoji": "🤸"
    },
    {
        "id": 87,
        "topic": "topic25",
        "question": "What is the role of the saphenous branch in cutaneous innervation?",
        "answer": "<li>The saphenous branch supplies the medial leg and foot.</li>",
        "memoryTip": "The saphenous branch is like a \"sappy friend\" who always brings gifts to the leg and foot!",
        "emoji": "🎁"
    },
    {
        "id": 88,
        "topic": "topic26",
        "question": "How does the femoral nerve enter the femoral triangle?",
        "answer": "<li>The femoral nerve enters the femoral triangle by passing behind the inguinal ligament.</li>",
        "memoryTip": "The femoral nerve sneaks in like a ninja behind the inguinal ligament!",
        "emoji": "🥷"
    },
    {
        "id": 89,
        "topic": "topic26",
        "question": "Where does the femoral nerve lie in relation to the iliacus and psoas major?",
        "answer": "<li>The femoral nerve lies in the groove between the iliacus and the psoas major, outside the femoral sheath.</li>",
        "memoryTip": "The femoral nerve is like a \"groovy dancer\" hanging out between two cool muscles!",
        "emoji": "🕺"
    },
    {
        "id": 90,
        "topic": "topic27",
        "question": "What are the main functions of the muscles innervated by the lumbo-sacral plexus?",
        "answer": "<li>The main functions include lateral rotation, adduction, flexion of the thigh, and extension of the leg.</li>",
        "memoryTip": "Think of the lumbo-sacral plexus as the \"muscle manager\" coordinating all the moves!",
        "emoji": "🎤"
    },
    {
        "id": 91,
        "topic": "topic27",
        "question": "Which muscle is referred to as the \"kicking muscle\"?",
        "answer": "<li>The rectus femoris is referred to as the \"kicking muscle.\"</li>",
        "memoryTip": "The rectus femoris is always ready to kick it up a notch!",
        "emoji": "🦵"
    },
    {
        "id": 92,
        "topic": "topic28",
        "question": "What is the beginning point of the femoral artery?",
        "answer": "<li>The femoral artery is a continuation of the external iliac artery, beyond the inguinal ligament.</li>",
        "memoryTip": "Think of the femoral artery as the \"continuing story\" of the external iliac, always moving forward!",
        "emoji": "📖"
    },
    {
        "id": 93,
        "topic": "topic28",
        "question": "What branches does the femoral artery give in the femoral triangle?",
        "answer": "<li>In the femoral triangle, the femoral artery gives 3 superficial branches and 3 deep branches.</li>",
        "memoryTip": "The femoral artery is like a generous host, offering both superficial and deep snacks at its triangle party!",
        "emoji": "🎉"
    },
    {
        "id": 94,
        "topic": "topic28",
        "question": "What are the superficial branches of the femoral artery?",
        "answer": "<li>The superficial branches are the superficial external pudendal, superficial epigastric, and superficial circumflex iliac.</li>",
        "memoryTip": "Superficial branches are like the appetizers at a party: external pudendal, epigastric, and circumflex are the tasty bites!",
        "emoji": "🍢"
    },
    {
        "id": 95,
        "topic": "topic28",
        "question": "What are the deep branches of the femoral artery?",
        "answer": "<li>The deep branches are the profunda femoris, deep external pudendal, and muscular branches.</li>",
        "memoryTip": "Deep branches are the hearty main courses: profunda femoris, deep external pudendal, and muscular are the filling dishes!",
        "emoji": "🍽️"
    },
    {
        "id": 96,
        "topic": "topic28",
        "question": "What additional branches does the femoral artery give in the adductor canal?",
        "answer": "<li>In the adductor canal, the femoral artery gives muscular and descending genicular branches.</li>",
        "memoryTip": "The adductor canal is like a secret passage where the femoral artery sneaks out some extra branches!",
        "emoji": "🏰"
    },
    {
        "id": 97,
        "topic": "topic28",
        "question": "What is the profunda femoris?",
        "answer": "<li>The profunda femoris is the largest branch of the femoral artery.</li>",
        "memoryTip": "Think of the profunda femoris as the \"biggest fan\" of the femoral artery, always cheering it on!",
        "emoji": "📣"
    },
    {
        "id": 98,
        "topic": "topic28",
        "question": "What branches does the profunda femoris give?",
        "answer": "<li>The profunda femoris gives medial and lateral circumflex femoral branches and the 1st, 2nd, and 3rd perforating branches.</li>",
        "memoryTip": "The profunda femoris is like a family tree, branching out with circumflex and perforating relatives!",
        "emoji": "🌳"
    },
    {
        "id": 99,
        "topic": "topic28",
        "question": "How does the profunda femoris end?",
        "answer": "<li>The profunda femoris ends as the 4th perforating branch.</li>",
        "memoryTip": "The profunda femoris wraps up its story with a grand finale: the 4th perforating branch!",
        "emoji": "🎇"
    },
    {
        "id": 100,
        "topic": "topic29",
        "question": "What is the origin of the ilioinguinal nerve?",
        "answer": "<li>The ilioinguinal nerve emerges at the superficial inguinal ring.</li>",
        "memoryTip": "The ilioinguinal nerve is like a magician appearing at the ring, ready to perform!",
        "emoji": "🎩"
    },
    {
        "id": 101,
        "topic": "topic29",
        "question": "Where does the femoral branch of the genitofemoral nerve run?",
        "answer": "<li>The femoral branch of the genitofemoral nerve runs over the femoral triangle.</li>",
        "memoryTip": "The genitofemoral nerve is like a tour guide, showing off the femoral triangle!",
        "emoji": "🗺️"
    },
    {
        "id": 102,
        "topic": "topic29",
        "question": "What area does the lateral cutaneous nerve of the thigh cover?",
        "answer": "<li>The lateral cutaneous nerve of the thigh covers the anterolateral side of the thigh and the anterior part of the gluteal region.</li>",
        "memoryTip": "The lateral cutaneous nerve is like a stylish belt, wrapping around the anterolateral side of the thigh!",
        "emoji": "👖"
    },
    {
        "id": 103,
        "topic": "topic29",
        "question": "What does the intermediate cutaneous nerve of the thigh innervate?",
        "answer": "<li>The intermediate cutaneous nerve of the thigh innervates a strip of skin on the front of the thigh extending from the sartorius to the knee.</li>",
        "memoryTip": "The intermediate cutaneous nerve is like a painter, creating a strip of color from sartorius to knee!",
        "emoji": "🎨"
    },
    {
        "id": 104,
        "topic": "topic29",
        "question": "What area does the medial cutaneous nerve of the thigh cover?",
        "answer": "<li>The medial cutaneous nerve of the thigh covers the medial side of the lower 2/3rd of the thigh.</li>",
        "memoryTip": "The medial cutaneous nerve is like a cozy blanket, covering the medial side of the thigh!",
        "emoji": "🛏️"
    },
    {
        "id": 105,
        "topic": "topic29",
        "question": "What is the function of the saphenous nerve?",
        "answer": "<li>The saphenous nerve innervates the medial side of the leg and foot up to the ball of the big toe.</li>",
        "memoryTip": "The saphenous nerve is like a friendly guide, leading you from the leg to the big toe!",
        "emoji": "👣"
    },
    {
        "id": 106,
        "topic": "topic30",
        "question": "What are the branches of the popliteal femoral artery?",
        "answer": "<li>The branches include superior medial genicular, superior lateral genicular, middle genicular, inferior medial genicular, and inferior lateral genicular.</li>",
        "memoryTip": "Think of the popliteal artery as a \"genius\" with five branches, each one smarter than the last!",
        "emoji": "🧠"
    },
    {
        "id": 107,
        "topic": "topic30",
        "question": "What types of branches does the popliteal artery give off?",
        "answer": "<li>It gives off cutaneous and muscular branches in the popliteal fossa.</li>",
        "memoryTip": "The popliteal artery is like a generous host, offering both \"muscle\" and \"skin\" to its guests!",
        "emoji": "🎉"
    },
    {
        "id": 108,
        "topic": "topic30",
        "question": "What is the anterior tibial artery a continuation of?",
        "answer": "<li>The anterior tibial artery is a smaller terminal branch of the popliteal artery.</li>",
        "memoryTip": "The anterior tibial is like a little brother, always following the popliteal around!",
        "emoji": "👶"
    },
    {
        "id": 109,
        "topic": "topic30",
        "question": "What are the functions of the muscular branches of the anterior tibial artery?",
        "answer": "<li>They supply the anterior compartment of the thigh, provide cutaneous supply to the skin of the leg, and give articular branches to the knee and ankle joints.</li>",
        "memoryTip": "The anterior tibial is like a multitasker, juggling muscles, skin, and joints all at once!",
        "emoji": "🤹"
    },
    {
        "id": 110,
        "topic": "topic30",
        "question": "What does the dorsalis pedis artery continue from?",
        "answer": "<li>The dorsalis pedis artery is a continuation of the anterior tibial artery.</li>",
        "memoryTip": "The dorsalis pedis is like a relay runner, taking the baton from the anterior tibial!",
        "emoji": "🏃"
    },
    {
        "id": 111,
        "topic": "topic30",
        "question": "What are the branches of the dorsalis pedis artery?",
        "answer": "<li>It has two tarsal branches for intertarsal joints and an arcuate artery that gives rise to the 2nd, 3rd, and 4th metatarsal arteries.</li>",
        "memoryTip": "The dorsalis pedis is like a tree, branching out to support the toes!",
        "emoji": "🌳"
    },
    {
        "id": 112,
        "topic": "topic30",
        "question": "What is the posterior tibial artery known for?",
        "answer": "<li>It is the largest terminal branch of the popliteal artery.</li>",
        "memoryTip": "The posterior tibial is the \"big boss\" of the popliteal family!",
        "emoji": "👑"
    },
    {
        "id": 113,
        "topic": "topic30",
        "question": "What are the key branches of the posterior tibial artery?",
        "answer": "<li>It gives off the peroneal artery, a nutrient artery to the tibia, and articular branches to the knee and ankle joints.</li>",
        "memoryTip": "The posterior tibial is like a delivery service, bringing nutrients and support to the knee and ankle!",
        "emoji": "📦"
    },
    {
        "id": 114,
        "topic": "topic30",
        "question": "What does the peroneal artery branch from?",
        "answer": "<li>The peroneal artery is a branch of the posterior tibial artery.</li>",
        "memoryTip": "The peroneal is like a sidekick, always tagging along with the posterior tibial!",
        "emoji": "🦸"
    },
    {
        "id": 115,
        "topic": "topic30",
        "question": "What are the functions of the medial plantar artery?",
        "answer": "<li>It provides muscular branches to the medial side muscles of the foot and digital branches to the medial 3.5 digits.</li>",
        "memoryTip": "The medial plantar is like a foot masseuse, pampering the inner toes!",
        "emoji": "👣"
    },
    {
        "id": 116,
        "topic": "topic30",
        "question": "What does the lateral plantar artery supply?",
        "answer": "<li>It supplies muscular branches to the muscles of the sole and cutaneous branches to the skin and fasciae of the lateral side of the sole.</li>",
        "memoryTip": "The lateral plantar is like a stylist, dressing up the outer sole!",
        "emoji": "💅"
    },
    {
        "id": 117,
        "topic": "topic30",
        "question": "What is the Surat artery known for?",
        "answer": "<li>It is the exclusive supplier of the gastrocnemius muscle.</li>",
        "memoryTip": "The Surat artery is like a VIP pass for the gastrocnemius, giving it all the special treatment!",
        "emoji": "🎟️"
    },
    {
        "id": 118,
        "topic": "topic30",
        "question": "What does the plantar arch artery continue from?",
        "answer": "<li>The plantar arch is a direct continuation of the lateral plantar artery.</li>",
        "memoryTip": "The plantar arch is like a bridge, connecting the lateral plantar to the metatarsals!",
        "emoji": "🌉"
    },
    {
        "id": 119,
        "topic": "topic31",
        "question": "How is the great saphenous vein (GSV) formed?",
        "answer": "<li>It is formed by the union of the medial end of the dorsal venous arch with the medial marginal vein (dorsal vein of the great toe).</li>",
        "memoryTip": "The GSV is like a friendship formed at the toe party, uniting two veins for a good time!",
        "emoji": "🎉"
    },
    {
        "id": 120,
        "topic": "topic31",
        "question": "Where does the great saphenous vein ascend?",
        "answer": "<li>It ascends anterior to the medial malleolus.</li>",
        "memoryTip": "The GSV is like a parade, marching proudly in front of the medial malleolus!",
        "emoji": "🎺"
    },
    {
        "id": 121,
        "topic": "topic31",
        "question": "What nerve accompanies the great saphenous vein?",
        "answer": "<li>The saphenous nerve accompanies the great saphenous vein.</li>",
        "memoryTip": "The saphenous nerve is like a loyal friend, always sticking by the GSV's side!",
        "emoji": "🤝"
    },
    {
        "id": 122,
        "topic": "topic31",
        "question": "Where does the great saphenous vein drain?",
        "answer": "<li>It drains into the femoral vein.</li>",
        "memoryTip": "The GSV is like a river flowing into the big sea, the femoral vein!",
        "emoji": "🌊"
    },
    {
        "id": 123,
        "topic": "topic31",
        "question": "What are the tributaries of the great saphenous vein?",
        "answer": "<li>The tributaries include the anterior vein of the leg, posterior arch vein, and a vein from the calf.</li>",
        "memoryTip": "The tributaries are like little streams feeding into the mighty GSV river!",
        "emoji": "🌊"
    },
    {
        "id": 124,
        "topic": "topic31",
        "question": "What tributaries does the great saphenous vein have in the thigh?",
        "answer": "<li>In the thigh, it has the accessory saphenous vein and the anterior cutaneous vein of the thigh.</li>",
        "memoryTip": "The GSV is like a family reunion in the thigh, welcoming all its tributary relatives!",
        "emoji": "👨‍👩‍👧‍👦"
    },
    {
        "id": 125,
        "topic": "topic31",
        "question": "What veins pierce the cribriform fascia just before the GSV terminates?",
        "answer": "<li>The superficial epigastric vein, superficial circumflex iliac vein, and superficial external pudendal vein pierce the cribriform fascia.</li>",
        "memoryTip": "The GSV is like a VIP guest list, with special veins getting access before the big finale!",
        "emoji": "🎟️"
    },
    {
        "id": 126,
        "topic": "topic31",
        "question": "What vein drains into the popliteal vein?",
        "answer": "<li>The short saphenous vein (SSV) drains into the popliteal vein.</li>",
        "memoryTip": "The SSV is like a shortcut, taking the fast lane to the popliteal vein!",
        "emoji": "🛣️"
    },
    {
        "id": 127,
        "topic": "topic31",
        "question": "How is the short saphenous vein formed?",
        "answer": "<li>It is formed by the union of the lateral end of the dorsal venous arch with the lateral marginal vein.</li>",
        "memoryTip": "The SSV is like a buddy joining the party from the other side of the arch!",
        "emoji": "🎊"
    },
    {
        "id": 128,
        "topic": "topic31",
        "question": "Where does the short saphenous vein ascend?",
        "answer": "<li>It ascends posterior to the lateral malleolus.</li>",
        "memoryTip": "The SSV is like a stealthy ninja, sneaking up behind the lateral malleolus!",
        "emoji": "🥷"
    },
    {
        "id": 129,
        "topic": "topic31",
        "question": "What nerve accompanies the short saphenous vein?",
        "answer": "<li>The sural nerve accompanies the short saphenous vein.</li>",
        "memoryTip": "The sural nerve is like a shadow, always following the SSV around!",
        "emoji": "🌑"
    },
    {
        "id": 130,
        "topic": "topic31",
        "question": "Where does the short saphenous vein drain?",
        "answer": "<li>It drains into the popliteal vein.</li>",
        "memoryTip": "The SSV is like a secret agent, reporting back to the popliteal vein headquarters!",
        "emoji": "🕵️‍♂️"
    },
    {
        "id": 131,
        "topic": "topic32",
        "question": "How many perforators are there for the Great Saphenous Vein (GSV)?",
        "answer": "<li>There are five perforators for the Great Saphenous Vein (GSV).</li>",
        "memoryTip": "Think of GSV as a five-star hotel for veins, with five exclusive entrances!",
        "emoji": "🏨"
    },
    {
        "id": 132,
        "topic": "topic32",
        "question": "How many perforators are there for the Small Saphenous Vein (SSV)?",
        "answer": "<li>There is only one perforator for the Small Saphenous Vein (SSV).</li>",
        "memoryTip": "SSV is like a cozy one-room cabin, just one entrance!",
        "emoji": "🏡"
    },
    {
        "id": 133,
        "topic": "topic32",
        "question": "What do the perforators for GSV connect?",
        "answer": "<li>The perforators for GSV connect superficial veins to deep veins.</li>",
        "memoryTip": "Perforators are like bridges connecting the surface to the deep, just like a bridge over a river!",
        "emoji": "🌉"
    },
    {
        "id": 134,
        "topic": "topic32",
        "question": "What is the function of perforators?",
        "answer": "<li>Perforators allow one-way flow of blood from superficial veins to deep veins.</li>",
        "memoryTip": "Think of perforators as one-way streets for blood – no U-turns allowed!",
        "emoji": "🚦"
    },
    {
        "id": 135,
        "topic": "topic32",
        "question": "Where are the three medial perforators for GSV located?",
        "answer": "<li>They are located at the ankle, just below the knee, and in the adductor canal.</li>",
        "memoryTip": "Imagine a trio of friends meeting at the ankle, knee, and canal for a blood flow party!",
        "emoji": "🎉"
    },
    {
        "id": 136,
        "topic": "topic32",
        "question": "What do the three medial perforators at the ankle connect?",
        "answer": "<li>They connect the Posterior arch vein to the Posterior tibial vein.</li>",
        "memoryTip": "Picture a friendly handshake between the Posterior arch and Posterior tibial veins at the ankle!",
        "emoji": "🤝"
    },
    {
        "id": 137,
        "topic": "topic32",
        "question": "What does the perforator just below the knee connect?",
        "answer": "<li>It connects the GSV or Posterior arch vein with the Posterior tibial vein.</li>",
        "memoryTip": "Below the knee, veins are like friends passing notes to each other!",
        "emoji": "📝"
    },
    {
        "id": 138,
        "topic": "topic32",
        "question": "What does the perforator in the adductor canal connect?",
        "answer": "<li>It connects the GSV with the femoral vein.</li>",
        "memoryTip": "The adductor canal is like a VIP lounge where GSV meets the femoral vein!",
        "emoji": "🎟️"
    },
    {
        "id": 139,
        "topic": "topic32",
        "question": "Where is the perforator for SSV located?",
        "answer": "<li>It is located in the leg at the middle and lower one-third junction.</li>",
        "memoryTip": "SSV's perforator is like a secret passage in the middle of a maze!",
        "emoji": "🗝️"
    },
    {
        "id": 140,
        "topic": "topic32",
        "question": "What does the SSV perforator connect?",
        "answer": "<li>It connects the SSV with the Peroneal vein.</li>",
        "memoryTip": "Think of the SSV perforator as a connector piece in a puzzle, linking SSV to the Peroneal vein!",
        "emoji": "🧩"
    },
    {
        "id": 141,
        "topic": "topic33",
        "question": "What muscles are found in the adductor compartment of the thigh?",
        "answer": "<li>The muscles are Gracilis, Adductor longus, Adductor brevis, Adductor magnus, and Pectineus.</li>",
        "memoryTip": "The adductor compartment is like a team of friends all working together to \"adduct\" the thigh!",
        "emoji": "🤼"
    },
    {
        "id": 142,
        "topic": "topic33",
        "question": "What is the nerve supply for the adductor compartment of the thigh?",
        "answer": "<li>The nerve supply is from the Obturator nerve and the tibial part of the sciatic nerve.</li>",
        "memoryTip": "Think of the Obturator nerve as the coach guiding the adductor team!",
        "emoji": "🏅"
    },
    {
        "id": 143,
        "topic": "topic33",
        "question": "Which muscles are in the anterior compartment of the thigh?",
        "answer": "<li>The muscles are Sartorius, Iliacus, Psoas, Pectineus, and Quadriceps femoris.</li>",
        "memoryTip": "The anterior compartment is like a front-row seat at a concert, with all the main acts!",
        "emoji": "🎤"
    },
    {
        "id": 144,
        "topic": "topic33",
        "question": "What is the nerve supply for the anterior compartment of the thigh?",
        "answer": "<li>The nerve supply is from the Femoral nerve and L1 & L2 ventral rami.</li>",
        "memoryTip": "The Femoral nerve is like the conductor of an orchestra, keeping everything in harmony!",
        "emoji": "🎻"
    },
    {
        "id": 145,
        "topic": "topic33",
        "question": "What muscles are found in the posterior compartment of the thigh?",
        "answer": "<li>The muscles are Semitendinosus, Semimembranosus, Adductor magnus, Biceps femoris (Long head), and Biceps femoris (Short head).</li>",
        "memoryTip": "The posterior compartment is like a family reunion with all the long and short relatives!",
        "emoji": "👪"
    },
    {
        "id": 146,
        "topic": "topic33",
        "question": "What is the nerve supply for the posterior compartment of the thigh?",
        "answer": "<li>The nerve supply is from the tibial portion and common peroneal portion of the sciatic nerve.</li>",
        "memoryTip": "The sciatic nerve is like a family tree, branching out to support all the muscles!",
        "emoji": "🌳"
    },
    {
        "id": 147,
        "topic": "topic33",
        "question": "What muscles are in the anterior compartment of the leg?",
        "answer": "<li>The muscles are Tibialis anterior, Extensor Hallucis Longus (EHL), Extensor Digitorum Longus (EDL), Extensor Digitorum Brevis (EDB), and Peroneus tertius.</li>",
        "memoryTip": "The anterior compartment of the leg is like a marching band, leading the way forward!",
        "emoji": "🎺"
    },
    {
        "id": 148,
        "topic": "topic33",
        "question": "What is the nerve supply for the anterior compartment of the leg?",
        "answer": "<li>The nerve supply is from the Deep peroneal nerve.</li>",
        "memoryTip": "The Deep peroneal nerve is like the drum major, keeping the beat for the marching band!",
        "emoji": "🥁"
    },
    {
        "id": 149,
        "topic": "topic33",
        "question": "What muscles are found in the lateral compartment of the leg?",
        "answer": "<li>The muscles are Peroneus longus and Peroneus brevis.</li>",
        "memoryTip": "The lateral compartment is like a duo of dancers, moving in sync!",
        "emoji": "💃"
    },
    {
        "id": 150,
        "topic": "topic33",
        "question": "What is the nerve supply for the lateral compartment of the leg?",
        "answer": "<li>The nerve supply is from the Superficial peroneal nerve.</li>",
        "memoryTip": "The Superficial peroneal nerve is like the spotlight on the dance floor, highlighting the performers!",
        "emoji": "💡"
    },
    {
        "id": 151,
        "topic": "topic33",
        "question": "What muscles are in the posterior compartment of the leg?",
        "answer": "<li>The muscles are Gastrocnemius, Plantaris, Soleus, Tibialis posterior, Flexor Hallucis Longus (FHL), Flexor Digitorum Longus (FDL), and Popliteus.</li>",
        "memoryTip": "The posterior compartment is like a cozy café, with all the relaxing muscles hanging out!",
        "emoji": "☕"
    },
    {
        "id": 152,
        "topic": "topic33",
        "question": "What is the nerve supply for the posterior compartment of the leg?",
        "answer": "<li>The nerve supply is from the Tibial nerve.</li>",
        "memoryTip": "The Tibial nerve is like the friendly barista serving all the muscles their favorite drinks!",
        "emoji": "☕"
    },
    {
        "id": 153,
        "topic": "topic33",
        "question": "What muscles are found in the gluteal region?",
        "answer": "<li>The muscles are Gluteus maximus, Gluteus medius, Gluteus minimus, Tensor fascia lata, Quadratus femoris, Inferior gemellus, Obturator internus, Superior gemellus, Obturator externus, and Piriformis.</li>",
        "memoryTip": "The gluteal region is like a big family gathering, with all the glute muscles coming together!",
        "emoji": "🎉"
    },
    {
        "id": 154,
        "topic": "topic33",
        "question": "What is the nerve supply for the gluteal region?",
        "answer": "<li>The nerve supply includes the Inferior gluteal nerve, Superior gluteal nerve, nerve to Quadratus femoris, nerve to Obturator internus, and branches from L5, S1, and S2.</li>",
        "memoryTip": "The nerves in the gluteal region are like the party planners, making sure everyone is connected!",
        "emoji": "🎈"
    },
    {
        "id": 155,
        "topic": "topic34",
        "question": "What is a positive Trendelenburg sign indicative of?",
        "answer": "<li>It indicates hip abductor dysfunction, often due to paralysis of the gluteus medius and minimus.</li>",
        "memoryTip": "Think of Trendelenburg as a \"trendy\" way to show off your hip dysfunction!",
        "emoji": "🕺"
    },
    {
        "id": 156,
        "topic": "topic34",
        "question": "What conditions can bring the origin and insertions of the gluteus medius together?",
        "answer": "<li>Conditions include paralysis or weakness of abductors and painful disorders of the hip joint.</li>",
        "memoryTip": "If your gluteus medius is feeling weak, it might just be \"painfully\" shy!",
        "emoji": "😅"
    },
    {
        "id": 157,
        "topic": "topic34",
        "question": "Name a fracture that can cause a positive Trendelenburg sign.",
        "answer": "<li>A fracture of the neck of the femur can cause a positive Trendelenburg sign.</li>",
        "memoryTip": "A femur fracture is like a bad breakup; it leaves you limping!",
        "emoji": "💔"
    },
    {
        "id": 158,
        "topic": "topic34",
        "question": "What is a common condition in children that can lead to a positive Trendelenburg sign?",
        "answer": "<li>Slipped upper femoral epiphysis can lead to a positive Trendelenburg sign.</li>",
        "memoryTip": "Slipping and sliding isn't just for playgrounds; it can happen to your femur too!",
        "emoji": "🛝"
    },
    {
        "id": 159,
        "topic": "topic34",
        "question": "What type of hip injury can result in a positive Trendelenburg sign?",
        "answer": "<li>Greater trochanter fractures can result in a positive Trendelenburg sign.</li>",
        "memoryTip": "If your trochanter is greater than your pain tolerance, you might be in trouble!",
        "emoji": "😬"
    },
    {
        "id": 160,
        "topic": "topic34",
        "question": "What is coxa vara and how does it relate to the Trendelenburg sign?",
        "answer": "<li>Coxa vara is a condition that can lead to a positive Trendelenburg sign due to altered hip mechanics.</li>",
        "memoryTip": "Coxa vara sounds like a fancy dance move, but it’s really just your hip acting up!",
        "emoji": "💃"
    },
    {
        "id": 161,
        "topic": "topic34",
        "question": "What nerve damage can lead to a positive Trendelenburg sign?",
        "answer": "<li>Damage to the superior gluteal nerve can lead to a positive Trendelenburg sign.</li>",
        "memoryTip": "If your gluteal nerve is damaged, it might just be \"super\" tired of holding you up!",
        "emoji": "😴"
    },
    {
        "id": 162,
        "topic": "topic34",
        "question": "What is a potential cause of muscle wasting that can lead to a positive Trendelenburg sign?",
        "answer": "<li>Muscle wasting can lead to a positive Trendelenburg sign due to weakened hip abductors.</li>",
        "memoryTip": "If your muscles are wasting away, they might just be on a diet too strict!",
        "emoji": "🥗"
    },
    {
        "id": 163,
        "topic": "topic35",
        "question": "What is the primary action of the anterior compartment of the thigh?",
        "answer": "<li>The anterior compartment of the thigh extends the leg at the knee joint.</li>",
        "memoryTip": "Think of the anterior compartment as the \"knee extenders\" – always ready to kick!",
        "emoji": "🦵"
    },
    {
        "id": 164,
        "topic": "topic35",
        "question": "What actions are performed by the posterior compartment of the thigh?",
        "answer": "<li>The posterior compartment extends the thigh at the hip joint and flexes the leg at the knee joint.</li>",
        "memoryTip": "The posterior compartment is like a double agent – extending and flexing at the same time!",
        "emoji": "🎭"
    },
    {
        "id": 165,
        "topic": "topic35",
        "question": "What is the function of the medial compartment of the thigh?",
        "answer": "<li>The medial compartment adducts the thigh at the hip joint.</li>",
        "memoryTip": "The medial compartment is the \"thigh hugger,\" always bringing things closer!",
        "emoji": "🤗"
    },
    {
        "id": 166,
        "topic": "topic36",
        "question": "Which muscles are responsible for lateral rotation of the hip?",
        "answer": "<li>The lateral rotators include the internal and external obturators, superior and inferior gemelli, and quadratus femoris.</li>",
        "memoryTip": "Lateral rotators are like the hip's dance crew, always spinning to the left!",
        "emoji": "💃"
    },
    {
        "id": 167,
        "topic": "topic36",
        "question": "What muscles are medial rotators of the hip?",
        "answer": "<li>The medial rotators include the tensor fascia lata, gluteus medius, and anterior fibers of the gluteus minimus.</li>",
        "memoryTip": "Medial rotators are the hip's \"inner circle,\" always keeping things close!",
        "emoji": "🔄"
    },
    {
        "id": 168,
        "topic": "topic36",
        "question": "Which muscles are considered flexors of the hip?",
        "answer": "<li>The flexors of the hip include the psoas major and iliacus.</li>",
        "memoryTip": "Flexors are like the hip's personal trainers, always getting you to bend and stretch!",
        "emoji": "🏋️"
    },
    {
        "id": 169,
        "topic": "topic36",
        "question": "What muscles are responsible for extending the hip?",
        "answer": "<li>The extensor muscles of the hip include the gluteus maximus and hamstrings.</li>",
        "memoryTip": "Extensors are the \"backstretchers,\" always ready to pull you back up!",
        "emoji": "🧘"
    },
    {
        "id": 170,
        "topic": "topic36",
        "question": "Which muscles act as abductors of the hip?",
        "answer": "<li>The abductors of the hip include the gluteus medius and gluteus minimus.</li>",
        "memoryTip": "Abductors are like the hip's bouncers, keeping things from getting too close!",
        "emoji": "🚷"
    },
    {
        "id": 171,
        "topic": "topic36",
        "question": "What muscles are involved in adduction of the hip?",
        "answer": "<li>The adductors include the adductor longus, adductor magnus, and adductor brevis.</li>",
        "memoryTip": "Adductors are the \"thigh closers,\" always bringing things back together!",
        "emoji": "🤝"
    },
    {
        "id": 172,
        "topic": "topic37",
        "question": "What is the principal muscle responsible for knee extension?",
        "answer": "<li>The principal muscle for knee extension is the quadriceps femoris.</li>",
        "memoryTip": "Quadriceps are like the knee's \"power lifters,\" always pushing you up!",
        "emoji": "💪"
    },
    {
        "id": 173,
        "topic": "topic37",
        "question": "Which accessory muscle assists in knee extension?",
        "answer": "<li>The tensor fascia lata assists in knee extension.</li>",
        "memoryTip": "The tensor fascia lata is like the knee's sidekick, always there to help lift!",
        "emoji": "🦸"
    },
    {
        "id": 174,
        "topic": "topic37",
        "question": "What muscles are responsible for knee flexion?",
        "answer": "<li>The muscles responsible for knee flexion include the biceps femoris, semitendinosus, and semimembranosus.</li>",
        "memoryTip": "Flexors are like the knee's \"curlers,\" always getting you to bend down!",
        "emoji": "🌀"
    },
    {
        "id": 175,
        "topic": "topic37",
        "question": "Which accessory muscles assist in knee flexion?",
        "answer": "<li>Accessory muscles for knee flexion include gracilis, sartorius, and popliteus.</li>",
        "memoryTip": "Accessory muscles are the knee's \"friends,\" always helping out when it’s time to bend!",
        "emoji": "👯"
    },
    {
        "id": 176,
        "topic": "topic37",
        "question": "What muscles are involved in medial rotation of a flexed leg?",
        "answer": "<li>The muscles involved in medial rotation of a flexed leg include the semimembranosus, semitendinosus, and popliteus.</li>",
        "memoryTip": "Medial rotators are like the knee's \"turning team,\" always ready to spin!",
        "emoji": "🔄"
    },
    {
        "id": 177,
        "topic": "topic37",
        "question": "Which muscle is responsible for lateral rotation of a flexed leg?",
        "answer": "<li>The biceps femoris is responsible for lateral rotation of a flexed leg.</li>",
        "memoryTip": "The biceps femoris is the \"twist master,\" always ready to turn things around!",
        "emoji": "🌀"
    },
    {
        "id": 178,
        "topic": "topic38",
        "question": "What happens to the medial border of the foot during inversion?",
        "answer": "<li>The medial border of the foot is elevated.</li>",
        "memoryTip": "Think of the foot doing a little dance, lifting its inner edge like it's trying to impress someone!",
        "emoji": "🕺"
    },
    {
        "id": 179,
        "topic": "topic38",
        "question": "What happens to the lateral border of the foot during eversion?",
        "answer": "<li>The lateral border of the foot is elevated.</li>",
        "memoryTip": "Imagine the foot trying to show off its outer edge like a proud peacock!",
        "emoji": "🦚"
    },
    {
        "id": 180,
        "topic": "topic38",
        "question": "How does the sole of the foot face during inversion?",
        "answer": "<li>The sole faces medially.</li>",
        "memoryTip": "Picture the sole as a compass, always pointing towards the center during inversion!",
        "emoji": "🧭"
    },
    {
        "id": 181,
        "topic": "topic38",
        "question": "How does the sole of the foot face during eversion?",
        "answer": "<li>The sole faces laterally.</li>",
        "memoryTip": "Think of the sole as a sunbather, turning to face the side during eversion!",
        "emoji": "🏖️"
    },
    {
        "id": 182,
        "topic": "topic38",
        "question": "What type of flexion accompanies inversion of the foot?",
        "answer": "<li>Inversion is accompanied by plantar flexion of the foot.</li>",
        "memoryTip": "Imagine the foot planting itself firmly in the ground while it lifts its inner edge!",
        "emoji": "🌱"
    },
    {
        "id": 183,
        "topic": "topic38",
        "question": "What type of flexion accompanies eversion of the foot?",
        "answer": "<li>Eversion is accompanied by dorsiflexion of the foot.</li>",
        "memoryTip": "Picture the foot flexing its toes up to wave hello while it lifts its outer edge!",
        "emoji": "👋"
    },
    {
        "id": 184,
        "topic": "topic38",
        "question": "What movement occurs in the forefoot during inversion?",
        "answer": "<li>Inversion involves adduction of the forefoot.</li>",
        "memoryTip": "Think of the forefoot as a shy child, pulling in closer during inversion!",
        "emoji": "🤭"
    },
    {
        "id": 185,
        "topic": "topic38",
        "question": "What movement occurs in the forefoot during eversion?",
        "answer": "<li>Eversion involves abduction of the forefoot.</li>",
        "memoryTip": "Imagine the forefoot as a child stretching out to make new friends during eversion!",
        "emoji": "🤝"
    },
    {
        "id": 186,
        "topic": "topic39",
        "question": "Which muscles are primarily responsible for plantar flexion?",
        "answer": "<li>The main muscles for plantar flexion are the gastrocnemius and soleus.</li>",
        "memoryTip": "Picture these muscles as the \"planting\" team, always ready to dig in!",
        "emoji": "🌾"
    },
    {
        "id": 187,
        "topic": "topic39",
        "question": "What accessory muscles assist in plantar flexion?",
        "answer": "<li>Accessory muscles for plantar flexion include plantaris, tibialis posterior, flexor hallucis longus, and flexor digitorum longus.</li>",
        "memoryTip": "Think of these accessory muscles as the \"supporting cast\" in a gardening show!",
        "emoji": "🎭"
    },
    {
        "id": 188,
        "topic": "topic39",
        "question": "Which muscle is primarily responsible for dorsiflexion?",
        "answer": "<li>The tibialis anterior is the main muscle responsible for dorsiflexion.</li>",
        "memoryTip": "Imagine the tibialis anterior as the foot's personal trainer, always lifting it up!",
        "emoji": "🏋️"
    },
    {
        "id": 189,
        "topic": "topic39",
        "question": "What accessory muscles assist in dorsiflexion?",
        "answer": "<li>Accessory muscles for dorsiflexion include peroneus tertius, extensor hallucis longus, and flexor digitorum longus.</li>",
        "memoryTip": "Think of these muscles as the cheerleaders, helping the tibialis anterior with every lift!",
        "emoji": "📣"
    },
    {
        "id": 190,
        "topic": "topic39",
        "question": "Which muscles are involved in inversion?",
        "answer": "<li>The main muscles for inversion are tibialis anterior and tibialis posterior.</li>",
        "memoryTip": "Picture these muscles as the \"inward-turning\" duo, always pulling the foot in!",
        "emoji": "🔄"
    },
    {
        "id": 191,
        "topic": "topic39",
        "question": "What accessory muscle assists in inversion?",
        "answer": "<li>The accessory muscles for inversion include flexor hallucis longus and flexor digitorum longus.</li>",
        "memoryTip": "Think of these muscles as the \"extra hands\" helping to pull the foot inward!",
        "emoji": "👐"
    },
    {
        "id": 192,
        "topic": "topic39",
        "question": "Which muscles are responsible for eversion?",
        "answer": "<li>The main muscles for eversion are peroneus longus and peroneus brevis.</li>",
        "memoryTip": "Imagine these muscles as the \"outward-turning\" team, always pushing the foot out!",
        "emoji": "➡️"
    },
    {
        "id": 193,
        "topic": "topic39",
        "question": "What accessory muscle assists in eversion?",
        "answer": "<li>The accessory muscle for eversion is peroneus tertius.</li>",
        "memoryTip": "Think of this muscle as the \"sidekick\" helping the peroneus longus and brevis!",
        "emoji": "🦸"
    },
    {
        "id": 194,
        "topic": "topic40",
        "question": "What is the origin of the long head of the biceps femoris?",
        "answer": "<li>The long head originates from the upper part of the ischial tuberosity.</li>",
        "memoryTip": "Picture the long head as a \"long-distance runner\" starting from the ischial tuberosity!",
        "emoji": "🏃"
    },
    {
        "id": 195,
        "topic": "topic40",
        "question": "What is the origin of the short head of the biceps femoris?",
        "answer": "<li>The short head originates from the lateral lip of the linea aspera and the upper two-thirds of the lateral supracondylar line.</li>",
        "memoryTip": "Imagine the short head as a \"quick sprinter\" taking off from the lateral lip!",
        "emoji": "🏃‍♂️"
    },
    {
        "id": 196,
        "topic": "topic40",
        "question": "Where does the biceps femoris insert?",
        "answer": "<li>The biceps femoris inserts at the head of the fibula.</li>",
        "memoryTip": "Think of the biceps femoris as a \"flag\" planted at the head of the fibula!",
        "emoji": "🚩"
    },
    {
        "id": 197,
        "topic": "topic40",
        "question": "What is the nerve supply for the long head of the biceps femoris?",
        "answer": "<li>The long head is supplied by the tibial part of the sciatic nerve.</li>",
        "memoryTip": "Picture the tibial nerve as a \"tibial taxi\" driving the long head to its destination!",
        "emoji": "🚖"
    },
    {
        "id": 198,
        "topic": "topic40",
        "question": "What is the nerve supply for the short head of the biceps femoris?",
        "answer": "<li>The short head is supplied by the common peroneal part of the sciatic nerve.</li>",
        "memoryTip": "Imagine the common peroneal nerve as a \"common courier\" delivering messages to the short head!",
        "emoji": "📦"
    },
    {
        "id": 199,
        "topic": "topic41",
        "question": "What movements occur at the ankle joint (talocrural joint)?",
        "answer": "<li>The movements at the ankle joint include dorsiflexion and plantar flexion.</li>",
        "memoryTip": "Think of the ankle joint as a seesaw, going up and down with dorsiflexion and plantar flexion!",
        "emoji": "⚖️"
    },
    {
        "id": 200,
        "topic": "topic41",
        "question": "What joints are involved in inversion and eversion?",
        "answer": "<li>Inversion and eversion occur at the subtalar joint, which is divided into anterior and posterior sub-joints.</li>",
        "memoryTip": "Picture the subtalar joint as a dance floor, where the foot can sway side to side!",
        "emoji": "💃"
    },
    {
        "id": 201,
        "topic": "topic41",
        "question": "What are the two sub-joints of the subtalar joint?",
        "answer": "<li>The two sub-joints are the talocalcaneo navicular joint (anterior) and the talocalcanean joint (posterior).</li>",
        "memoryTip": "Imagine these sub-joints as dance partners, moving together in perfect harmony!",
        "emoji": "👯"
    },
    {
        "id": 202,
        "topic": "topic42",
        "question": "What is the femoral sheath?",
        "answer": "<li>The femoral sheath is a funnel-shaped sheath enclosing the upper 3-4 cm of the femoral vessels.</li>",
        "memoryTip": "Think of the femoral sheath as a \"funnel cake,\" holding all the goodies inside!",
        "emoji": "🍰"
    },
    {
        "id": 203,
        "topic": "topic42",
        "question": "What forms the femoral sheath?",
        "answer": "<li>The femoral sheath is formed by the downward extension of two layers of the fascia of the abdomen: fascia transversalis anteriorly and fascia iliaca posteriorly.</li>",
        "memoryTip": "Picture the fascia as a \"layered cake,\" with the transversalis and iliaca as the delicious layers!",
        "emoji": "🎂"
    },
    {
        "id": 204,
        "topic": "topic42",
        "question": "What are the compartments of the femoral sheath?",
        "answer": "<li>The femoral sheath is divided into three compartments: lateral (arterial), intermediate (venous), and medial (lymphatic).</li>",
        "memoryTip": "Imagine the compartments as a \"three-part harmony,\" each playing its own role in the femoral sheath!",
        "emoji": "🎶"
    },
    {
        "id": 205,
        "topic": "topic42",
        "question": "What does the lateral compartment of the femoral sheath contain?",
        "answer": "<li>The lateral compartment contains the femoral artery and the femoral branch of the genitofemoral nerve.</li>",
        "memoryTip": "Think of the lateral compartment as the \"VIP lounge\" for the femoral artery and nerve!",
        "emoji": "🎟️"
    },
    {
        "id": 206,
        "topic": "topic42",
        "question": "What does the intermediate compartment of the femoral sheath contain?",
        "answer": "<li>The intermediate compartment contains the femoral vein.</li>",
        "memoryTip": "Picture the intermediate compartment as the \"waiting room\" for the femoral vein!",
        "emoji": "🛋️"
    },
    {
        "id": 207,
        "topic": "topic42",
        "question": "What is the medial compartment of the femoral sheath called?",
        "answer": "<li>The medial compartment is the smallest and is called the femoral canal.</li>",
        "memoryTip": "Imagine the femoral canal as a \"tiny tunnel\" where only the smallest things can pass!",
        "emoji": "🚪"
    },
    {
        "id": 208,
        "topic": "topic42",
        "question": "What are the boundaries of the femoral canal?",
        "answer": "<li>The anterior boundary of the femoral canal is the inguinal ligament.</li>",
        "memoryTip": "Think of the inguinal ligament as the \"gatekeeper\" of the femoral canal!",
        "emoji": "🚪"
    },
    {
        "id": 209,
        "topic": "topic43",
        "question": "What are the lateral boundaries of the Adductor Canal?",
        "answer": "<li>The lateral boundary of the Adductor Canal is the Vastus medialis.</li>",
        "memoryTip": "Think of Vastus medialis as the \"guard\" standing watch at the canal's entrance!",
        "emoji": "🛡️"
    },
    {
        "id": 210,
        "topic": "topic43",
        "question": "What are the posterior boundaries of the Adductor Canal?",
        "answer": "<li>The posterior boundary of the Adductor Canal is formed by the Adductor longus and Adductor magnus.</li>",
        "memoryTip": "Adductors are like the bouncers at a club, keeping things in line behind the scenes!",
        "emoji": "🚪"
    },
    {
        "id": 211,
        "topic": "topic43",
        "question": "What forms the roof of the Adductor Canal?",
        "answer": "<li>The roof of the Adductor Canal is the aponeurotic sheet under the Sartorius.</li>",
        "memoryTip": "The Sartorius is like a cozy blanket covering the canal, keeping everything snug!",
        "emoji": "🛏️"
    },
    {
        "id": 212,
        "topic": "topic43",
        "question": "What are the contents of the Adductor Canal?",
        "answer": "<li>The contents of the Adductor Canal include the femoral vessels, saphenous nerve, and nerve to vastus medialis.</li>",
        "memoryTip": "Think of the canal as a delivery service, bringing essential nerves and vessels to the party!",
        "emoji": "📦"
    },
    {
        "id": 213,
        "topic": "topic44",
        "question": "Which arteries form an extra capsular arterial ring around the base of the femoral neck?",
        "answer": "<li>The medial femoral circumflex artery and lateral femoral circumflex artery form the extra capsular arterial ring.</li>",
        "memoryTip": "These arteries are like a supportive ring of friends around the femoral neck, always there to help!",
        "emoji": "💍"
    },
    {
        "id": 214,
        "topic": "topic44",
        "question": "What enhances the arterial ring around the femoral neck?",
        "answer": "<li>The arterial ring is enhanced by the superior and inferior gluteal arteries.</li>",
        "memoryTip": "Gluteal arteries are like the cheerleaders of the arterial ring, boosting its strength!",
        "emoji": "📣"
    },
    {
        "id": 215,
        "topic": "topic44",
        "question": "What artery supplies blood to the ligamentum teres?",
        "answer": "<li>The artery of the ligamentum teres is derived from the obturator artery or the medial femoral circumflex artery.</li>",
        "memoryTip": "Think of the ligamentum teres as a VIP guest, getting special treatment from its artery!",
        "emoji": "🎟️"
    },
    {
        "id": 216,
        "topic": "topic44",
        "question": "What type of fractures are most common in the femoral neck?",
        "answer": "<li>Most femoral neck fractures are intracapsular, disrupting the sub synovial intra-articular ring.</li>",
        "memoryTip": "Intracapsular fractures are like sneaky ninjas, breaking in where you least expect it!",
        "emoji": "🥷"
    },
    {
        "id": 217,
        "topic": "topic44",
        "question": "How does the fracture line in intertrochanteric fractures typically run?",
        "answer": "<li>The fracture line in intertrochanteric fractures usually runs from the greater trochanter to the lesser trochanter and does not involve the femoral neck.</li>",
        "memoryTip": "Intertrochanteric fractures are like a highway that avoids the neck, taking a scenic route instead!",
        "emoji": "🛣️"
    },
    {
        "id": 218,
        "topic": "topic44",
        "question": "Do intertrochanteric fractures affect the blood supply to the femoral neck?",
        "answer": "<li>No, intertrochanteric fractures preserve the femoral neck blood supply and do not render the femoral head ischemic.</li>",
        "memoryTip": "Intertrochanteric fractures are like a safe detour that keeps the blood flowing smoothly!",
        "emoji": "🚦"
    },
    {
        "id": 219,
        "topic": "topic45",
        "question": "What is the patella commonly known as?",
        "answer": "<li>The patella is commonly known as the knee cap.</li>",
        "memoryTip": "The patella is the \"cap\" that keeps your knee from getting too chilly!",
        "emoji": "🧢"
    },
    {
        "id": 220,
        "topic": "topic45",
        "question": "What is the largest sesamoid bone in the body?",
        "answer": "<li>The patella is the largest sesamoid bone in the body.</li>",
        "memoryTip": "The patella is like the king of sesamoid bones, ruling over the knee kingdom!",
        "emoji": "👑"
    },
    {
        "id": 221,
        "topic": "topic45",
        "question": "Within which tendon is the patella formed?",
        "answer": "<li>The patella is formed within the tendon of the quadriceps femoris.</li>",
        "memoryTip": "The quadriceps tendon is like a cozy nest where the patella is born!",
        "emoji": "🐣"
    },
    {
        "id": 222,
        "topic": "topic45",
        "question": "What shape is the patella?",
        "answer": "<li>The patella is triangular in shape.</li>",
        "memoryTip": "The patella is like a slice of pizza, triangular and perfect for sharing!",
        "emoji": "🍕"
    },
    {
        "id": 223,
        "topic": "topic45",
        "question": "Where is the apex of the patella pointed?",
        "answer": "<li>The apex of the patella is pointed inferiorly for attachment to the patellar ligament.</li>",
        "memoryTip": "The apex points down like a compass, guiding the patellar ligament to its destination!",
        "emoji": "🧭"
    },
    {
        "id": 224,
        "topic": "topic45",
        "question": "What is the base of the patella used for?",
        "answer": "<li>The base of the patella is broad and thick for the attachment of the quadriceps femoris muscle.</li>",
        "memoryTip": "The base is like a sturdy platform, supporting the mighty quadriceps muscle!",
        "emoji": "🏗️"
    },
    {
        "id": 225,
        "topic": "topic45",
        "question": "What is the arterial supply to the patella?",
        "answer": "<li>The arterial supply to the patella comes from the genicular anastomosis, particularly from the superior and inferior genicular arteries and the anterior tibial recurrent artery.</li>",
        "memoryTip": "The patella has a VIP pass to the arterial supply party, with multiple arteries in attendance!",
        "emoji": "🎉"
    },
    {
        "id": 226,
        "topic": "topic45",
        "question": "What condition may cause the patella to form separate pieces of bone?",
        "answer": "<li>A bipartite or tripartite patella may occur, which is a bilateral and symmetrical condition.</li>",
        "memoryTip": "The patella can sometimes split like a pair of twins, creating a bipartite or tripartite family!",
        "emoji": "👯"
    },
    {
        "id": 227,
        "topic": "topic46",
        "question": "What shape is the popliteal fossa?",
        "answer": "<li>The popliteal fossa is diamond-shaped.</li>",
        "memoryTip": "The popliteal fossa is like a diamond ring, shining behind the knee!",
        "emoji": "💎"
    },
    {
        "id": 228,
        "topic": "topic46",
        "question": "What forms the margins of the upper part of the popliteal fossa?",
        "answer": "<li>The margins of the upper part of the popliteal fossa are formed medially by the distal ends of the semitendinosus and semimembranosus, and laterally by the distal end of the biceps femoris.</li>",
        "memoryTip": "The muscles are like a team of friends, standing together to form the fossa's upper margins!",
        "emoji": "🤝"
    },
    {
        "id": 229,
        "topic": "topic47",
        "question": "What structures medially define the margins of the popliteal fossa?",
        "answer": "<li>The medial head of the gastrocnemius muscle.</li>",
        "memoryTip": "Think of the medial head as the \"medal\" winner of the gastrocnemius race!",
        "emoji": "🥇"
    },
    {
        "id": 230,
        "topic": "topic47",
        "question": "What structures laterally define the margins of the popliteal fossa?",
        "answer": "<li>The plantaris muscle and the lateral head of the gastrocnemius muscle.</li>",
        "memoryTip": "The lateral head is like the \"lateral\" sidekick in a superhero duo with the plantaris!",
        "emoji": "🦸‍♂️"
    },
    {
        "id": 231,
        "topic": "topic47",
        "question": "What forms the floor of the popliteal fossa?",
        "answer": "<li>The capsule of the knee joint, surfaces of the femur and tibia, and the popliteus muscle.</li>",
        "memoryTip": "The floor is like a \"knee joint carpet\" made of femur, tibia, and popliteus!",
        "emoji": "🛋️"
    },
    {
        "id": 232,
        "topic": "topic47",
        "question": "What forms the roof of the popliteal fossa?",
        "answer": "<li>The deep fascia, which is continuous with the fascia lata of the thigh and the deep fascia of the leg below.</li>",
        "memoryTip": "The roof is like a \"deep fascia hat\" that keeps everything cozy inside!",
        "emoji": "🎩"
    },
    {
        "id": 233,
        "topic": "topic48",
        "question": "What are the main contents of the popliteal fossa?",
        "answer": "<li>The popliteal artery and its branches, popliteal vein and its tributaries, tibial nerve and its branches, common peroneal nerve and its branches, posterior cutaneous nerve of the thigh, genicular branch of the obturator nerve, popliteal lymph nodes, and fat.</li>",
        "memoryTip": "The popliteal fossa is like a \"party\" with arteries, veins, nerves, and even some fat hanging out!",
        "emoji": "🎉"
    },
    {
        "id": 234,
        "topic": "topic48",
        "question": "Which artery is found in the popliteal fossa?",
        "answer": "<li>The popliteal artery.</li>",
        "memoryTip": "The popliteal artery is the \"pop\" star of the fossa!",
        "emoji": "🌟"
    },
    {
        "id": 235,
        "topic": "topic48",
        "question": "Which vein is found in the popliteal fossa?",
        "answer": "<li>The popliteal vein.</li>",
        "memoryTip": "The popliteal vein is the \"vein\" that keeps the party flowing!",
        "emoji": "💧"
    },
    {
        "id": 236,
        "topic": "topic48",
        "question": "What nerves are present in the popliteal fossa?",
        "answer": "<li>The tibial nerve, common peroneal nerve, and posterior cutaneous nerve of the thigh.</li>",
        "memoryTip": "The nerves in the fossa are like the \"nervous\" guests at a party, always buzzing around!",
        "emoji": "⚡"
    },
    {
        "id": 237,
        "topic": "topic49",
        "question": "What structures pass through the roof of the popliteal fossa?",
        "answer": "<li>The small saphenous vein and the posterior cutaneous nerve of the thigh.</li>",
        "memoryTip": "The roof has a \"small saphenous\" door for the \"cutting-edge\" nerve to sneak through!",
        "emoji": "🚪"
    },
    {
        "id": 238,
        "topic": "topic50",
        "question": "What nerve passes through the greater sciatic foramen?",
        "answer": "<li>The sciatic nerve.</li>",
        "memoryTip": "The sciatic nerve is the \"big shot\" that takes the main exit through the foramen!",
        "emoji": "🚀"
    },
    {
        "id": 239,
        "topic": "topic50",
        "question": "Which nerve is associated with the pudendal nerve?",
        "answer": "<li>The internal pudendal nerve.</li>",
        "memoryTip": "The pudendal nerve is like the \"pudgy\" friend who brings snacks to the party!",
        "emoji": "🍩"
    },
    {
        "id": 240,
        "topic": "topic50",
        "question": "What structures pass through the greater sciatic foramen below the piriformis muscle?",
        "answer": "<li>The sciatic nerve, the inferior gluteal nerve, and the posterior femoral cutaneous nerve.</li>",
        "memoryTip": "Below the piriformis, it's a \"sciatic nerve convention\" with all the cool nerves hanging out!",
        "emoji": "🎊"
    },
    {
        "id": 241,
        "topic": "topic51",
        "question": "What type of joint is the hip joint?",
        "answer": "<li>The hip joint is a ball and socket joint of synovial variety.</li>",
        "memoryTip": "The hip joint is like a \"ballerina\" dancing in a socket!",
        "emoji": "🩰"
    },
    {
        "id": 242,
        "topic": "topic51",
        "question": "What factors contribute to the stability of the hip joint?",
        "answer": "<li>The depth of the acetabulum, tension and strength of ligaments, strength of surrounding muscles, length and obliquity of the neck of the femur, and atmospheric pressure.</li>",
        "memoryTip": "The hip joint is stable because it has \"deep\" roots, strong \"ligament\" ties, and a \"muscle\" army backing it up!",
        "emoji": "🏋️‍♂️"
    },
    {
        "id": 243,
        "topic": "topic52",
        "question": "What are the outer longitudinal fibers of the fibrous capsule of the hip joint called?",
        "answer": "<li>The outer longitudinal fibers form the retinacula.</li>",
        "memoryTip": "Think of retinacula as the \"retina\" of the hip, holding everything in place!",
        "emoji": "🦵"
    },
    {
        "id": 244,
        "topic": "topic52",
        "question": "What do the inner circular fibers of the fibrous capsule of the hip joint form?",
        "answer": "<li>The inner circular fibers form the zona orbicularis.</li>",
        "memoryTip": "The zona orbicularis is like a hula hoop for your hip, keeping it all together!",
        "emoji": "🤸"
    },
    {
        "id": 245,
        "topic": "topic52",
        "question": "What is the function of the Heofemoral ligament (ligament of Bigelow)?",
        "answer": "<li>It prevents the trunk from falling backwards while standing.</li>",
        "memoryTip": "The Heofemoral ligament is like a safety net for your trunk, keeping you upright!",
        "emoji": "🏋️"
    },
    {
        "id": 246,
        "topic": "topic52",
        "question": "What does the pubofemoral ligament support?",
        "answer": "<li>It supports the joint inferomedially.</li>",
        "memoryTip": "Think of the pubofemoral ligament as the \"pub\" that supports your hip party!",
        "emoji": "🍻"
    },
    {
        "id": 247,
        "topic": "topic52",
        "question": "What does the ischiofemoral ligament contribute to?",
        "answer": "<li>The ischiofemoral ligament's fibers form the zona orbicularis.</li>",
        "memoryTip": "The ischiofemoral ligament is like a supportive friend, wrapping around to keep things secure!",
        "emoji": "🤗"
    },
    {
        "id": 248,
        "topic": "topic52",
        "question": "What is the role of the ligament of the head of the femur (round ligament or ligamentum teres)?",
        "answer": "<li>It may be thin or weak and transmits the arteries to the head of the femur.</li>",
        "memoryTip": "Think of it as a \"thin line\" connecting the femur to its blood supply!",
        "emoji": "🩸"
    },
    {
        "id": 249,
        "topic": "topic52",
        "question": "What is the function of the transverse ligament of the acetabulum?",
        "answer": "<li>It converts into a foramen that transmits acetabular vessels and nerves to the joint.</li>",
        "memoryTip": "The transverse ligament is like a bridge for vessels and nerves to cross over!",
        "emoji": "🌉"
    },
    {
        "id": 250,
        "topic": "topic52",
        "question": "What condition can result from damage to the retinacular arteries?",
        "answer": "<li>Avascular necrosis of the head of the femur.</li>",
        "memoryTip": "Damage to the arteries is like cutting off the power to a house—everything goes dark!",
        "emoji": "⚡"
    },
    {
        "id": 251,
        "topic": "topic53",
        "question": "What does the fibrous capsule of the knee joint contain?",
        "answer": "<li>It contains ligaments such as the coronary ligament and short lateral ligament.</li>",
        "memoryTip": "The fibrous capsule is like a cozy blanket, wrapping up all the knee ligaments!",
        "emoji": "🛏️"
    },
    {
        "id": 252,
        "topic": "topic53",
        "question": "What is the ligamentum patellae?",
        "answer": "<li>It is the common tendon of insertion of the quadriceps femoris.</li>",
        "memoryTip": "The ligamentum patellae is like the \"patella\" that holds the quadriceps together!",
        "emoji": "🦵"
    },
    {
        "id": 253,
        "topic": "topic53",
        "question": "What does the medial (tibial collateral) ligament correspond to?",
        "answer": "<li>It corresponds to the degenerated tendon of the adductor magnus.</li>",
        "memoryTip": "The medial ligament is like a \"twin\" to the adductor magnus, sharing a family resemblance!",
        "emoji": "👯"
    },
    {
        "id": 254,
        "topic": "topic53",
        "question": "What does the fibular (lateral collateral) ligament represent?",
        "answer": "<li>It represents the femoral attachment of the peroneus longus.</li>",
        "memoryTip": "The fibular ligament is like a buddy system for the peroneus longus, keeping it attached!",
        "emoji": "🤝"
    },
    {
        "id": 255,
        "topic": "topic53",
        "question": "What is the oblique popliteal ligament?",
        "answer": "<li>It is an expansion from the tendon of the semimembranosus.</li>",
        "memoryTip": "The oblique popliteal ligament is like a \"pop\" of support from the semimembranosus!",
        "emoji": "🎉"
    },
    {
        "id": 256,
        "topic": "topic53",
        "question": "What does the arcuate popliteal ligament represent?",
        "answer": "<li>It is a posterior expansion from the short lateral ligament.</li>",
        "memoryTip": "The arcuate popliteal ligament is like a \"curve\" ball thrown from the short lateral!",
        "emoji": "⚾"
    },
    {
        "id": 257,
        "topic": "topic53",
        "question": "What are the cruciate ligaments?",
        "answer": "<li>They are very thick and strong fibrous bands that act as direct bonds of union between the tibia and femur.</li>",
        "memoryTip": "The cruciate ligaments are like the \"crucial\" ties that keep your knee stable!",
        "emoji": "🔗"
    },
    {
        "id": 258,
        "topic": "topic53",
        "question": "What is the role of the cruciate ligaments in the knee joint?",
        "answer": "<li>They maintain anteroposterior stability of the knee joint.</li>",
        "memoryTip": "Think of the cruciate ligaments as the \"stabilizers\" of your knee, keeping it from wobbling!",
        "emoji": "⚖️"
    },
    {
        "id": 259,
        "topic": "topic53",
        "question": "Which cruciate ligament is thicker and stronger?",
        "answer": "<li>The posterior cruciate ligament is thicker and stronger.</li>",
        "memoryTip": "The posterior cruciate is like the \"big brother\" of the knee, always ready to support!",
        "emoji": "👨‍👦"
    },
    {
        "id": 260,
        "topic": "topic53",
        "question": "What supplies the cruciate ligaments?",
        "answer": "<li>They are supplied by middle genicular vessels and nerves.</li>",
        "memoryTip": "The middle genicular vessels are like the \"middlemen\" delivering supplies to the ligaments!",
        "emoji": "🚚"
    },
    {
        "id": 261,
        "topic": "topic53",
        "question": "What is the function of the menisci (semilunar cartilages) in the knee?",
        "answer": "<li>They deepen the articular surfaces of the condyles of the tibia.</li>",
        "memoryTip": "The menisci are like \"pillows\" that make the knee joint more comfortable!",
        "emoji": "🛏️"
    },
    {
        "id": 262,
        "topic": "topic53",
        "question": "What does the transverse ligament connect?",
        "answer": "<li>It connects the anterior ends of the medial and lateral menisci.</li>",
        "memoryTip": "The transverse ligament is like a \"bridge\" connecting two friends (menisci)!",
        "emoji": "🌉"
    },
    {
        "id": 263,
        "topic": "topic53",
        "question": "What is the unlocking muscle of the knee?",
        "answer": "<li>The popliteus muscle is the unlocking muscle of the knee.</li>",
        "memoryTip": "The popliteus is like the \"key\" that unlocks the knee for movement!",
        "emoji": "🔑"
    },
    {
        "id": 264,
        "topic": "topic53",
        "question": "What is the locking muscle of the knee?",
        "answer": "<li>The quadriceps femoris (specifically the vastus medialis) acts as the locking muscle.</li>",
        "memoryTip": "The quadriceps are like the \"locksmith\" that secures the knee in place!",
        "emoji": "🔒"
    },
    {
        "id": 265,
        "topic": "topic53",
        "question": "How does locking of the knee occur?",
        "answer": "<li>Locking occurs by medial rotation of the lower end of the femur on the tibia during terminal stages of extension.</li>",
        "memoryTip": "Locking the knee is like twisting a key to secure the door!",
        "emoji": "🔑"
    },
    {
        "id": 266,
        "topic": "topic53",
        "question": "How does unlocking of the knee occur?",
        "answer": "<li>Unlocking occurs by lateral rotation of the femur on the tibia during early stages of flexion or by medial rotation of the tibia on the femur.</li>",
        "memoryTip": "Unlocking the knee is like turning the key in the opposite direction!",
        "emoji": "🔄"
    },
    {
        "id": 267,
        "topic": "topic53",
        "question": "What is the main role of the menisci of the knee?",
        "answer": "<li>The main role of the menisci is to facilitate rotational movement.</li>",
        "memoryTip": "The menisci are like dance partners, helping the knee to twirl and spin!",
        "emoji": "💃"
    },
    {
        "id": 268,
        "topic": "topic54",
        "question": "What does the superolateral genicular artery anastomose with?",
        "answer": "<li>It anastomoses with the lateral circumflex artery, all the way from the femur.</li>",
        "memoryTip": "The superolateral genicular artery is like a \"friendship\" that connects with the lateral circumflex!",
        "emoji": "🤝"
    },
    {
        "id": 269,
        "topic": "topic54",
        "question": "What are the other genicular arteries around the knee?",
        "answer": "<li>The other genicular arteries include the inferolateral, superomedial, and inferomedial genicular arteries.</li>",
        "memoryTip": "Think of the genicular arteries as a \"genius\" team working together around the knee!",
        "emoji": "🧠"
    },
    {
        "id": 270,
        "topic": "topic54",
        "question": "What forms the anastomosis around the knee joint?",
        "answer": "<li>It is formed by descending and genicular branches from the femoral, popliteal, and lateral circumflex femoral arteries, as well as the circumflex fibular artery and recurrent branches from the anterior tibial artery.</li>",
        "memoryTip": "The anastomosis is like a \"network\" of roads connecting all the arterial highways around the knee!",
        "emoji": "🛣️"
    },
    {
        "id": 271,
        "topic": "topic54",
        "question": "Which nerves innervate the knee joint?",
        "answer": "<li>The knee joint is innervated by branches from the obturator, femoral, tibial, and common fibular nerves.</li>",
        "memoryTip": "The nerves are like a \"team\" of messengers keeping the knee informed!",
        "emoji": "📬"
    },
    {
        "id": 272,
        "topic": "topic54",
        "question": "What is the primary function of the quadriceps muscle?",
        "answer": "<li>The quadriceps muscle is the extensor of the knee.</li>",
        "memoryTip": "The quadriceps are like the \"extenders\" of a handshake, making the knee straight!",
        "emoji": "🤝"
    },
    {
        "id": 273,
        "topic": "topic54",
        "question": "What is the primary function of the hamstrings?",
        "answer": "<li>The hamstrings are the flexors of the knee.</li>",
        "memoryTip": "The hamstrings are like the \"flexible\" friends who help you bend your knee!",
        "emoji": "🤸"
    },
    {
        "id": 274,
        "topic": "topic55",
        "question": "What supports the fibrous capsule of the ankle joint?",
        "answer": "<li>It is supported by strong collateral ligaments on each side.</li>",
        "memoryTip": "The collateral ligaments are like \"sidekicks\" that support the ankle's fibrous capsule!",
        "emoji": "🦸‍♂️"
    },
    {
        "id": 275,
        "topic": "topic55",
        "question": "Where is the fibrous capsule of the ankle joint attached?",
        "answer": "<li>It is attached all around the articular margins except postero-superiorly and antero-inferiorly.</li>",
        "memoryTip": "The fibrous capsule is like a \"wrap\" that covers the ankle, but leaves a little room for movement!",
        "emoji": "🎁"
    },
    {
        "id": 276,
        "topic": "topic55",
        "question": "What is the postero-superior attachment of the fibrous capsule of the ankle joint?",
        "answer": "<li>It is attached to the inferior transverse tibio-fibular ligament.</li>",
        "memoryTip": "The postero-superior attachment is like a \"back door\" that keeps the ankle secure!",
        "emoji": "🚪"
    },
    {
        "id": 277,
        "topic": "topic55",
        "question": "What is the antero-inferior attachment of the fibrous capsule of the ankle joint?",
        "answer": "<li>It is attached to the dorsum of the neck of the talus.</li>",
        "memoryTip": "The antero-inferior attachment is like a \"front porch\" for the talus to welcome movement!",
        "emoji": "🏡"
    },
    {
        "id": 278,
        "topic": "topic56",
        "question": "What muscle is mainly responsible for dorsiflexion of the foot?",
        "answer": "<li>The tibialis anterior.</li>",
        "memoryTip": "Think of the tibialis anterior as the \"dorsiflexion diva\" who loves to show off her toes!",
        "emoji": "👣"
    },
    {
        "id": 279,
        "topic": "topic56",
        "question": "Is there a chance of dislocation during dorsiflexion?",
        "answer": "<li>No, there is no chance of dislocation.</li>",
        "memoryTip": "Dorsiflexion is like a well-behaved guest at a party—no dislocations allowed!",
        "emoji": "🚫"
    },
    {
        "id": 280,
        "topic": "topic56",
        "question": "What muscles are mainly responsible for plantar flexion?",
        "answer": "<li>The gastrocnemius and soleus.</li>",
        "memoryTip": "Gastrocnemius and soleus are like the \"plantar flexion power couple\"—always working together!",
        "emoji": "💪"
    },
    {
        "id": 281,
        "topic": "topic56",
        "question": "Can high heels cause dislocations during plantar flexion?",
        "answer": "<li>Yes, high heels can cause plantar flexion and result in dislocations.</li>",
        "memoryTip": "High heels are like a sneaky villain—looking stylish but ready to cause trouble!",
        "emoji": "👠"
    },
    {
        "id": 282,
        "topic": "topic57",
        "question": "What two muscles cross the deltoid or medial ligament?",
        "answer": "<li>The tibialis posterior and flexor digitorum longus.</li>",
        "memoryTip": "Imagine the tibialis posterior and flexor digitorum longus as two friends crossing a bridge—always together!",
        "emoji": "🌉"
    },
    {
        "id": 283,
        "topic": "topic57",
        "question": "What is the structure of the deltoid ligament?",
        "answer": "<li>It is a very strong triangular ligament present on the medial side of the ankle.</li>",
        "memoryTip": "The deltoid ligament is like a superhero cape—strong and protective on the medial side!",
        "emoji": "🦸‍♂️"
    },
    {
        "id": 284,
        "topic": "topic57",
        "question": "How many parts does the deltoid ligament have?",
        "answer": "<li>It has two parts: superficial and deep.</li>",
        "memoryTip": "Think of the deltoid ligament as a sandwich—superficial on top and deep inside!",
        "emoji": "🥪"
    },
    {
        "id": 285,
        "topic": "topic57",
        "question": "Where are both parts of the deltoid ligament attached?",
        "answer": "<li>Both parts are attached to the medial malleolus.</li>",
        "memoryTip": "The medial malleolus is like the anchor for the deltoid sandwich—holding it all together!",
        "emoji": "⚓"
    },
    {
        "id": 286,
        "topic": "topic58",
        "question": "What are the three components of the superficial part of the deltoid ligament?",
        "answer": "<li>Anterior (tibio navicular), middle (tibio calcanean), and posterior (posterior tibiotalar) fibres.</li>",
        "memoryTip": "The superficial part is like a three-layer cake—each layer has its own special flavor!",
        "emoji": "🎂"
    },
    {
        "id": 287,
        "topic": "topic58",
        "question": "Where do the anterior (tibio navicular) fibres attach?",
        "answer": "<li>They attach to the tuberosity of the navicular bone to the medial margin of the spring ligament.</li>",
        "memoryTip": "The anterior fibres are like a bridge connecting the navicular bone to the spring—always in motion!",
        "emoji": "🌉"
    },
    {
        "id": 288,
        "topic": "topic58",
        "question": "What is the attachment point for the middle (tibio calcanean) fibres?",
        "answer": "<li>They are attached to the whole length of the sustentaculum tali.</li>",
        "memoryTip": "The middle fibres are like a long road trip along the sustentaculum—no shortcuts!",
        "emoji": "🛣️"
    },
    {
        "id": 289,
        "topic": "topic58",
        "question": "Where do the posterior (posterior tibiotalar) fibres attach?",
        "answer": "<li>They attach to the medial tubercle and medial surface of the talus.</li>",
        "memoryTip": "The posterior fibres are like a cozy blanket wrapping around the talus—keeping it warm!",
        "emoji": "🛌"
    },
    {
        "id": 290,
        "topic": "topic59",
        "question": "What do the deep (anterior tibio talar) fibres attach to?",
        "answer": "<li>They are attached to the anterior part of the medial surface of the talus.</li>",
        "memoryTip": "The deep fibres are like the foundation of a house—supporting everything above!",
        "emoji": "🏠"
    },
    {
        "id": 291,
        "topic": "topic60",
        "question": "What muscle crosses the lateral ligament?",
        "answer": "<li>The peroneus longus.</li>",
        "memoryTip": "The peroneus longus is like a dancer crossing the stage—always moving gracefully!",
        "emoji": "💃"
    },
    {
        "id": 292,
        "topic": "topic60",
        "question": "How many bands does the lateral ligament have?",
        "answer": "<li>It has three bands.</li>",
        "memoryTip": "The three bands of the lateral ligament are like a trio of musicians playing in harmony!",
        "emoji": "🎶"
    },
    {
        "id": 293,
        "topic": "topic60",
        "question": "What is the attachment point for the anterior talofibular ligament?",
        "answer": "<li>It runs from the lateral malleolus to the neck of the talus.</li>",
        "memoryTip": "The anterior talofibular ligament is like a bridge connecting the malleolus to the talus—always reliable!",
        "emoji": "🌉"
    },
    {
        "id": 294,
        "topic": "topic60",
        "question": "Where does the posterior talofibular ligament attach?",
        "answer": "<li>It attaches from the malleolar fossa of the fibula to the lateral tubercle of the talus.</li>",
        "memoryTip": "The posterior talofibular ligament is like a secret passageway—connecting two important landmarks!",
        "emoji": "🗝️"
    },
    {
        "id": 295,
        "topic": "topic60",
        "question": "What is the attachment point for the calcaneofibular ligament?",
        "answer": "<li>It runs from the lateral malleolus to the lateral surface of the calcaneum.</li>",
        "memoryTip": "The calcaneofibular ligament is like a tightrope walker—balancing between the malleolus and calcaneum!",
        "emoji": "🎪"
    },
    {
        "id": 296,
        "topic": "topic61",
        "question": "What is the calcaneus?",
        "answer": "<li>The calcaneus is the heel and the inferior-most aspect of the foot.</li>",
        "memoryTip": "The calcaneus is like the foundation of a house—strong and supportive!",
        "emoji": "🏡"
    },
    {
        "id": 297,
        "topic": "topic61",
        "question": "What type of bone primarily makes up the calcaneus?",
        "answer": "<li>It is made primarily of cancellous bone.</li>",
        "memoryTip": "Cancellous bone is like a sponge—light and strong, perfect for the heel!",
        "emoji": "🧽"
    },
    {
        "id": 298,
        "topic": "topic61",
        "question": "How many articular surfaces does the calcaneus have that articulate with the talus?",
        "answer": "<li>It has three articular surfaces: posterior, middle, and anterior.</li>",
        "memoryTip": "The three surfaces are like a trio of friends—always sticking together at the subtalar joint!",
        "emoji": "👯‍♂️"
    },
    {
        "id": 299,
        "topic": "topic61",
        "question": "What is the talus?",
        "answer": "<li>The talus is the ankle-region bone that articulates with the tibia, fibula, and navicular bone.</li>",
        "memoryTip": "The talus is like the central hub of a wheel—connecting all the important bones!",
        "emoji": "⚙️"
    },
    {
        "id": 300,
        "topic": "topic61",
        "question": "Does the talus have any blood vessels?",
        "answer": "<li>No, there are no blood vessels going to the talus; its blood supply comes from the sinus tarsi.</li>",
        "memoryTip": "The talus is like a celebrity—no blood vessels, just a lot of fans (blood supply) from afar!",
        "emoji": "🌟"
    },
    {
        "id": 301,
        "topic": "topic61",
        "question": "Are there any muscle attachments to the talus?",
        "answer": "<li>No, there are no muscle attachments to the talus.</li>",
        "memoryTip": "The talus is like a free spirit—no strings attached!",
        "emoji": "🕊️"
    },
    {
        "id": 302,
        "topic": "topic61",
        "question": "How many facets does the talus have that articulate with the calcaneus?",
        "answer": "<li>It has three facets: posterior, middle, and anterior.</li>",
        "memoryTip": "The facets are like a three-part harmony—each one plays its own role in the ankle!",
        "emoji": "🎤"
    },
    {
        "id": 303,
        "topic": "topic62",
        "question": "What is the cuboid bone?",
        "answer": "<li>The cuboid bone is the most lateral tarsal bone, located near the 5th digit.</li>",
        "memoryTip": "The cuboid bone is like the \"cool kid\" hanging out on the side—always near the 5th digit!",
        "emoji": "😎"
    },
    {
        "id": 304,
        "topic": "topic62",
        "question": "What is the navicular bone?",
        "answer": "<li>The navicular bone is the most medial and proximal tarsal bone, articulating with the talus and calcaneus.</li>",
        "memoryTip": "The navicular bone is like the \"star player\" of the tarsal bones—always in the spotlight!",
        "emoji": "🌟"
    },
    {
        "id": 305,
        "topic": "topic62",
        "question": "What is unique about the navicular bone?",
        "answer": "<li>It has a palpable navicular tuberosity.</li>",
        "memoryTip": "The navicular tuberosity is like a trophy—easy to find and show off!",
        "emoji": "🏆"
    },
    {
        "id": 306,
        "topic": "topic62",
        "question": "What are the lateral, intermediate, and medial cuneiform bones?",
        "answer": "<li>They are the most distal tarsal bones, located on the lateral side and articulating with the metatarsals.</li>",
        "memoryTip": "The cuneiform bones are like a family of three—always sticking together on the lateral side!",
        "emoji": "👨‍👩‍👧"
    },
    {
        "id": 307,
        "topic": "topic62",
        "question": "What is the intermediate tarsal bone?",
        "answer": "<li>The intermediate tarsal bone is the navicular, which articulates with the talus.</li>",
        "memoryTip": "The intermediate tarsal bone is like the middle child—always connecting the important ones!",
        "emoji": "👶"
    },
    {
        "id": 308,
        "topic": "topic62",
        "question": "What is special about the intermediate tarsal bone?",
        "answer": "<li>It has a prominent rounded tuberosity for the attachment of the tibialis posterior tendon.</li>",
        "memoryTip": "The tuberosity is like a VIP lounge for the tibialis posterior tendon—exclusive access only!",
        "emoji": "🎟️"
    },
    {
        "id": 309,
        "topic": "topic63",
        "question": "How many metatarsal bones are there?",
        "answer": "<li>There are five metatarsal bones.</li>",
        "memoryTip": "The five metatarsal bones are like the fingers of your foot—always ready to point the way!",
        "emoji": "🖐️"
    },
    {
        "id": 310,
        "topic": "topic63",
        "question": "Which metatarsal is associated with the great toe?",
        "answer": "<li>Metatarsal I is associated with the great toe and is the shortest and thickest.</li>",
        "memoryTip": "Metatarsal I is like the \"big boss\" of the metatarsals—short but strong!",
        "emoji": "👑"
    },
    {
        "id": 311,
        "topic": "topic63",
        "question": "Which metatarsal is the longest?",
        "answer": "<li>The second metatarsal is the longest.</li>",
        "memoryTip": "The second metatarsal is like the \"tallest sibling\" in the family—always standing out!",
        "emoji": "📏"
    },
    {
        "id": 312,
        "topic": "topic63",
        "question": "What does the plantar surface of the head of metatarsal I articulate with?",
        "answer": "<li>It articulates with two sesamoid bones.</li>",
        "memoryTip": "The sesamoid bones are like the \"sidekicks\" of metatarsal I—always there to support!",
        "emoji": "👫"
    },
    {
        "id": 313,
        "topic": "topic63",
        "question": "How do the bases of metatarsals II to V articulate?",
        "answer": "<li>The sides of the bases of metatarsals II to V articulate with each other.</li>",
        "memoryTip": "The bases of metatarsals II to V are like a group of friends holding hands—always connected!",
        "emoji": "🤝"
    },
    {
        "id": 314,
        "topic": "topic63",
        "question": "What is unique about the lateral side of the base of metatarsal V?",
        "answer": "<li>It has a prominent tuberosity for the attachment of the tendon of the fibularis brevis.</li>",
        "memoryTip": "The tuberosity on metatarsal V is like a welcome mat for the fibularis brevis—come on in!",
        "emoji": "🏡"
    },
    {
        "id": 315,
        "topic": "topic63",
        "question": "What tendons attach to the first metatarsal?",
        "answer": "<li>The first metatarsal receives attachments from the tibialis anterior tendon medially and the peroneus longus tendon on its plantar aspect.</li>",
        "memoryTip": "The first metatarsal is like a popular hangout spot—everyone wants to attach there!",
        "emoji": "🏖️"
    },
    {
        "id": 316,
        "topic": "topic64",
        "question": "What is the action of the flexor digitorum brevis?",
        "answer": "<li>Flexion of toes.</li>",
        "memoryTip": "Think of a breather who flexes their toes to take a break!",
        "emoji": "🦶"
    },
    {
        "id": 317,
        "topic": "topic64",
        "question": "Which nerve innervates the flexor digitorum brevis?",
        "answer": "<li>Medial plantar nerve.</li>",
        "memoryTip": "The medial plantar nerve is like a friendly neighbor who always helps you flex your toes!",
        "emoji": "🤝"
    },
    {
        "id": 318,
        "topic": "topic64",
        "question": "What is the action of the abductor hallucis?",
        "answer": "<li>Abduction of the great toe.</li>",
        "memoryTip": "The abductor hallucis is like a bouncer at a club, making sure the great toe gets the VIP treatment!",
        "emoji": "🎉"
    },
    {
        "id": 319,
        "topic": "topic64",
        "question": "Which nerve innervates the abductor hallucis?",
        "answer": "<li>Medial plantar nerve.</li>",
        "memoryTip": "Just like the flexor digitorum brevis, the abductor hallucis has the same friendly neighbor!",
        "emoji": "👥"
    },
    {
        "id": 320,
        "topic": "topic64",
        "question": "What is the action of the abductor digiti minimi?",
        "answer": "<li>Abduction of the little toe.</li>",
        "memoryTip": "The little toe wants to party too, and the abductor digiti minimi is the life of the party!",
        "emoji": "🎈"
    },
    {
        "id": 321,
        "topic": "topic64",
        "question": "Which nerve innervates the abductor digiti minimi?",
        "answer": "<li>Main trunk of lateral plantar nerve.</li>",
        "memoryTip": "The lateral plantar nerve is like the cool uncle who takes the little toe out for fun!",
        "emoji": "🕶️"
    },
    {
        "id": 322,
        "topic": "topic64",
        "question": "What is the action of the flexor digitorum longus?",
        "answer": "<li>Plantar flexion of the lateral four toes and plantar flexion of the ankle.</li>",
        "memoryTip": "The flexor digitorum longus is like a yoga instructor helping your toes stretch and flex!",
        "emoji": "🧘"
    },
    {
        "id": 323,
        "topic": "topic64",
        "question": "Which nerve innervates the flexor digitorum longus?",
        "answer": "<li>Tibial nerve.</li>",
        "memoryTip": "The tibial nerve is like a supportive friend who helps you flex your toes during yoga!",
        "emoji": "🤸"
    },
    {
        "id": 324,
        "topic": "topic64",
        "question": "What is the action of the flexor digitorum accessories?",
        "answer": "<li>Flexion of toes.</li>",
        "memoryTip": "Think of the flexor digitorum accessories as the backup dancers for your toes!",
        "emoji": "🎤"
    },
    {
        "id": 325,
        "topic": "topic64",
        "question": "Which nerve innervates the flexor digitorum accessories?",
        "answer": "<li>Main trunk of lateral plantar nerve.</li>",
        "memoryTip": "The lateral plantar nerve is always ready to support the backup dancers!",
        "emoji": "🎶"
    },
    {
        "id": 326,
        "topic": "topic64",
        "question": "What is the action of the lumbricals?",
        "answer": "<li>Extension of the digit.</li>",
        "memoryTip": "Lumbricals are like the puppeteers, pulling the strings to extend your toes!",
        "emoji": "🎭"
    },
    {
        "id": 327,
        "topic": "topic64",
        "question": "How are the lumbricals innervated?",
        "answer": "<li>The first lumbrical is innervated by the medial plantar nerve, while the other three are innervated by the deep branch of the lateral plantar nerve.</li>",
        "memoryTip": "It's a team effort: one friend helps the first lumbrical, while the others get support from the deep branch!",
        "emoji": "🤝"
    },
    {
        "id": 328,
        "topic": "topic64",
        "question": "What is the action of the flexor hallucis longus?",
        "answer": "<li>Plantar flexion of the big toe and ankle joint.</li>",
        "memoryTip": "The flexor hallucis longus is like a strong athlete, flexing the big toe for a powerful kick!",
        "emoji": "🥅"
    },
    {
        "id": 329,
        "topic": "topic64",
        "question": "Which nerve innervates the flexor hallucis longus?",
        "answer": "<li>Tibial nerve.</li>",
        "memoryTip": "The tibial nerve is the coach cheering on the flexor hallucis longus during the big game!",
        "emoji": "📣"
    },
    {
        "id": 330,
        "topic": "topic64",
        "question": "What is the action of the flexor hallucis brevis?",
        "answer": "<li>Flexion of the proximal phalanx of the great toe.</li>",
        "memoryTip": "The flexor hallucis brevis is like a toe gymnast, flexing the great toe with style!",
        "emoji": "🤸‍♂️"
    },
    {
        "id": 331,
        "topic": "topic64",
        "question": "Which nerve innervates the flexor hallucis brevis?",
        "answer": "<li>Medial plantar nerve.</li>",
        "memoryTip": "The medial plantar nerve is the supportive coach for the toe gymnast!",
        "emoji": "🏅"
    },
    {
        "id": 332,
        "topic": "topic64",
        "question": "What is the action of the adductor hallucis?",
        "answer": "<li>Adduction of the great toe.</li>",
        "memoryTip": "The adductor hallucis is like a traffic cop, guiding the great toe back into the lane!",
        "emoji": "🚦"
    },
    {
        "id": 333,
        "topic": "topic64",
        "question": "Which nerve innervates the adductor hallucis?",
        "answer": "<li>Deep branch of the lateral plantar nerve.</li>",
        "memoryTip": "The deep branch is like the undercover officer keeping the great toe in check!",
        "emoji": "👮"
    },
    {
        "id": 334,
        "topic": "topic64",
        "question": "What is the action of the flexor digiti minimi brevis?",
        "answer": "<li>Flexion of the proximal phalanx of the little toe.</li>",
        "memoryTip": "The flexor digiti minimi brevis is like a little toe cheerleader, flexing with enthusiasm!",
        "emoji": "📣"
    },
    {
        "id": 335,
        "topic": "topic64",
        "question": "Which nerve innervates the flexor digiti minimi brevis?",
        "answer": "<li>Superficial branch of the lateral plantar nerve.</li>",
        "memoryTip": "The superficial branch is like the friendly fan cheering for the little toe!",
        "emoji": "🎊"
    },
    {
        "id": 336,
        "topic": "topic64",
        "question": "What is the action of the plantar interossei?",
        "answer": "<li>Adduction of the toes.</li>",
        "memoryTip": "The plantar interossei are like a dance crew, bringing the toes together for a group hug!",
        "emoji": "🤗"
    },
    {
        "id": 337,
        "topic": "topic64",
        "question": "What is the action of the dorsal interossei?",
        "answer": "<li>Abduction of the toes.</li>",
        "memoryTip": "The dorsal interossei are like a party crew, spreading the toes out for a dance-off!",
        "emoji": "💃"
    },
    {
        "id": 338,
        "topic": "topic65",
        "question": "What structure passes deep to the flexor retinaculum first (from medial to lateral)?",
        "answer": "<li>Tibialis posterior tendon.</li>",
        "memoryTip": "The tibialis posterior tendon is like the first runner in a relay race, leading the way!",
        "emoji": "🏃‍♂️"
    },
    {
        "id": 339,
        "topic": "topic65",
        "question": "What structure follows the tibialis posterior tendon deep to the flexor retinaculum?",
        "answer": "<li>Flexor digitorum longus.</li>",
        "memoryTip": "The flexor digitorum longus is like the second runner, keeping the pace steady!",
        "emoji": "🏃‍♀️"
    },
    {
        "id": 340,
        "topic": "topic65",
        "question": "What structure is the third to pass deep to the flexor retinaculum?",
        "answer": "<li>Posterior tibial artery.</li>",
        "memoryTip": "The posterior tibial artery is like the water station, providing essential support!",
        "emoji": "💧"
    },
    {
        "id": 341,
        "topic": "topic65",
        "question": "What structure is the fourth to pass deep to the flexor retinaculum?",
        "answer": "<li>Tibial nerve.</li>",
        "memoryTip": "The tibial nerve is like the coach, guiding the team through the race!",
        "emoji": "📋"
    },
    {
        "id": 342,
        "topic": "topic65",
        "question": "What structure is the fifth to pass deep to the flexor retinaculum?",
        "answer": "<li>Flexor hallucis longus.</li>",
        "memoryTip": "The flexor hallucis longus is like the star player, making a grand entrance!",
        "emoji": "🌟"
    },
    {
        "id": 343,
        "topic": "topic66",
        "question": "What structure passes deep to the extensor retinaculum first (from medial to lateral)?",
        "answer": "<li>Tibialis anterior tendon.</li>",
        "memoryTip": "The tibialis anterior tendon is like the first player on the field, ready to kick off!",
        "emoji": "⚽"
    },
    {
        "id": 344,
        "topic": "topic66",
        "question": "What structure follows the tibialis anterior tendon deep to the extensor retinaculum?",
        "answer": "<li>Extensor hallucis longus.</li>",
        "memoryTip": "The extensor hallucis longus is like the second player, always ready to score!",
        "emoji": "🥅"
    },
    {
        "id": 345,
        "topic": "topic66",
        "question": "What structure is the third to pass deep to the extensor retinaculum?",
        "answer": "<li>Anterior tibial artery with venae comitantes.</li>",
        "memoryTip": "The anterior tibial artery is like the referee, keeping the game flowing smoothly!",
        "emoji": "🏁"
    },
    {
        "id": 346,
        "topic": "topic66",
        "question": "What structure is the fourth to pass deep to the extensor retinaculum?",
        "answer": "<li>Deep peroneal nerve.</li>",
        "memoryTip": "The deep peroneal nerve is like the assistant coach, always in the background supporting the players!",
        "emoji": "👨‍🏫"
    },
    {
        "id": 347,
        "topic": "topic66",
        "question": "What structure is the fifth to pass deep to the extensor retinaculum?",
        "answer": "<li>Extensor digitorum longus.</li>",
        "memoryTip": "The extensor digitorum longus is like the star forward, always ready to make a play!",
        "emoji": "⚡"
    },
    {
        "id": 348,
        "topic": "topic66",
        "question": "What structure is the sixth to pass deep to the extensor retinaculum?",
        "answer": "<li>Peroneus tertius.</li>",
        "memoryTip": "The peroneus tertius is like the surprise player, coming in to steal the show!",
        "emoji": "🎭"
    },
    {
        "id": 349,
        "topic": "topic67",
        "question": "What is the mnemonic for structures passing deep to the flexor retinaculum?",
        "answer": "<li>\"Tabu Deserves A Nice Husband.\"</li>",
        "memoryTip": "Remembering this phrase is like having a secret code for your anatomy exam!",
        "emoji": "🔑"
    },
    {
        "id": 350,
        "topic": "topic67",
        "question": "What is the mnemonic for structures passing deep to the extensor retinaculum?",
        "answer": "<li>\"Tendulkar Had A Nice Day Today.\"</li>",
        "memoryTip": "Just like a cricket match, this mnemonic helps you hit a home run in your studies!",
        "emoji": "🏏"
    },
    {
        "id": 351,
        "topic": "topic68",
        "question": "What does the coraco-acromial ligament prevent?",
        "answer": "<li>Superior displacement of the humeral head.</li>",
        "memoryTip": "Think of it as a safety net for the humeral head, preventing it from taking a tumble!",
        "emoji": "🕸️"
    },
    {
        "id": 352,
        "topic": "topic68",
        "question": "What is the function of the costo-clavicular ligament?",
        "answer": "<li>It transmits some weight of the upper limb to the first rib.</li>",
        "memoryTip": "The costo-clavicular ligament is like a bridge, helping the upper limb cross over to the rib!",
        "emoji": "🌉"
    },
    {
        "id": 353,
        "topic": "topic68",
        "question": "What does the coraco-clavicular ligament do?",
        "answer": "<li>It transmits the weight of the upper limb to the axial skeleton.</li>",
        "memoryTip": "This ligament is like a postal service, delivering weight from the upper limb to the skeleton!",
        "emoji": "📦"
    },
    {
        "id": 354,
        "topic": "topic68",
        "question": "What does the gastro-splenic ligament contain?",
        "answer": "<li>Short gastric vessels.</li>",
        "memoryTip": "The gastro-splenic ligament is like a delivery service for short gastric vessels, ensuring they reach their destination!",
        "emoji": "🚚"
    },
    {
        "id": 355,
        "topic": "topic68",
        "question": "What does the lieno-renal ligament contain?",
        "answer": "<li>Splenic vessels and the tail of the pancreas.</li>",
        "memoryTip": "The lieno-renal ligament is like a VIP lounge for splenic vessels and the pancreas!",
        "emoji": "🎟️"
    },
    {
        "id": 356,
        "topic": "topic68",
        "question": "What does the pubofemoral ligament prevent?",
        "answer": "<li>Over abduction of the hip joint.</li>",
        "memoryTip": "The pubofemoral ligament is like a strict parent, making sure the hip joint doesn’t go too far!",
        "emoji": "🚫"
    },
    {
        "id": 357,
        "topic": "topic68",
        "question": "What does the phrenico-colic ligament prevent?",
        "answer": "<li>Superior dislocation of the spleen.</li>",
        "memoryTip": "The phrenico-colic ligament is like a safety belt for the spleen, keeping it secure!",
        "emoji": "🛡️"
    },
    {
        "id": 358,
        "topic": "topic68",
        "question": "What does the ischiofemoral ligament prevent?",
        "answer": "<li>Hyperextension of the hip joint to some extent.</li>",
        "memoryTip": "The ischiofemoral ligament is like a cautious friend, reminding you not to overdo it!",
        "emoji": "⚠️"
    },
    {
        "id": 359,
        "topic": "topic68",
        "question": "What is the strongest ligament in the body?",
        "answer": "<li>Ilio-femoral or Bigelow ligament.</li>",
        "memoryTip": "The ilio-femoral ligament is like the bodybuilder of ligaments, flexing its strength!",
        "emoji": "💪"
    },
    {
        "id": 360,
        "topic": "topic68",
        "question": "What does the ilio-femoral ligament prevent?",
        "answer": "<li>It prevents the trunk from falling backward and hyperextension of the hip joint during standing.</li>",
        "memoryTip": "This ligament is like a sturdy chair, keeping you upright and steady!",
        "emoji": "🪑"
    },
    {
        "id": 361,
        "topic": "topic69",
        "question": "What is the only intrinsic muscle on the dorsal aspect of the foot?",
        "answer": "<li>Extensor digitorum brevis.</li>",
        "memoryTip": "The extensor digitorum brevis is like the lone wolf on the dorsal side, standing out!",
        "emoji": "🐺"
    },
    {
        "id": 362,
        "topic": "topic69",
        "question": "How are all intrinsic muscles of the foot innervated?",
        "answer": "<li>By the medial and lateral plantar branches of the tibial nerve, except for the extensor digitorum, which is innervated by the deep fibular nerve.</li>",
        "memoryTip": "It’s a family affair with the tibial nerve, but the extensor digitorum has a different family tree!",
        "emoji": "🌳"
    },
    {
        "id": 363,
        "topic": "topic69",
        "question": "Which nerves may innervate the first two dorsal interossei?",
        "answer": "<li>They may receive part of their innervation from the deep fibular nerve.</li>",
        "memoryTip": "The dorsal interossei are like the popular kids, getting attention from multiple friends!",
        "emoji": "👯"
    },
    {
        "id": 364,
        "topic": "topic69",
        "question": "What is the function of the intrinsic muscles of the foot?",
        "answer": "<li>They generate fine movements of the toes.</li>",
        "memoryTip": "The intrinsic muscles are like skilled artists, creating beautiful movements with the toes!",
        "emoji": "🎨"
    },
    {
        "id": 365,
        "topic": "topic70",
        "question": "What structures pass in front of the medial malleolus superficial to the superior peroneal retinaculum?",
        "answer": "<li>The great saphenous vein and the saphenous nerve.</li>",
        "memoryTip": "Think of the great saphenous vein as the \"great\" highway for blood, while the saphenous nerve is the friendly guide giving directions!",
        "emoji": "🛣️"
    },
    {
        "id": 366,
        "topic": "topic70",
        "question": "What structures pass behind the lateral malleolus beneath the superior peroneal retinaculum?",
        "answer": "<li>The sural nerve and the small saphenous vein.</li>",
        "memoryTip": "The sural nerve is like a secret agent sneaking behind the lateral malleolus, while the small saphenous vein is its trusty sidekick!",
        "emoji": "🕵️‍♂️"
    },
    {
        "id": 367,
        "topic": "topic70",
        "question": "What tendons are located behind the lateral malleolus?",
        "answer": "<li>The peroneus longus and brevis tendons.</li>",
        "memoryTip": "Imagine the peroneus longus and brevis as two friends taking a stroll behind the lateral malleolus, enjoying the view!",
        "emoji": "🚶‍♂️"
    },
    {
        "id": 368,
        "topic": "topic71",
        "question": "What condition would prevent a person from walking on unlevel ground easily?",
        "answer": "<li>Subtalar arthritis.</li>",
        "memoryTip": "Subtalar arthritis is like having a flat tire on a bumpy road; you just can't handle the unevenness!",
        "emoji": "🚧"
    },
    {
        "id": 369,
        "topic": "topic71",
        "question": "What is a common symptom of compartment syndrome in the foot?",
        "answer": "<li>Claw toe deformity due to scarring of the quadratus plantar muscle.</li>",
        "memoryTip": "Claw toe deformity is like your toes trying to grab onto something for dear life—just don’t let them!",
        "emoji": "🦶"
    },
    {
        "id": 370,
        "topic": "topic72",
        "question": "What is the Master's Knot of Henry?",
        "answer": "<li>The crossing of the Flexor Digitorum Longus and Flexor Hallucis Longus tendons on the medial side of the foot.</li>",
        "memoryTip": "The Master's Knot of Henry is like a fancy bow tie for your foot tendons—always stylish and a bit complicated!",
        "emoji": "🎀"
    },
    {
        "id": 371,
        "topic": "topic72",
        "question": "What causes a bunion?",
        "answer": "<li>Over-pull and contraction of the Adductor Hallucis muscle.</li>",
        "memoryTip": "A bunion is like your big toe trying to escape a tight shoe—it's just too much pressure!",
        "emoji": "👟"
    },
    {
        "id": 372,
        "topic": "topic73",
        "question": "What is the function of the intra-articular tendon popliteus?",
        "answer": "<li>It helps in the movement of the knee joint.</li>",
        "memoryTip": "The popliteus is like a secret agent in the knee, always working behind the scenes to keep things moving smoothly!",
        "emoji": "🕶️"
    },
    {
        "id": 373,
        "topic": "topic73",
        "question": "When is the ischiofemoral ligament most taut?",
        "answer": "<li>When the femur is extended.</li>",
        "memoryTip": "The ischiofemoral ligament is like a rubber band that gets tight when you stretch it out—just don’t snap it!",
        "emoji": "🏋️‍♂️"
    },
    {
        "id": 374,
        "topic": "topic74",
        "question": "What position locks the ankle joint?",
        "answer": "<li>Dorsiflexion.</li>",
        "memoryTip": "Dorsiflexion is like putting your ankle in a \"lockdown\" mode—no movement allowed!",
        "emoji": "🔒"
    },
    {
        "id": 375,
        "topic": "topic74",
        "question": "What is the name of the bursa that communicates with the knee joint?",
        "answer": "<li>Suprapatellar bursa.</li>",
        "memoryTip": "The suprapatellar bursa is like a friendly messenger between the knee joint and the rest of the leg—always delivering important news!",
        "emoji": "📬"
    },
    {
        "id": 376,
        "topic": "topic75",
        "question": "What is the largest sesamoid bone in the body?",
        "answer": "<li>The patella.</li>",
        "memoryTip": "The patella is like the king of sesamoid bones—always sitting on the throne of the knee!",
        "emoji": "👑"
    },
    {
        "id": 377,
        "topic": "topic75",
        "question": "What is Morton's neuroma?",
        "answer": "<li>An enlarged common plantar nerve, usually found in the 3rd interspace between the 3rd and 4th toes.</li>",
        "memoryTip": "Morton's neuroma is like a party crasher between your toes—too much excitement in a small space!",
        "emoji": "🎉"
    },
    {
        "id": 378,
        "topic": "topic76",
        "question": "What is the highest point of the medial longitudinal arch of the foot?",
        "answer": "<li>The talus.</li>",
        "memoryTip": "The talus is like the mountain peak of your foot's arch—always standing tall!",
        "emoji": "⛰️"
    },
    {
        "id": 379,
        "topic": "topic76",
        "question": "What is the Arteria comitans nervi ischiadici?",
        "answer": "<li>A very small vessel, a branch of the internal iliac artery, representing the primitive axial artery of the lower limb.</li>",
        "memoryTip": "The Arteria comitans nervi ischiadici is like a tiny sidekick that helps the sciatic nerve on its adventures!",
        "emoji": "🦸‍♂️"
    },
    {
        "id": 380,
        "topic": "topic76",
        "question": "What happens to the femoral artery when the Arteria comitans nervi ischiadici remains large?",
        "answer": "<li>The femoral artery is usually much reduced in size.</li>",
        "memoryTip": "When the sidekick gets too big, the hero (femoral artery) has to shrink down to fit in!",
        "emoji": "🦸‍♀️"
    },
    {
        "id": 381,
        "topic": "topic76",
        "question": "What is the role of the articularis genus?",
        "answer": "<li>It originates from the femur and inserts into the suprapatellar bursa, pulling the bursa away from the knee joint during extension.</li>",
        "memoryTip": "The articularis genus is like a helpful assistant, always making sure the bursa has enough space to breathe!",
        "emoji": "🧘‍♂️"
    },
    {
        "id": 382,
        "topic": "topic77",
        "question": "What is the sacrotuberous ligament?",
        "answer": "<li>A modified tendon of the biceps femoris.</li>",
        "memoryTip": "The sacrotuberous ligament is like a modified superhero cape for the biceps femoris—always ready for action!",
        "emoji": "🦸‍♂️"
    },
    {
        "id": 383,
        "topic": "topic77",
        "question": "What is the sacrospinous ligament?",
        "answer": "<li>A degenerate part of the coccygeus.</li>",
        "memoryTip": "The sacrospinous ligament is like the old, wise sage of the ligaments—sometimes a bit worn out but full of wisdom!",
        "emoji": "🧙‍♂️"
    },
    {
        "id": 384,
        "topic": "topic77",
        "question": "Which toes are most commonly involved in overriding toes?",
        "answer": "<li>The 4th and 5th toes.</li>",
        "memoryTip": "Overriding toes are like a game of \"who can stand on top\"—the 4th toe just can’t help but get squished by the 5th!",
        "emoji": "👣"
    },
    {
        "id": 385,
        "topic": "topic78",
        "question": "What bones make up the medial longitudinal arch?",
        "answer": "<li>The medial longitudinal arch is made up of the calcaneus, talus, navicular, three cuneiforms, and their three metatarsals.</li>",
        "memoryTip": "Think of the medial arch as a \"TNC\" (Talus, Navicular, Cuneiforms) party with the calcaneus and metatarsals as the bouncers!",
        "emoji": "🎉"
    },
    {
        "id": 386,
        "topic": "topic78",
        "question": "What bones constitute the lateral longitudinal arch?",
        "answer": "<li>The lateral longitudinal arch is made of the calcaneus, cuboid, and the fourth and fifth metatarsals.</li>",
        "memoryTip": "The lateral arch is like a \"Cuboid Club\" where only the calcaneus and the last two metatarsals are allowed in!",
        "emoji": "🏖️"
    },
    {
        "id": 387,
        "topic": "topic78",
        "question": "What bones are included in the transverse arch?",
        "answer": "<li>The transverse arch is made of the bases of the five metatarsals, the cuboid, and the cuneiforms.</li>",
        "memoryTip": "The transverse arch is like a \"base\" of operations for the metatarsals, cuboid, and cuneiforms to strategize their footwork!",
        "emoji": "🗺️"
    },
    {
        "id": 388,
        "topic": "topic78",
        "question": "What are the pillars of the medial longitudinal arch?",
        "answer": "<li>The pillars of the medial longitudinal arch are the posterior aspect of the calcaneus and the three metatarsal heads.</li>",
        "memoryTip": "Imagine the pillars as the \"support beams\" of a foot skyscraper, holding up the calcaneus and metatarsal heads!",
        "emoji": "🏗️"
    },
    {
        "id": 389,
        "topic": "topic78",
        "question": "What are the pillars of the lateral longitudinal arch?",
        "answer": "<li>The pillars of the lateral longitudinal arch are the calcaneus and the lateral two metatarsal heads.</li>",
        "memoryTip": "The lateral arch's pillars are like a \"two-legged stool\" with the calcaneus as the base and the two metatarsal heads as the legs!",
        "emoji": "🪑"
    },
    {
        "id": 390,
        "topic": "topic78",
        "question": "What is the most important structure maintaining the medial longitudinal arch?",
        "answer": "<li>The most important structure maintaining the medial longitudinal arch is the plantar aponeurosis.</li>",
        "memoryTip": "Think of the plantar aponeurosis as the \"foot's safety net,\" catching everything that tries to fall flat!",
        "emoji": "🕸️"
    },
    {
        "id": 391,
        "topic": "topic78",
        "question": "What ligaments significantly contribute to the lateral longitudinal arch?",
        "answer": "<li>The significant ligaments for the lateral longitudinal arch include the lateral part of the plantar aponeurosis, long plantar ligaments, and short plantar ligaments.</li>",
        "memoryTip": "The lateral arch's ligaments are like a \"team of lifeguards,\" always ready to keep the arch afloat!",
        "emoji": "🏊"
    },
    {
        "id": 392,
        "topic": "topic78",
        "question": "What is the main muscle maintaining the medial longitudinal arch?",
        "answer": "<li>The main muscle maintaining the medial longitudinal arch is the flexor hallucis longus.</li>",
        "memoryTip": "The flexor hallucis longus is like the \"flexing champion\" of the foot, always ready to lift the arch!",
        "emoji": "💪"
    },
    {
        "id": 393,
        "topic": "topic78",
        "question": "What is the main muscle maintaining the lateral longitudinal arch?",
        "answer": "<li>The main muscle maintaining the lateral longitudinal arch is the peroneus longus tendon.</li>",
        "memoryTip": "The peroneus longus tendon is like the \"long-distance runner\" of the foot, keeping the lateral arch in shape!",
        "emoji": "🏃"
    },
    {
        "id": 394,
        "topic": "topic78",
        "question": "Which arch is considered the most important and is primarily affected in pes planus and pes cavus?",
        "answer": "<li>The medial longitudinal arch is considered the most important and is primarily affected in pes planus and pes cavus.</li>",
        "memoryTip": "Think of the medial arch as the \"VIP section\" of the foot, where flat-footed and high-arched guests often clash!",
        "emoji": "🎟️"
    },
    {
        "id": 395,
        "topic": "topic78",
        "question": "What is the main joint of the medial longitudinal arch?",
        "answer": "<li>The main joint of the medial longitudinal arch is the calcaneo-navicular joint.</li>",
        "memoryTip": "The calcaneo-navicular joint is like the \"hinge\" of the medial arch door, swinging open for foot movement!",
        "emoji": "🚪"
    },
    {
        "id": 396,
        "topic": "topic78",
        "question": "What is the main joint of the lateral longitudinal arch?",
        "answer": "<li>The main joint of the lateral longitudinal arch is the calcaneo-cuboid joint.</li>",
        "memoryTip": "The calcaneo-cuboid joint is like the \"pivot point\" of the lateral arch, making sure it doesn't tip over!",
        "emoji": "🔄"
    },
    {
        "id": 397,
        "topic": "topic78",
        "question": "What is metatarsus primus varus?",
        "answer": "<li>Metatarsus primus varus is an adduction deformity of the first metatarsal commonly associated with hallux valgus.</li>",
        "memoryTip": "Metatarsus primus varus is like the \"first metatarsal's rebellious phase,\" trying to go in a different direction!",
        "emoji": "🚶"
    },
    {
        "id": 398,
        "topic": "topic78",
        "question": "What is flat-foot deformity?",
        "answer": "<li>Flat-foot deformity occurs when the longitudinal arch is lost.</li>",
        "memoryTip": "Flat-foot deformity is like the \"arch-nemesis\" of foot arches, flattening all hopes of a high arch!",
        "emoji": "🥲"
    }
];

const topics = {
    "topic1": "1. Nerve Supply of the Lower Limb",
    "topic2": "2. Femoral Nerve",
    "topic3": "3. Obturator Nerve",
    "topic4": "4. Lumbosacral Trunk",
    "topic5": "5. Ilioinguinal and Iliohypogastric Nerves",
    "topic6": "6. Genitofemoral Nerve",
    "topic7": "7. Lateral Femoral Cutaneous Nerve",
    "topic8": "8. Sacral Plexus",
    "topic9": "9. Nerve Supply and Functions",
    "topic10": "10. Sciatic Nerve Overview",
    "topic11": "11. Branches of the Sciatic Nerve",
    "topic12": "12. Course of the Sciatic Nerve",
    "topic13": "13. Relations in the Gluteal Region",
    "topic14": "14. Course in the Thigh",
    "topic15": "15. Relations in the Thigh Region",
    "topic16": "16. Sciatic Nerve",
    "topic17": "17. Common Peroneal Nerve",
    "topic18": "18. General Nerve Information",
    "topic19": "19. Muscular Innervation and Movements",
    "topic20": "20. Cutaneous Innervation",
    "topic21": "21. Nerve Components and Innervation",
    "topic22": "22. Saphenous Nerve",
    "topic23": "23. Obturator Nerve",
    "topic24": "24. Lumbo-Sacral Plexus and Muscular Innervation",
    "topic25": "25. Flexors and Extensors of the Thigh and Leg",
    "topic26": "26. Course of the Femoral Nerve",
    "topic27": "27. Summary of Muscular Innervation",
    "topic28": "28. Arterial Supply of the Lower Limb",
    "topic29": "29. Cutaneous Nerves of the Front of the Thigh",
    "topic30": "30. Popliteal and Related Arteries",
    "topic31": "31. Great Saphenous Vein (GSV)",
    "topic32": "32. Perforators for GSV and SSV",
    "topic33": "33. Muscular Compartments of the Thigh and Leg",
    "topic34": "34. Causes of Positive Trendelenburg Sign",
    "topic35": "35. Muscle Compartments and Actions",
    "topic36": "36. Movements of the Hip Joint",
    "topic37": "37. Movements of the Knee Joint",
    "topic38": "38. Inversion and Eversion of the Foot",
    "topic39": "39. Muscles Involved in Ankle and Subtalar Joint Movements",
    "topic40": "40. Biceps Femoris",
    "topic41": "41. Ankle and Subtalar Joint Movements",
    "topic42": "42. Femoral Sheath and Triangle",
    "topic43": "43. Adductor Canal (Hunter's Canal)",
    "topic44": "44. Blood Supply to the Femoral Head and Neck",
    "topic45": "45. Patella",
    "topic46": "46. Popliteal Fossa",
    "topic47": "47. Popliteal Fossa Anatomy",
    "topic48": "48. Contents of the Popliteal Fossa",
    "topic49": "49. Structures Passing Through the Roof",
    "topic50": "50. Structures Passing Through the Sciatic Foramen",
    "topic51": "51. Hip Joint Anatomy",
    "topic52": "52. Ligaments of the Hip Joint",
    "topic53": "53. Ligaments of the Knee Joint",
    "topic54": "54. Collateral Circulation Around the Knee",
    "topic55": "55. Ligaments of the Ankle Joint",
    "topic56": "56. Dorsiflexion and Plantar Flexion",
    "topic57": "57. Deltoid Ligament",
    "topic58": "58. Superficial Part of the Deltoid Ligament",
    "topic59": "59. Deep Part of the Deltoid Ligament",
    "topic60": "60. Lateral Ligament",
    "topic61": "61. Bones of the Foot",
    "topic62": "62. Tarsal Bones",
    "topic63": "63. Metatarsal Bones",
    "topic64": "64. Muscles of the Sole and Their Innervation",
    "topic65": "65. Structures Passing Deep to Flexor Retinaculum",
    "topic66": "66. Structures Passing Deep to Extensor Retinaculum",
    "topic67": "67. Pneumonics for Structures",
    "topic68": "68. Ligaments and Their Features",
    "topic69": "69. Intrinsic Muscles of the Foot",
    "topic70": "70. Structures Passing in the Ankle Region",
    "topic71": "71. Clinical Conditions Related to the Foot",
    "topic72": "72. Anatomical Features of the Foot",
    "topic73": "73. Ligaments and Tendons",
    "topic74": "74. Joint and Bursa Information",
    "topic75": "75. Nerve and Vascular Anatomy",
    "topic76": "76. Miscellaneous Anatomical Facts",
    "topic77": "77. Ligament Information",
    "topic78": "78. Arches of the Foot"
};












let filteredTopics = [];
let filterStage = null;
let reviewStages = {};
let completedFlashcards = [];
let currentDate = new Date();
const reviewStageColors = { 0: 'red', 1: 'pink', 2: 'blue', 3: 'green' };
let db;
let isStarFilterActive = false;
let isStarReadyFilterActive = false;
let currentFlashcardIndex = 0;
let isHorizontal = false;
let starMarked = {};

function toggleStar(starElement, flashcardId) {
        const isStarred = !starMarked[flashcardId]; // Toggle starred status
      starMarked[flashcardId] = isStarred; // Update local state


      // Update UI Immediately
        starElement.classList.toggle('fas', isStarred);
        starElement.classList.toggle('far', !isStarred);
       starElement.style.color = isStarred ? 'gold' : 'lightgray';
       updateStarredCount(); // Recalculate and update counts
    const transaction = db.transaction([storeName], 'readwrite');
    const store = transaction.objectStore(storeName);
    const request = store.get(flashcardId);

    request.onsuccess = (event) => {
        let data = event.target.result;

        if (data) {
            // Only update the starred field, keep review metrics unchanged
            data.starred = isStarred;
            store.put(data); // Save the updated data with starred status
        } else {
            // Add a new entry with only the starred field (no review metrics)
            store.put({
                id: flashcardId,
                starred: isStarred // Only starred field
            });
        }
    };

    request.onerror = (event) => {
        console.error('Error updating star status:', event.target.errorCode);
    };
}



function openDatabase() {
    const request = indexedDB.open(dbName, 1); // Ensure the version is correct

    request.onupgradeneeded = (event) => {
        db = event.target.result;
        if (!db.objectStoreNames.contains(storeName)) {
            const store = db.createObjectStore(storeName, { keyPath: 'id' });
            store.createIndex('reviewStage', 'reviewStage', { unique: false });
            store.createIndex('dueDate', 'dueDate', { unique: false });
            store.createIndex('starred', 'starred', { unique: false }); // Ensure 'starred' is defined
        }
    };

    request.onsuccess = (event) => {
        db = event.target.result;
        loadProgress(() => {
            updateTopicProgress();
            updateStarredCount();
            renderFlashcards();
        });
    };

    request.onerror = (event) => {
        console.error('Database error:', event.target.errorCode);
    };
}


function saveProgress(id, reviewStage = 0, dueDate = null, revealedTimestamp = null, starred = false) {
    const transaction = db.transaction([storeName], 'readwrite');
    const store = transaction.objectStore(storeName);

    const data = {
        id,
        reviewStage,
        dueDate,
        revealedTimestamp,
        starred // Include starred in the saved data
    };

    store.put(data); // Save both review metrics and starred status together
}



function loadProgress(callback) {
    const transaction = db.transaction([storeName], 'readonly');
    const store = transaction.objectStore(storeName);
    const request = store.getAll();

    request.onsuccess = (event) => {
        const progressData = event.target.result;

        progressData.forEach(progress => {
            if (progress.reviewStage !== undefined && progress.dueDate !== undefined) {
                // Only initialize reviewStages for flashcards with valid review metrics
                reviewStages[progress.id] = {
                    reviewStage: progress.reviewStage,
                    dueDate: progress.dueDate,
                    revealedTimestamp: progress.revealedTimestamp || null
                };
            }
            starMarked[progress.id] = progress.starred ?? false; // Initialize starred state
        });

        console.log('Progress loaded:', progressData);
        if (callback) callback();
    };

    request.onerror = (event) => {
        console.error('Load error:', event.target.errorCode);
    };
}




// Flashcard functions
function selectLayout(value) {
    if (value === 'horizontal') {
        switchToHorizontalLayout();
    } else {
        switchToVerticalLayout();
    }
    applyCurrentFilters();
}

function switchToHorizontalLayout() {
    isHorizontal = true;
    document.body.classList.add('horizontal-layout');
    document.body.classList.remove('vertical-layout');
    currentFlashcardIndex = 0;
    document.getElementById('horizontal-info').style.display = 'block';
    document.querySelector('.navigation-buttons').style.display = 'flex';
    applyCurrentFilters();
}

function switchToVerticalLayout() {
    isHorizontal = false;
    document.body.classList.add('vertical-layout');
    document.body.classList.remove('horizontal-layout');
    document.getElementById('horizontal-info').style.display = 'none';
    document.querySelector('.navigation-buttons').style.display = 'none';
    applyCurrentFilters();
}

function showFlashcard(index) {
    const flashcards = document.querySelectorAll('.modern-card');
    if (index < 0 || index >= flashcards.length) return;

    flashcards.forEach(flashcard => flashcard.style.display = 'none');

    const currentFlashcard = flashcards[index];
    const topic = currentFlashcard.dataset.topic;
    const topicFlashcards = Array.from(flashcards).filter(f => f.dataset.topic === topic);
    const currentPosition = topicFlashcards.indexOf(currentFlashcard) + 1;
    const totalInTopic = topicFlashcards.length;

    document.getElementById('horizontal-topic').textContent = topics[topic];
    document.getElementById('horizontal-position').textContent = `Flashcard ${currentPosition} of ${totalInTopic}`;

    currentFlashcard.style.display = 'block';

    document.getElementById('prev-btn').disabled = index === 0;
    document.getElementById('next-btn').disabled = index === flashcards.length - 1;
}

function navigateFlashcards(direction) {
    const flashcards = document.querySelectorAll('.modern-card');
    if (direction === 'next' && currentFlashcardIndex < flashcards.length - 1) {
        currentFlashcardIndex++;
    } else if (direction === 'prev' && currentFlashcardIndex > 0) {
        currentFlashcardIndex--;
    }
    showFlashcard(currentFlashcardIndex);
}

function updateTopicProgress() {
    const topicSelect = document.getElementById('topic-filter');
    topicSelect.innerHTML = '';

    const allOption = document.createElement('option');
    allOption.value = 'all';
    allOption.textContent = 'All Topics';
    topicSelect.appendChild(allOption);

    Object.keys(topics).forEach(topicKey => {
        const topicName = topics[topicKey];
        const totalFlashcards = flashcards.filter(card => card.topic === topicKey).length;
        const reviewedFlashcards = flashcards.filter(card => card.topic === topicKey && reviewStages[card.id]).length;

        const option = document.createElement('option');
        option.value = topicKey;

        if (reviewedFlashcards === totalFlashcards && totalFlashcards > 0) {
            option.textContent = `${topicName} 🔹(${reviewedFlashcards}/${totalFlashcards}) ✔️`;
        } else {
            option.textContent = `${topicName} 🔹(${reviewedFlashcards}/${totalFlashcards})`;
        }

        topicSelect.appendChild(option);
    });
}

function applySelectedTopics() {
    const topicSelect = document.getElementById('topic-filter');
    const selectedOptions = Array.from(topicSelect.selectedOptions);
    const selectedTopicValues = selectedOptions.map(option => option.value);

    if (selectedTopicValues.includes('all')) {
        filteredTopics = [];
    } else {
        filteredTopics = selectedTopicValues.filter(value => value !== 'all');
    }

    currentFlashcardIndex = 0;
    renderFlashcards();
}

function renderInitialFlashcards() {
    renderFlashcards(true); // Render only the first 50 cards initially
}


function loadRestOfFlashcardsInBackground() {
  // Use a timeout to defer the loading, ensuring the UI thread doesn't get blocked
  setTimeout(() => {
        renderFlashcards(false, true); // Load the rest of the flashcards in the background
  }, 0);
}



    function renderFlashcards(initialLoad = false, appendOnly = false) {
        const flashcardsContainer = document.getElementById('flashcards-container');
        const filterInfoContainer = document.getElementById('filter-info-container');

        if (appendOnly === false) {
            flashcardsContainer.innerHTML = '';
        }
        if (appendOnly === false) {
            filterInfoContainer.innerHTML = '';
        }
        const allTopicsSelected = filteredTopics.length === 0 || filteredTopics.length === Object.keys(topics).length;

        // Update topics and review stage info dynamically
        const selectedTopicsText = allTopicsSelected
            ? 'All Topics'
            : filteredTopics.slice(0, 2).map(topic => topics[topic] || 'All Topics').join(', ') +
            (filteredTopics.length > 2 ? ', <button id="showMoreBtn" onclick="showAllTopics()">More</button>' : '');

        let selectedFilterText = ''; // Dynamic filter text based on active filters

        if (isStarFilterActive) {
            selectedFilterText = `⭐ Showing: Star-marked flashcards of selected topics <br>
                <span style="font-size: 0.9em; color: gray;">(To Exit the Review stage, Click "Show All Flashcards" Button)</span>`;
        } else if (isStarReadyFilterActive) {
            selectedFilterText = `🌟 Showing: Star-marked Ready-for-review flashcards of selected topics <br>
                <span style="font-size: 0.9em; color: gray;">(To Exit the Review stage, Click "Show All Flashcards" Button)</span>`;
        } else if (filterStage !== null) {
            selectedFilterText = `
                Review Stage: ${getReviewStageLabel(filterStage)} <br>
                <span style="font-size: 0.9em; color: gray;">(To Exit the Review stage, Click "Show All Flashcards" Button)</span>`;
        } else {
            selectedFilterText = `Showing all flashcards of selected topics`;
        }

        // Create and display filter info only once for initial load or for all load
        if (appendOnly === false) {
            const filterInfo = document.createElement('div');
            filterInfo.className = 'filter-info';

            // Topics selected line
            const topicsLine = document.createElement('div');
            topicsLine.innerHTML = `<strong style="color: black;">Topics selected:</strong>  ${selectedTopicsText}`;
            filterInfo.appendChild(topicsLine);

            // Add an <hr> for separation
            const separator = document.createElement('hr');
            separator.style.border = '1px solid #ccc';
            separator.style.margin = '10px 0';
            filterInfo.appendChild(separator);

            // Review stage or filter line
            const filterLine = document.createElement('div');
            filterLine.innerHTML = selectedFilterText; // Use innerHTML to support HTML rendering
            filterInfo.appendChild(filterLine);

            filterInfoContainer.appendChild(filterInfo);
        }

        let currentTopic = null;
        let cardsLoaded = 0;
    const limit = initialLoad ? 50 : flashcards.length; // set a limit if its a initial load
        for (let i = 0; i < flashcards.length; i++) {
            if (cardsLoaded >= limit) break; // break out of the loop if the limit is reached

            const flashcard = flashcards[i];
             const reviewStageData = reviewStages[flashcard.id];
              const isStarred = starMarked[flashcard.id];
            const isDue = reviewStageData && new Date(reviewStageData.dueDate) <= currentDate;
            const isTopicMatch = filteredTopics.length === 0 || filteredTopics.includes(flashcard.topic);

            // Match against the "Starred" filter
            let isStarredMatch = isStarFilterActive ? isStarred : true;
           // Match against the "Starred Ready Review" filter
            let isReadyMatch = isStarReadyFilterActive ? (isStarred && isDue) : true;

            // Match against the stage filter
            let isStageMatch = filterStage === null || (reviewStageData?.reviewStage === filterStage && isDue);
             if (filterStage === 4) {
               isStageMatch = reviewStageData?.reviewStage === 4;
            }

            if (isTopicMatch && isStarredMatch && isStageMatch && isReadyMatch) {
                if (!isHorizontal && currentTopic !== flashcard.topic) {
                    currentTopic = flashcard.topic;
                    const topicHeader = document.createElement('div');
                    topicHeader.className = 'topic-header';
                    topicHeader.textContent = topics[flashcard.topic];
                   flashcardsContainer.appendChild(topicHeader);
                }
                 const isAnswerVisible = reviewStageData?.revealedTimestamp &&
                (new Date() - new Date(reviewStageData.revealedTimestamp)) < 24 * 60 * 60 * 1000;

                const memoryTip = flashcard.memoryTip || '';
                const emojiSymbol = flashcard.emoji || '✨';
                const emojiExplanation = flashcard.emojiExplanation || '';

                const card = document.createElement('div');
                card.className = 'modern-card';
                card.dataset.flashcardId = flashcard.id;
                card.dataset.topic = flashcard.topic;
                card.innerHTML = `
                    <div class="question">${flashcard.question}</div>
                    <div class="answer" style="display: ${isAnswerVisible ? 'block' : 'none'}">
                        ${flashcard.answer}
                        <br>
                        <hr style="border: 1px solid black; margin: 10px 0;">
                        <em><strong>Memory Tip:</strong> ${memoryTip}</em>
                         <br><br>
                        <span class="emoji">${emojiSymbol}</span>
                    </div>
                    <div class="review-metric"></div>
                    <div class="buttons">
                       <button class="dont-know-btn" onclick="handleReviewClick(${flashcard.id}, false)">Don't Know</button>
                     <i class="${isStarred ? 'fas' : 'far'} fa-star star-btn"
                            style="color: ${isStarred ? 'gold' : 'lightgray'};"
                             onclick="toggleStar(this, ${flashcard.id})"></i>
                       <button class="know-btn" onclick="handleReviewClick(${flashcard.id}, true)" ondblclick="handleInactiveKnowClick(event)">Know</button>
                     </div>
                    <i class="fas fa-bookmark bookmark" onclick="toggleDropdown(event, 'bookmarkDropdown')"></i>
                    `;
                flashcardsContainer.appendChild(card);
                cardsLoaded++;
           }
       }
        applyReviewMetrics();
        updatePendingCounts();

        if (isHorizontal) {
             showFlashcard(currentFlashcardIndex);
         }
        attachBookmarkListeners();
     }


function showAllTopics() {
    const showMoreBtn = document.getElementById('showMoreBtn');
    const topicsLine = showMoreBtn.parentElement;
    const allTopicsText = filteredTopics.map(topic => topics[topic] || 'All Topics').join(', ');
    topicsLine.innerHTML = `<strong style="color: black;">Topics selected:</strong>  ${allTopicsText} <button id="hideMoreBtn" onclick="hideAllTopics()">Hide</button>`;
}

function hideAllTopics() {
    const hideMoreBtn = document.getElementById('hideMoreBtn');
    const topicsLine = hideMoreBtn.parentElement;
    const selectedTopicsText = filteredTopics.slice(0, 2).map(topic => topics[topic] || 'All Topics').join(', ') +
          (filteredTopics.length > 2 ? ', <button id="showMoreBtn" onclick="showAllTopics()">More</button>' : '');
    topicsLine.innerHTML = `<strong style="color: black;">Topics selected:</strong>  ${selectedTopicsText}`;
}



function showStarredFlashcards() {
    // Set the filter for starred flashcards to active and reset others
    isStarFilterActive = true;
    isStarReadyFilterActive = false; // Disable "Ready for Review" filter
    filterStage = null; // Reset the review stage filter

    renderFlashcards(); // Re-render flashcards based on updated filters
    updateStarredCount(); // Update the count of starred flashcards
}



function showStarredReadyFlashcards() {
    // Set the filter for starred and ready-to-review flashcards to active and reset others
    isStarReadyFilterActive = true;
    isStarFilterActive = false; // Disable the "Starred" filter
    filterStage = null; // Reset the review stage filter

    renderFlashcards(); // Re-render flashcards based on updated filters
    updateStarredCount(); // Update the count of starred ready-to-review flashcards
}



function attachBookmarkListeners() {
    const bookmarks = document.querySelectorAll('.bookmark');
    bookmarks.forEach(bookmark => {
        bookmark.addEventListener('click', (event) => {
            toggleDropdown(event, 'bookmarkDropdown');
        });
    });
}

function filterFlashcards(stage) {
    filterStage = stage;
    isStarFilterActive = false;
    isStarReadyFilterActive = false;
    currentFlashcardIndex = 0;
    renderFlashcards();
}

function showAllFlashcards() {
    if (filteredTopics.length === 0) {
        const topicSelect = document.getElementById('topic-filter');
        const selectedOptions = Array.from(topicSelect.selectedOptions);
        filteredTopics = selectedOptions.map(option => option.value).filter(value => value !== 'all');
    }
    filterStage = null;
    isStarFilterActive = false;
    isStarReadyFilterActive = false;
    currentFlashcardIndex = 0;
    renderFlashcards();
}

function applyReviewMetrics() {
    document.querySelectorAll('.modern-card').forEach(card => {
        const flashcardId = parseInt(card.dataset.flashcardId);
        const reviewMetric = card.querySelector('.review-metric');
        const bookmark = card.querySelector('.bookmark');
        const knowButton = card.querySelector('.know-btn');

        if (reviewStages[flashcardId]) {
            const { reviewStage, dueDate } = reviewStages[flashcardId];
            reviewMetric.dataset.reviewStage = reviewStage;
            reviewMetric.dataset.dueDate = dueDate;

            const timeRemaining = (new Date(dueDate).getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24);

            if (reviewStage === 4) {
                reviewMetric.textContent = '🏆 Final Review: Completed';
                reviewMetric.style.color = 'gold';
                bookmark.style.color = 'gold';
                card.style.borderColor = 'gold';
                knowButton.disabled = true;
                knowButton.style.backgroundColor = 'gray';
            } else if (timeRemaining <= 0) {
                reviewMetric.textContent = '🔔 Ready for Review';
                reviewMetric.style.color = '#388e3c';
                knowButton.disabled = false;
                knowButton.style.backgroundColor = '#388e3c';
                bookmark.style.color = reviewStageColors[reviewStage];
                card.style.borderColor = reviewStageColors[reviewStage];
            } else {
                const stageColor = reviewStageColors[reviewStage];
                reviewMetric.textContent = `${getReviewText(reviewStage, dueDate)}`;
                reviewMetric.style.color = stageColor;
                bookmark.style.color = stageColor;
                card.style.borderColor = stageColor;
                knowButton.disabled = true;
                knowButton.style.backgroundColor = 'gray';
            }
        } else {
            bookmark.style.color = '';
            card.style.borderColor = '';
            reviewMetric.textContent = '';
        }
    });
}


  function handleReviewClick(flashcardId, isKnow) {
    const flashcard = document.querySelector(`[data-flashcard-id="${flashcardId}"]`);
    const answer = flashcard.querySelector('.answer');
        answer.style.display = 'block';


    let reviewStage = reviewStages[flashcardId]?.reviewStage || 0;
    const dueDate = new Date(currentDate);
          const revealedTimestamp = new Date().toISOString();
        const isStarred = starMarked[flashcardId] || false;

         if (isKnow) {
        reviewStage = getNextStage(reviewStage, dueDate); // Move to next stage
    } else {
        reviewStage = 0;
            dueDate.setDate(dueDate.getDate() + 3); // Set the review in 3 days
        }
        reviewStages[flashcardId] = { reviewStage, dueDate: dueDate.toISOString(), revealedTimestamp };
         saveProgress(flashcardId, reviewStage, dueDate.toISOString(), revealedTimestamp, isStarred); // Save starred state with review metrics

          applyReviewMetrics();
        updatePendingCounts();
        updateTopicProgress();
       }


function getNextStage(reviewStage, dueDate) {
    if (reviewStage === 0) {
        dueDate.setDate(dueDate.getDate() + 7);
        return 1;
    } else if (reviewStage === 1) {
        dueDate.setDate(dueDate.getDate() + 14);
        return 2;
    } else if (reviewStage === 2) {
        dueDate.setDate(dueDate.getDate() + 28);
        return 3;
    }
    return 4;
}

function getReviewText(reviewStage, dueDate) {
    const timeRemaining = (new Date(dueDate) - currentDate) / (1000 * 60 * 60 * 24);
    return `${["First Review", "Second Review", "Third Review", "Final Review"][reviewStage]} in ${Math.ceil(timeRemaining)} days`;
}

function getReviewStageLabel(stage) {
    const labels = ["First Review", "Second Review", "Third Review", "Final Review"];
    return labels[stage] || " 🏆 Completed Flashcards List";
}

function updatePendingCounts() {
    const counts = [0, 0, 0, 0, 0];
    flashcards.forEach(flashcard => {
        const flashcardData = reviewStages[flashcard.id];
        if (flashcardData) {
            if (flashcardData.reviewStage < 4 && new Date(flashcardData.dueDate) <= currentDate) {
                counts[flashcardData.reviewStage]++;
            } else if (flashcardData.reviewStage === 4) {
                counts[4]++;
            }
        }
    });
    counts.forEach((count, index) => {
        if (index < 4) {
            document.getElementById(`count-stage-${index}`).textContent = `${count} pending`;
        } else {
            document.getElementById('count-completed').textContent = `${count} completed`;
        }
    });
}

function simulateDateTimeChange() {
    const dateInput = document.getElementById('current-date').value;
    const timeInput = document.getElementById('current-time').value;

    if (dateInput && timeInput) {
        currentDate = new Date(`${dateInput}T${timeInput}:00`);
    } else {
        currentDate = new Date();
    }
    refreshFlashcards();
}

function refreshFlashcards() {
    applyReviewMetrics();
    updatePendingCounts();
}

function applyCurrentFilters() {
    if (filterStage !== null) {
        filterFlashcards(filterStage);
    } else {
        renderFlashcards();
    }

    if (isHorizontal) {
        currentFlashcardIndex = 0;
        showFlashcard(currentFlashcardIndex);
    }
}


// Handle inactive "Know" button click to show dropdown
function handleInactiveKnowClick(event) {
    if (event.target.disabled) {
        toggleDropdownBelowButton(event, 'inactiveKnowDropdown');
    }
}

// Function to toggle dropdown visibility below the button
function toggleDropdownBelowButton(event, dropdownId) {
    event.stopPropagation();

    const dropdown = document.getElementById(dropdownId);
    const isVisible = dropdown.style.display === "block";

    if (isVisible) {
        dropdown.style.display = "none";
        return;
    }

    const dropdowns = document.querySelectorAll('.dropdown');
    dropdowns.forEach(d => {
        d.style.display = 'none';
    });

    dropdown.style.display = "block";
    dropdown.style.position = "absolute";

    const rect = event.target.getBoundingClientRect();
    dropdown.style.top = `${rect.bottom + window.scrollY}px`;
    dropdown.style.left = "50%";
    dropdown.style.transform = "translateX(-50%)";
    dropdown.style.maxWidth = "90vw";
}

// Close dropdown when clicking outside of it
window.addEventListener('click', function (event) {
    const dropdown = document.getElementById('inactiveKnowDropdown');
    if (dropdown && dropdown.style.display === "block" && !dropdown.contains(event.target)) {
        dropdown.style.display = "none";
    }
});

// Optional: Close dropdown function for specific dropdowns
function closeDropdown(dropdownId) {
    const dropdown = document.getElementById(dropdownId);
    if (dropdown) {
        dropdown.style.display = "none";
    }
}


function updateStarredCount() {

    const totalStarredCount = flashcards.filter(flashcard => starMarked[flashcard.id]).length;
    const totalStarredReadyCount = flashcards.filter(flashcard => {
          const reviewStageData = reviewStages[flashcard.id];
          const isDue = reviewStageData && new Date(reviewStageData.dueDate) <= currentDate;
        return starMarked[flashcard.id] && isDue;
        }).length;
        const count = flashcards.filter(flashcard => {
             const isTopicMatch = filteredTopics.length === 0 || filteredTopics.includes(flashcard.topic);
             return isTopicMatch && starMarked[flashcard.id]
         }).length;

        const countReady = flashcards.filter(flashcard => {
             const isTopicMatch = filteredTopics.length === 0 || filteredTopics.includes(flashcard.topic);
                const reviewStageData = reviewStages[flashcard.id];
                const isDue = reviewStageData && new Date(reviewStageData.dueDate) <= currentDate;
                return isTopicMatch &&  starMarked[flashcard.id] && isDue;
           }).length;
    const starFilterBtn = document.querySelector('.filter-btn[onclick="showStarredFlashcards()"]');
    if (starFilterBtn) {
        starFilterBtn.innerHTML = `Starred Flashcards <br> ⭐  <span id="count-starred" class="badge">${totalStarredCount} marked</span>`;
    }
    const starReadyFilterBtn = document.querySelector('.filter-btn[onclick="showStarredReadyFlashcards()"]');
    if (starReadyFilterBtn) {
        starReadyFilterBtn.innerHTML = ` Starred Ready for Review <br> 🌟 <span id="count-starred-ready" class="badge">${totalStarredReadyCount} pending</span>`
      }
}


function attachBookmarkListeners() {
    const cards = document.querySelectorAll('.modern-card');
       cards.forEach(card =>{
         card.addEventListener('click', function(event){
            const bookmark = event.target.closest('.bookmark');
             if(bookmark){
                toggleDropdown1(event, 'bookmarkDropdown1')
              }

        });
    });

}


// Toggle dropdown near the clicked bookmark icon, centered horizontally in the viewport
function toggleDropdown1(event, dropdownId) {
    event.stopPropagation();

    const dropdown = document.getElementById(dropdownId);
  const computedStyle = window.getComputedStyle(dropdown);
    const isVisible = computedStyle.display === "block";


    if (isVisible) {
        dropdown.style.display = "none";
        return;
    }

    dropdown.style.display = "block";
    dropdown.style.position = "absolute";

    const rect = event.target.getBoundingClientRect();

    dropdown.style.top = `${rect.bottom + window.scrollY}px`;
    dropdown.style.left = "50%";
    dropdown.style.transform = "translateX(-50%)";
    dropdown.style.maxWidth = "90vw";
}


// Close dropdown when clicking outside of it
window.addEventListener('click', function (event) {
    const dropdown = document.getElementById('bookmarkDropdown1');
   const bookmark = event.target.closest('.bookmark');
   if (dropdown && dropdown.style.display === "block" && !bookmark && !dropdown.contains(event.target)) {
        dropdown.style.display = "none";
    }
});

// Close dropdown manually
function closeDropdown(dropdownId) {
    const dropdown = document.getElementById(dropdownId);
    if (dropdown) {
        dropdown.style.display = "none";
    }
}


</script>



<script>
// Function to Toggle the Dropdown Below the Button
function toggleDropdownContent(event) {
    event.stopPropagation();  // Prevent immediate closing due to outside click listener

    const dropdown = document.getElementById('dropdownContent');
    const isVisible = dropdown.style.display === "block";

    // Hide dropdown if already visible
    if (isVisible) {
        dropdown.style.display = "none";
        return;
    }

    // Hide any other open dropdowns
    const dropdowns = document.querySelectorAll('.dropdown');
    dropdowns.forEach(d => {
        d.style.display = 'none';
    });

       // Show and position dropdown
    dropdown.style.display = "block";
    dropdown.style.position = "absolute";

    const rect = event.target.getBoundingClientRect();

    // Set top position just below the clicked bookmark icon
    dropdown.style.top = `${rect.bottom + window.scrollY}px`;

    // Center horizontally in the viewport, using transform for responsive centering
    dropdown.style.left = "50%";
    dropdown.style.transform = "translateX(-50%)";  // Center align horizontally

    // Optional: Set max width for small screens
    dropdown.style.maxWidth = "90vw";  // Allow dropdown to adjust within viewport
}

// Close dropdown when clicking outside of it
window.addEventListener('click', function(event) {
    const dropdown = document.getElementById('dropdownContent');
    const toggleButton = document.getElementById('toggleButton'); // Assuming the button to open dropdown has ID "toggleButton"

    // Close dropdown if clicked outside of it and not on the toggle button
    if (dropdown && dropdown.style.display === "block" &&
        !dropdown.contains(event.target) &&
        event.target !== toggleButton) {
        dropdown.style.display = "none";
    }
});

// Function to Close Dropdown Explicitly
function closeDropdown(dropdownId) {
    const dropdown = document.getElementById(dropdownId);
    if (dropdown) {
        dropdown.style.display = "none";
    }
}


</script>

 <script>
         function openModal(modalId) {
            document.getElementById(modalId).style.display = "block";
        }

        function closeModal(modalId) {
            document.getElementById(modalId).style.display = "none";
        }

         function zoomImage(modalId, zoomFactor) {
             var image = document.getElementById(modalId).querySelector('.modal-content97');
            if (image) {
                var currentWidth = image.clientWidth;
                image.style.width = (currentWidth * zoomFactor) + 'px';
            } else {
                console.error('Zoom image not found for modal:', modalId);
             }
         }


        function openPopup(popupId) {
             document.getElementById(popupId).style.display = "block";
         }

         function closePopup(popupId) {
            document.getElementById(popupId).style.display = "none";
         }

    </script>



<!-- Include the rest of your JavaScript here -->

</body>
</html>