/* Font declarations */
@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('fonts/IBM_Plex_Sans_Arabic/IBMPlexSansArabic-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    font-weight: 400; /* Regular weight as default */
    background-color: #f0f8f0;
    color: #333;
    direction: rtl;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

* {
    font-family: 'IBM Plex Sans Arabic', Arial, sans-serif;
}

#start-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding-top: 20px;
}

#quiz-screen {
    width: calc(100% - 40px);  /* Subtracting 40px to account for the new horizontal margins */
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
    margin-left: 20px;  /* Adding left margin */
    margin-right: 20px;  /* Adding right margin */
}

h1, h2, h3 {
    color: #4CAF50;
    margin: 4px;
    margin-bottom: 22px;
}

#player-name {
    font-weight: bold;
    font-size: 24px;
}

.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

input[type="text"] {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    width: 100%;
    max-width: 400px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.player-info {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-avatar {
    font-size: 48px;
    margin-right: 10px;
}

#top-bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

#timer-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.timer-svg {
    transform: rotate(-90deg);
}

.timer-background {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 5;
}

.timer-progress {
    fill: none;
    stroke: #fff;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

#timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
}

#questions-container {
    margin-top: 100px; /* Add margin to prevent overlap with fixed header */
}

.question {
    margin-bottom: 30px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice {
    flex: 1 0 calc(50% - 10px);
    padding: 15px;
    background-color: #e0e0e0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 400; /* Regular */
    font-size: 18px;
}

.choice:hover {
    background-color: #d0d0d0;
}

.choice.selected {
    color: white;
}

.choice.correct {
    background-color: #4CAF50;
    color: white;
}

.choice.incorrect {
    background-color: #f44336;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow: auto; /* Add this line */
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative; /* Add this line */
}

#question-text {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#avatar-selection {
    padding-top: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 400px;
}

.avatar-input {
    display: none;
}

.avatar-label {
    font-size: 36px;
    cursor: pointer;
    margin: 0 5px;
    padding: 5px;
    border: 2px solid #ccc;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
}

.avatar-label:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.avatar-input:checked + .avatar-label {
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    transform: scale(1.1);
}

.avatar-option {
    transition: transform 0.3s ease;
}

.avatar-input:checked + .avatar-label .avatar-option {
    transform: scale(1.2);
}

@media (max-width: 600px) {
    #avatar-selection {
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .avatar-label {
        flex: 0 0 auto;
    }
}

#start-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500; /* Medium */
    max-width: 300px;
}

#start-button:hover {
    background-color: #45a049;
}

#banner {
    width: 100%;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
}

@media (max-width: 600px) {
    .choices {
        flex-direction: column;
    }
    
    .choice {
        flex: 1 0 100%;
    }
}

#final-score-modal .modal-content {
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

#final-score-modal .modal-content .final-score-text {
    margin: 0;
    margin-bottom: 4px;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.share-button {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    background-color: #4CAF50;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    margin-top: 20px;
}

.share-button:hover {
    background-color: #45a049;
}

/* Remove the following styles if they exist */
.share-buttons {
    display: none;
}

.share-button.facebook,
.share-button.twitter,
.share-button.whatsapp {
    display: none;
}

.question-header {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.difficulty {
    font-size: 0.9em; /* Reduce font size */
    font-weight: bold;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
    font-family: 'IBM Plex Sans Arabic', Arial, sans-serif; /* Ensure correct font */
}

.difficulty.easy {
    background-color: #4CAF50; /* Green */
}

.difficulty.medium {
    background-color: #FFDC00; /* Yellow */
    color: black; /* Black text for better contrast */
}

.difficulty.hard {
    background-color: #FF4136; /* Red */
}

.result-svg {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.highlight {
    font-size: 1.2em;
    font-weight: 600; /* SemiBold */
    color: #4CAF50;
}

@keyframes countAnimation {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animating-number {
    display: inline-block;
    animation: countAnimation 0.5s ease-out;
}

.feedback {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    height: 20px;
}

.gauge-container {
    width: 250px;
    height: 250px;
    margin: 0 auto 0;
    position: relative;
}

#gauge-chart {
    width: 100%;
    height: 100%;
}

#gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.avatar-label {
    font-size: 36px;
    cursor: pointer;
    margin: 0 5px;
    padding: 5px;
    border: 2px solid #ccc;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
}

.avatar-label:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

/* Remove or comment out the previous .gauge-meter, .gauge, .gauge-background, .gauge-fill, and .gauge-text styles */

.instructions {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    text-align: center;
    font-size: 0.8em;
    line-height: 1.6;
}

.try-again-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    background-color: #007bff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    margin-top: 8px;
    margin-left: 10px;
}

.try-again-button:hover {
    background-color: #0056b3;
}

/* streak */

#streak-container {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.streak-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 5px;
    opacity: 0.3;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.streak-circle.active {
    opacity: 1;
}

.streak-1 {
    background-color: #2ECC40;
}

.streak-2 {
    background-color: #FFDC00;
}

.streak-3 {
    background-color: #FF851B;
}

.streak-4 {
    background-color: #FF4136;
}

.streak-5 {
    background-color: #85144b;
}

@keyframes streakAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.streak-circle.active.animate {
    animation: streakAnimation 0.5s ease;
}

#score {
    font-size: 2em; /* Increase font size */
    font-weight: bold;
    color: #FFD700; /* Gold color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Add shadow for a 3D effect */
    margin-left: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease; /* Add transition for animation */
}

#score.animate {
    transform: scale(1.2); /* Scale up for animation */
}

/* Add these styles for the review-answers-button */
.review-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    background-color: #FF9800; /* Orange color */
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    margin-top: 20px;
}

.review-button:hover {
    background-color: #FB8C00; /* Darker orange on hover */
}

/* Add these styles for the close-review-button */
.close-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    background-color: #f44336; /* Red color */
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    margin-top: 20px;
}

.close-button:hover {
    background-color: #d32f2f; /* Darker red on hover */
}

/* Add these styles for the feedback phrase */
.feedback-phrase {
    font-size: 1.5em; /* Increase font size */
    font-weight: bold; /* Make it bold */
    color: #4CAF50; /* Green color */
    margin-top: 10px; /* Add some margin on top */
}