            @font-face {
      font-family: 'DroidKufi';
      src: url('fonts/DroidKufi-Regular.woff2') format('woff2'),
           url('fonts/DroidKufi-Regular.woff') format('woff'),
           url('fonts/DroidKufi-Regular.ttf') format('truetype');
      font-weight: normal;
      font-style: normal;
    }
        body {
            font-family: 'droidkufi', sans-serif; /* Default to Inter or a suitable sans-serif font */
        }
 

        /* Responsive adjustments for mobile menu */
        @media (max-width: 991px) {
            .navbar-nav {
                direction: ltr;
                text-align: left;
                width: 100%; /* Ensure menu takes full width on mobile */
            }
            .navbar-nav .nav-item {
                margin-right: 0;
                margin-left: 0;
                width: 100%;
            }
            .navbar-nav .sub-menu {
                position: relative; /* Sub-menu should not be absolutely positioned on mobile */
                width: 100%;
                box-shadow: none; /* Remove shadow for mobile sub-menu */
            }
        }

        /* Quiz specific styles - Adjusted for LTR */
        .quiz-container {
            background-color: #f9f9f9;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            margin-top: 50px;
            margin-bottom: 50px;
        }
        .quiz-category-selection {
            /* Initially visible or hidden based on JS */
        }
        .quiz-category-selection .category-item {
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }
        .quiz-category-selection .category-item:hover {
            background-color: #e9e9e9;
            border-color: #c0c0c0;
            transform: translateY(-5px);
             /* Arabic font for hover effect */
        }
        .quiz-category-selection .category-item h4 {
            margin-bottom: 0;
            font-family: 'droidkufi', sans-serif; /* Default font */
            font-weight: 700;
            color: #333;
        }
        .quiz-category-selection .category-item p.question-count {
            font-size: 14px;
            color: #666;
            margin-top: 5px;
        }
        .quiz-question {
            display: none; /* Hidden by default, shown via JS */
            margin-bottom: 30px;
            padding: 20px;
            border: 1px solid #eee;
            border-radius: 8px;
            background-color: #fff;
        }
        .quiz-question.active {
            display: block;
        }
        .quiz-question h3 {
            font-family: 'droidkufi', sans-serif; /* Default font */
            font-weight: 700;
            color: #333;
            margin-bottom: 20px;
            line-height: 1.6;
            text-align: left; /* LTR alignment */
        }
        .quiz-question img {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            margin-bottom: 20px;
            display: block; /* Ensures image takes full width of its container */
            margin-left: auto; /* Center image */
            margin-right: auto; /* Center image */
        }
        .quiz-options label {
            display: block;
            background-color: #f0f0f0;
            padding: 15px 20px;
            margin-bottom: 10px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease, border-color 0.3s ease;
            border: 1px solid #e0e0e0;
            font-family: 'droidkufi', sans-serif; /* Default font */
            font-size: 16px;
            color: #555;
            text-align: left; /* LTR alignment */
        }
        .quiz-options label:hover {
            background-color: #e0e0e0;
            border-color: #d0d0d0;
        }
        .quiz-options input[type="radio"] {
            margin-right: 10px; /* Space between radio button and text */
            margin-left: 0; /* Reset default margin */
            vertical-align: middle;
        }
        .quiz-navigation {
            text-align: center;
            margin-top: 30px;
        }
        .quiz-navigation button {
            background-color: #007bff;
            color: #fff;
            border: none;
            padding: 12px 25px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease;
            margin: 0 10px;
        }
        .quiz-navigation button:hover {
            background-color: #0056b3;
        }
        .quiz-navigation button:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }
        .quiz-results {
            display: none; /* Hidden by default */
            text-align: center;
            margin-top: 50px;
            padding: 30px;
            background-color: #e6ffe6; /* Light green for success */
            border: 1px solid #b3ffb3;
            border-radius: 10px;
        }
        .quiz-results h3 {
            color: #28a745; /* Green for success */
            font-family: 'droidkufi', sans-serif; /* Default font */
            font-weight: 700;
            margin-bottom: 20px;
        }
        .quiz-results p {
            font-size: 18px;
            font-family: 'droidkufi', sans-serif; /* Default font */
            color: #333;
        }
        .quiz-results button {
            margin-top: 20px;
            background-color: #6c757d; /* Grey for retry/back */
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease;
        }
        .quiz-results button:hover {
            background-color: #5a6268;
        }
        /* Style for the name input section */
        .name-input-section {
            display: none; /* Hidden by default */
            text-align: center;
            padding: 30px;
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            margin-top: 30px;
        }
        .name-input-section input[type="text"] {
            width: 80%;
            max-width: 400px;
            padding: 10px 15px;
            margin-bottom: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
        }
        .name-input-section button {
            background-color: #170145;
            color: #fff;
            border: none;
            padding: 12px 30px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 18px;
            transition: background-color 0.3s ease;
        }
        .name-input-section button:hover {
            background-color: #140149;
        }
        .name-input-section button:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }
        .error-message {
            color: red;
            font-size: 14px;
            margin-top: -10px;
            margin-bottom: 10px;
            display: none; /* Hidden by default */
        }
        .message-box {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
            padding: 15px 20px;
            border-radius: 5px;
            z-index: 1000;
            display: none;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .message-box.success {
            background-color: #d4edda;
            color: #155724;
            border-color: #c3e6cb;
        }
        /* Ensure quiz-questions-display is hidden by default */
        .quiz-questions-display {
            display: none;
        }

        /* Styles for detailed quiz results */
        .detailed-results {
            text-align: left; /* Align text left for detailed view */
            margin-top: 30px;
            border-top: 1px solid #eee;
            padding-top: 20px;
        }
        .detailed-results .result-question-item {
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }
        .detailed-results .result-question-item h4 {
            font-size: 18px;
            color: #333;
            margin-bottom: 15px;
        }
        .detailed-results .result-option {
            padding: 8px 12px;
            margin-bottom: 5px;
            border-radius: 4px;
            font-size: 15px;
            display: block; /* Make it a block element */
        }
        .detailed-results .result-option.correct {
            background-color: #d4edda; /* Light green */
            color: #155724; /* Dark green */
            border: 1px solid #c3e6cb;
        }
        .detailed-results .result-option.incorrect {
            background-color: #f8d7da; /* Light red */
            color: #721c24; /* Dark red */
            border: 1px solid #f5c6cb;
        }
        .detailed-results .result-option.selected {
            font-weight: bold;
            border: 2px solid #007bff; /* Highlight selected option */
        }
        .detailed-results .result-option.selected.incorrect {
            border-color: #dc3545; /* Red border for incorrect selected */
        }
        .detailed-results .result-feedback {
            font-size: 14px;
            margin-top: 10px;
            font-weight: bold;
        }
        .detailed-results .result-feedback.correct {
            color: #28a745;
        }
        .detailed-results .result-feedback.incorrect {
            color: #dc3545;
        }
        
        