body {
    font-family: 'Arial Hebrew', sans-serif;
    background-color: #e0f7fa; /* Light blue background */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top for better scroll */
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    direction: rtl; /* Right-to-left for Hebrew */
    text-align: right; /* Align text to right */
}

.page {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    max-width: 800px;
    display: none; /* Hidden by default */
    margin-bottom: 20px; /* Space between pages if multiple active for debug */
}

.page.active {
    display: block; /* Show active page */
}

h1, h2, h3 {
    color: #00796b; /* Dark cyan for headings */
    text-align: center;
    margin-bottom: 20px;
}

p {
    line-height: 1.6;
    margin-bottom: 10px;
}

ul, ol {
    margin-right: 20px; /* Indent lists */
    margin-bottom: 10px;
}

li {
    margin-bottom: 5px;
}

button {
    background-color: #00bcd4; /* Cyan for buttons */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 20px;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0097a7; /* Darker cyan on hover */
}

.input-group {
    margin-bottom: 20px;
    text-align: center;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.input-group input[type="text"] {
    width: calc(100% - 20px);
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    text-align: center;
}

/* Concepts Page Specifics */
.concept-section {
    background-color: #e0f2f7; /* Lighter blue for sections */
    border-right: 5px solid #00bcd4; /* Cyan border on right */
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.concept-section h3 {
    color: #00796b;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: right; /* Align concept headings to right */
}

/* Questions Page Specifics */
#question-container {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
    font-weight: bold;
}

.options-container {
    margin-bottom: 20px;
}

.option-label {
    display: block;
    background-color: #f0f8ff; /* Alice blue for options */
    border: 1px solid #cceeff;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.option-label:hover {
    background-color: #e6f7ff;
    border-color: #99ddff;
}

input[type="radio"] {
    margin-left: 10px; /* Space between radio button and text */
    vertical-align: middle;
    transform: scale(1.2); /* Slightly larger radio buttons */
}

/* Feedback Styling */
#feedback-container {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    display: none; /* Hidden by default */
}

.correct {
    background-color: #e8f5e9; /* Light green */
    color: #2e7d32; /* Dark green */
    border: 1px solid #4caf50;
}

.incorrect {
    background-color: #ffebee; /* Light red */
    color: #c62828; /* Dark red */
    border: 1px solid #f44336;
}

.explanation {
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
    font-weight: normal;
    text-align: right;
}

/* Progress Bar */
#progress-container {
    width: 100%;
    background-color: #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    height: 10px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4caf50; /* Green progress bar */
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
}

/* Results Page Specifics */
#incorrect-answers-list div {
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

#incorrect-answers-list div p {
    margin: 0;
    font-weight: bold;
    color: #c62828;
}

#incorrect-answers-list div .explanation {
    color: #333;
    font-weight: normal;
    margin-top: 5px;
}

#evaluation-feedback {
    background-color: #f9fbe7; /* Light yellow */
    border: 1px solid #cddc39;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.small-text {
    font-size: 0.8em;
    color: #666;
    text-align: center;
    margin-top: 30px;
}

/* Special Feedback Popup */
#special-feedback-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8); /* Start slightly smaller */
    background-color: #ffeb3b; /* Bright yellow */
    color: #4CAF50; /* Green text */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    z-index: 1000;
    display: none; /* Hidden by default */
    border: 5px solid #ffc107; /* Darker yellow border */
    animation-duration: 0.5s; /* For entrance animation */
    animation-fill-mode: forwards; /* Keep the end state of the animation */
    opacity: 0; /* Start hidden for fade in */
}

#special-feedback-popup.show {
    display: block;
    animation-name: popIn; /* Define this keyframe */
    opacity: 1; /* Fade in */
    transform: translate(-50%, -50%) scale(1); /* End at full size */
}

#special-feedback-popup #special-feedback-message {
    margin: 0;
    line-height: 1.2;
}

#close-special-feedback {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes popOut { /* Not used directly but good to have if needed */
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; display: none;}
}

/* Optional: Add a slight overlay when popup is active */
body.overlay-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 999;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .page {
        padding: 20px;
    }
    h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.5em;
    }
    button {
        padding: 10px 20px;
        font-size: 1em;
    }
    .question-text {
        font-size: 1.1em;
    }
    .option-label {
        padding: 10px;
        font-size: 0.9em;
    }
    #special-feedback-popup {
        font-size: 1.5em;
        padding: 20px;
    }
}