/* Gravity Forms Page Transitions */
.gform_wrapper {
    position: relative;
    overflow: hidden;
}

/* Flash animation for incorrect answers */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.incorrect-answer {
    position: relative;
    overflow: hidden;
}

.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.incorrect-answer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ff6300;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    animation: flashIncorrect 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Cross icon animation for incorrect answers */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.incorrect-answer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 1000;
    animation: showCross 2s ease-out forwards;
}

/* Flash animation for correct answers */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.correct-answer {
    position: relative;
    overflow: hidden;
}

.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.correct-answer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4CAF50;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    animation: flashCorrect 2s ease-out forwards;
}

/* Success checkmark animation */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.correct-answer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 1000;
    animation: showCheckmark 2s ease-out forwards;
}

/* Style quiz field container */
.gform_wrapper .gquiz-field {
    position: relative;
}

/* Style the radio container */
.gform_wrapper .gfield_radio {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}
.gquiz-indicator {
    display: none !important;
}

/* Style each choice container */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    height: calc(var(--step-1) * 5);
    display: flex;
    align-items: center;
    justify-content: start;
    text-align: left;
}

/* Add opacity transition for quiz choices when explanation is visible */
.gform_wrapper .gfield_radio .gchoice {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Target the choices when the explanation is visible */
.gform_wrapper .gfield.explanation-visible .gfield_radio .gchoice {
    opacity: 0.5;
}

/* Keep correct/incorrect labels at full opacity */
.gform_wrapper .gfield.explanation-visible .gfield_radio .gchoice .gquiz-correct-choice,
.gform_wrapper .gfield.explanation-visible .gfield_radio .gchoice .gquiz-incorrect-choice {
    opacity: 1;
}

/* Hide the radio button */
.gform_wrapper .ginput_container_radio .gfield_radio .gfield-choice-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    cursor: pointer;
}

/* Style the label */
.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label {
    padding: var(--space-s) !important;
    margin: 0 !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: start;
    text-align: left;
    font-size: var(--step-1);
    line-height: 1.2;
    color: #ffffff;
    cursor: pointer;
    border: 1px solid var(--bricks-color-olyyze);
    border-radius: 10px;
    text-wrap: pretty;
    font-weight: bold;
}
.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label span {
    font-family: 'Jockey One', sans-serif;
    text-transform: uppercase;
    color: var(--bricks-color-akmdqk);
    font-size: var(--step-4);
    margin-right: var(--space-s);
}

/* Question styling */
.gform_wrapper .gquiz-field legend {
    font-size: var(--step-3) !important;
    line-height: 1.2;
    color: white;
    font-family: 'Jockey One', sans-serif;
    text-align: center;
    margin-bottom: var(--space-l) !important;
    text-wrap: balance;
}

.gform_wrapper .gfield_required {
    display: none !important;
}

/* INstant feedback states */
.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label.gquiz-correct-choice {
    border: 1px solid var(--bricks-color-npbuep);
    color: var(--bricks-color-npbuep);
}
.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label.gquiz-correct-choice span,
.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label.gquiz-correct-choice {
    color: var(--bricks-color-npbuep);
}
.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label.gquiz-incorrect-choice {
    border: 1px solid var(--bricks-color-akmdqk);
}

.gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label.gquiz-incorrect-choice  {
    color: var(--bricks-color-akmdqk);
}

/* Hide previous buttons */
.gform_wrapper form .gform_page_footer .gform_previous_button {
    display: none !important;
    visibility: hidden !important;
}

/* Next button wrapper */
.gform_wrapper form .gform_page_footer {
    position: relative;
    overflow: hidden;
    text-align: right;
}

.gform_wrapper form .gform_page_footer .gform_next_button_wrapper {
    display: inline-block;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.gform_wrapper form .gform_page_footer .gform_next_button_wrapper.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Next button styling */
.gform_wrapper form .gform_page_footer .gform-theme-button,
.gform_wrapper form .gform_page_footer .gform-theme-button:hover,
.gform_wrapper form .gform_page_footer .gform-theme-button:focus,
.gform_wrapper form .gform_page_footer .gform_button,
.gform_wrapper form .gform_page_footer .gform_button:hover,
.gform_wrapper form .gform_page_footer .gform_button:focus {
    background: var(--bricks-color-akmdqk) !important;
    border: none !important;
    outline: none !important;
    font-family: 'Jockey One', sans-serif !important;
    text-transform: uppercase !important;
    color: white !important;
    font-size: var(--step-3) !important;
    padding: var(--space-s) var(--space-m) !important;
    border-radius: 200px !important;
    cursor: pointer !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Hover state */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: #999;
}

/* Selected state */
.gform_wrapper .ginput_container_radio .gfield_radio .gfield-choice-input:checked + .gfield-choice-label {
    background-color: #f0f0f0;
}

/* Quiz answer explanation */
.gform_wrapper .gquiz-answer-explanation {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-60%);
    width: 90%;
    padding: var(--space-l) var(--space-s) var(--space-m) var(--space-s) !important;
    background-color: rgba(8,86,72,0.95);
    border: 2px solid #81c784;
    border-radius: 10px;
    font-size: var(--step-1) !important;
    line-height: 1.4 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none; /* Start hidden */
}
@media only screen and (max-width: 478px) {
    .gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label  {
        font-size: var(--step-0) !important;
    }
    .gform_wrapper .ginput_container_radio .gfield_radio .gchoice {
        height: calc(var(--step-0) * 5);
    }
}

/* Close button for explanation */
.gform_wrapper .gquiz-answer-explanation .close-button {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 25px !important;
    height: 25px !important;
    background: none !important;
    border: none;
    cursor: pointer;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    font-size: 25px !important;
    line-height: 1em !important;
}

.gform_wrapper .gquiz-answer-explanation .close-button:hover {
    opacity: 1;
}

.gform_wrapper .gquiz-answer-explanation .close-button::before,
.gform_wrapper .gquiz-answer-explanation .close-button::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: currentColor;
}

.gform_wrapper .gquiz-answer-explanation .close-button::before {
    transform: rotate(45deg);
}

.gform_wrapper .gquiz-answer-explanation .close-button::after {
    transform: rotate(-45deg);
}

/* Add padding to the top of the explanation content to account for the close button */
.gform_wrapper .gquiz-answer-explanation h4 {
    font-size: var(--step-0) !important;
    margin-bottom: var(--space-xs) !important;
    padding-right: 30px; /* Make room for the close button */
}

/* Show explanation with animation */
.gform_wrapper .gquiz-answer-explanation.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%);
    display: block;
}

/* Disabled state */
.gform_wrapper .ginput_container_radio .gfield_radio .gfield-choice-input:disabled + .gfield-choice-label {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Ensure the flash effect covers the entire choice */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.incorrect-answer::after,
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.correct-answer::after {
    border-radius: 8px;
}

/* Ensure the icon appears centered */
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.incorrect-answer::before,
.gform_wrapper .ginput_container_radio .gfield_radio .gchoice.correct-answer::before {
    border-radius: 8px;
}

@keyframes flashIncorrect {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    20% {
        opacity: 0.7;
    }
    70% {
        opacity: 0.7;
    }
    85% {
        opacity: 0.4;
    }
    95% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
    }
}

@keyframes flashCorrect {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    20% {
        opacity: 0.7;
    }
    80% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
    }
}

@keyframes showCheckmark {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    30% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes showCross {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    30% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.gform_page {
    transition: opacity 0.5s ease-in-out;
    position: relative;
}

/* Fade in and out animations */
.gform_page.gform_page_fade_in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.gform_page.gform_page_fade_out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

/* Previous button animations (same fade effect) */
.gform_page.gform_page_fade_in_prev {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.gform_page.gform_page_fade_out_prev {
    animation: fadeOut 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Text input styling */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="password"],
.gform_wrapper input[type="search"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="date"],
.gform_wrapper textarea,
.gform_wrapper select {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid var(--bricks-color-olyyze) !important;
    border-radius: 10px !important;
    color: white !important;
    padding: var(--space-s) !important;
    font-size: var(--step-0) !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
}

/* Focus state */
.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper input[type="url"]:focus,
.gform_wrapper input[type="password"]:focus,
.gform_wrapper input[type="search"]:focus,
.gform_wrapper input[type="tel"]:focus,
.gform_wrapper input[type="number"]:focus,
.gform_wrapper input[type="date"]:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus {
    outline: none !important;
    border-color: var(--bricks-color-akmdqk) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

/* Placeholder color */
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1 !important;
}

/* Label styling */
.gform_wrapper .gfield_label {
    color: white !important;
    font-size: var(--step-1) !important;
    margin-bottom: var(--space-3xs) !important;
    font-family: 'Jockey One', sans-serif !important;
}

.gform_wrapper .gform-field-label--type-sub {
    color: white !important;
}
.gform_wrapper h2.game-form-subtitle {
    font-size: var(--step-2);
    line-height: 1.2;
    color: white;
    font-family: 'Jockey One', sans-serif;
    text-align: center;
    margin-bottom: var(--space-s);
    text-wrap: balance;
    text-transform: none !important;
}
.gform_wrapper .game-form-cert-notification {
    font-size: var(--step-0);
    line-height: 1.2;
    color: white;
    font-family: 'Orbit', sans-serif;
    text-align: left;
    margin-bottom: var(--space-xs);
    text-wrap: pretty;
    text-transform: none !important;
}
.gform_wrapper .gform_fields {
    row-gap: var(--space-s) !important;
}
.gform_wrapper .gfield--input-type-email {
    margin-bottom: var(--space-s) !important;
}
.gform_wrapper .gform_validation_errors {
    display: none !important;
}
.gform_wrapper .gfield_error input {
    border-color: var(--bricks-color-dznxlg) !important;
}

/* For Arabic pages */
.language-arabic .gform_wrapper .ginput_container_radio .gfield_radio .gform-field-label {
    text-align: right;
	justify-content: end;
}

.choice-letter {
    display: inline-block;
    margin: 0 4px;
}

/* For Arabic pages, adjust the margin direction */
.language-arabic .choice-letter {
    margin-left: var(--space-s);
    margin-right: 0 !important;
	min-width: var(--step-4)
}