/* ElegantExam Frontend Styles */

/* Import Roboto font with fallback */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Reset styles for compatibility with Elementor, Astra, and other themes */
.elegantexam-container * {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

.elegantexam-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem;
    background: #F8FAFC;
    border-radius: 8px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    position: relative;
    padding-bottom: 96px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
    .elegantexam-container {
        padding: 1rem;
    }
}

@media (min-width: 768px) {
    .elegantexam-container {
        padding: 1.5rem;
        max-width: 960px;
        border-radius: 12px;
    }
}

@media (min-width: 1024px) {
    .elegantexam-container {
        padding: 2rem;
        max-width: 1140px;
    }
}

@media (min-width: 1280px) {
    .elegantexam-container {
        max-width: 1280px;
    }
}

.elegantexam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E2E8F0;
}

.elegantexam-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.elegantexam-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .elegantexam-title {
        font-size: 1.5rem;
    }
}

#elegantexam-question-number {
    font-size: 1.125rem;
    color: #1E293B;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

#elegantexam-timer {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1E293B;
    background-color: #E2E8F0;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    line-height: 1.5;
    align-self: center;
}

@media (min-width: 768px) {
    #elegantexam-timer {
        font-size: 1rem;
    }
}

.elegantexam-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.elegantexam-question-container {
    width: 100%;
    background-color: #FFFFFF;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .elegantexam-question-container {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

.elegantexam-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.25rem, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #FFFFFF;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .elegantexam-nav-grid {
        gap: 0.75rem;
        padding: 1rem;
        border-radius: 12px;
    }
}

.elegantexam-nav-box {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    background-color: #E2E8F0;
    border: 1px solid #CBD5E1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1E293B;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
}

@media (min-width: 768px) {
    .elegantexam-nav-box {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
        font-size: 1rem;
    }
}

.elegantexam-nav-box.active {
    background-color: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
}

.elegantexam-nav-box.answered {
    background-color: #10B981;
    color: #FFFFFF;
    border-color: #10B981;
}

.elegantexam-nav-box.marked {
    border: 2px solid #F59E0B;
    background-color: #FEF3C7;
    color: #D97706;
}

.elegantexam-question-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: #1E293B;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .elegantexam-question-text {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }
}

.elegantexam-question-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
    object-fit: contain;
}

.elegantexam-options {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #E2E8F0;
}

.elegantexam-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: #F8FAFC;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .elegantexam-option {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

.elegantexam-option:hover {
    background-color: #E2E8F0;
}

.elegantexam-option.selected {
    background-color: #E0E7FF;
}

.elegantexam-option.selected .option-circle {
    background-color: #4F46E5;
    color: #FFFFFF;
    transform: scale(1.05);
}

.option-circle {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    background-color: #FFFFFF;
    border: 2px solid #1E293B;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1E293B;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
}

@media (min-width: 768px) {
    .option-circle {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        min-height: 2rem;
        font-size: 1rem;
    }
}

.elegantexam-option:hover .option-circle {
    background-color: #CBD5E1;
}

.elegantexam-option.multiple-choice {
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .elegantexam-option.multiple-choice {
        padding: 1rem;
    }
}

.elegantexam-option.multiple-choice input[type="checkbox"] {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    border: 2px solid #1E293B;
    border-radius: 4px;
    background-color: #FFFFFF;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .elegantexam-option.multiple-choice input[type="checkbox"] {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        min-height: 2rem;
        margin-right: 1rem;
    }
}

.elegantexam-option.multiple-choice input[type="checkbox"]:checked {
    background-color: #10B981;
    border-color: #10B981;
}

.elegantexam-option.multiple-choice input[type="checkbox"]:checked::after {
    content: '\2714';
    color: #FFFFFF;
    font-size: 0.875rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Roboto', 'Segoe UI Emoji', sans-serif;
}

@media (min-width: 768px) {
    .elegantexam-option.multiple-choice input[type="checkbox"]:checked::after {
        font-size: 1rem;
    }
}

.elegantexam-option.multiple-choice:hover input[type="checkbox"] {
    border-color: #4F46E5;
}

.elegantexam-option.multiple-choice.selected {
    background-color: #E0E7FF;
}

.elegantexam-free-text-container {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 1.25rem;
}

.elegantexam-free-text {
    width: 100%;
    min-height: 96px;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1E293B;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
    .elegantexam-free-text {
        min-height: 120px;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

.elegantexam-free-text:focus {
    border-color: #10B981;
    background-color: #FFFFFF;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.elegantexam-multi-free-text {
    width: 100%;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .elegantexam-multi-free-text {
        margin-bottom: 2rem;
    }
}

.elegantexam-multi-free-text-item {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .elegantexam-multi-free-text-item {
        padding: 1.25rem;
        margin-bottom: 2rem;
        border-radius: 12px;
    }
}

.elegantexam-multi-free-text-item:hover {
    background-color: #E2E8F0;
    border-color: #CBD5E1;
}

.elegantexam-multi-free-text-statement-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1E293B;
    margin-bottom: 1rem;
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .elegantexam-multi-free-text-statement-text {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
}

.elegantexam-multi-free-text-input-container {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 1rem;
}

.elegantexam-multi-free-text-input {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1E293B;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
    .elegantexam-multi-free-text-input {
        min-height: 48px;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

.elegantexam-multi-free-text-input:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    outline: none;
}

.elegantexam-matrix-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.elegantexam-matrix-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.elegantexam-matrix-table th,
.elegantexam-matrix-table td {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    word-break: break-word;
    overflow-wrap: break-word;
    position: relative;
}

.elegantexam-matrix-table th {
    background-color: #F1F5F9;
    font-weight: 600;
}

.elegantexam-matrix-table td {
    background-color: #F8FAFC;
}

.elegantexam-matrix-table td.elegantexam-matrix-statement-text {
    text-align: left;
    font-weight: 500;
}

.elegantexam-matrix-radio-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    min-height: 28px;
}

.elegantexam-matrix-radio {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
    border: 2px solid #1E293B;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
}

.elegantexam-matrix-radio:checked {
    background-color: #10B981;
    border-color: #10B981;
    position: relative;
}

.elegantexam-matrix-radio:checked::after {
    content: '';
}

.elegantexam-matrix-radio + .elegantexam-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

@media (min-width: 1024px) {
    .elegantexam-matrix-table th,
    .elegantexam-matrix-table td {
        padding: 1rem;
        font-size: 1rem;
        min-width: 120px;
    }
    .elegantexam-matrix-table td.elegantexam-matrix-statement-text {
        min-width: 160px;
    }
    .elegantexam-matrix-radio {
        width: 1.5rem;
        height: 1.5rem;
        min-width: 1.5rem;
        min-height: 1.5rem;
    }
    .elegantexam-matrix-radio + .elegantexam-icon {
        right: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .elegantexam-matrix-table th,
    .elegantexam-matrix-table td {
        padding: 0.75rem;
        font-size: 0.875rem;
        min-width: 100px;
    }
    .elegantexam-matrix-table td.elegantexam-matrix-statement-text {
        min-width: 140px;
    }
    .elegantexam-matrix-radio {
        width: 1.25rem;
        height: 1.25rem;
        min-width: 1.25rem;
        min-height: 1.25rem;
    }
    .elegantexam-matrix-radio + .elegantexam-icon {
        right: 0.75rem;
    }
}

@media (max-width: 767px) {
    .elegantexam-matrix-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .elegantexam-matrix-table {
        width: 100%;
        max-width: 100%;
        display: table;
        table-layout: auto;
    }
    .elegantexam-matrix-table th,
    .elegantexam-matrix-table td {
        min-width: 80px;
        font-size: 0.75rem;
        padding: 0.5rem;
        text-align: center;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    .elegantexam-matrix-table th.elegantexam-matrix-statement-text,
    .elegantexam-matrix-table td.elegantexam-matrix-statement-text {
        min-width: 120px;
        text-align: left;
    }
    .elegantexam-matrix-radio {
        width: 1rem;
        height: 1rem;
        min-width: 1rem;
        min-height: 1rem;
    }
    .elegantexam-matrix-radio + .elegantexam-icon {
        right: 0.5rem;
    }
}

.elegantexam-button-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1280px;
    background: transparent;
    padding: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    z-index: 1000;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .elegantexam-button-container {
        padding: 1rem;
        gap: 1rem;
    }
}

.elegantexam-button-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .elegantexam-button-group {
        gap: 1rem;
    }
}

.elegantexam-button {
    min-width: 120px;
    min-height: 44px;
    padding: 0.75rem;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .elegantexam-button {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

.elegantexam-button#elegantexam-start {
    background-color: #10B981;
}

.elegantexam-button#elegantexam-prev {
    background-color: #4F46E5;
}

.elegantexam-button#elegantexam-review {
    background-color: #E2E8F0;
    color: #1E293B;
}

.elegantexam-button#elegantexam-review.marked {
    background-color: #F59E0B;
    color: #FFFFFF;
}

.elegantexam-button#elegantexam-review:hover:not(:disabled) {
    background-color: #D97706;
    color: #FFFFFF;
}

.elegantexam-button#elegantexam-next {
    background-color: #4F46E5;
}

.elegantexam-button#elegantexam-skip {
    background-color: #F59E0B;
}

.elegantexam-button#elegantexam-check {
    background-color: #14B8A6;
}

.elegantexam-button#elegantexam-submit {
    background-color: #1E3A8A;
}

.elegantexam-button#elegantexam-view-explanation {
    background-color: #6B7280;
    display: flex;
    justify-content: center;
    align-items: center;
}

.elegantexam-button#elegantexam-retake {
    background-color: #F59E0B;
    color: #FFFFFF;
    min-width: 120px;
    margin: 1.5rem auto;
    display: block;
}

.elegantexam-button#elegantexam-retake:hover:not(:disabled) {
    background-color: #D97706;
}

.elegantexam-button:disabled {
    background-color: #D1D5DB;
    cursor: not-allowed;
    box-shadow: none;
}

.elegantexam-button:hover:not(:disabled) {
    transform: scale(1.03);
    opacity: 0.95;
}

/* Custom styles for Login button in login prompt */
.elegantexam-button#elegantexam-login {
    background-color: #1E3A8A; /* Blue color for visibility */
    color: #FFFFFF;
}

/* Adjust Close button in popup */
.elegantexam-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background-color: #DC2626; /* Red color for visibility */
    border: none;
    border-radius: 50% !important;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2020;
    outline: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    color: #FFFFFF;
    font-size: 1.25rem;
    font-family: 'Roboto', sans-serif;
    line-height: 1;
    box-sizing: border-box !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .elegantexam-popup-close {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        font-size: 1.5rem;
    }
}

.elegantexam-popup-close::after {
    content: '\2716';
}

.elegantexam-popup-close:hover {
    background-color: #B91C1C; /* Darker red on hover */
    transform: scale(1.05);
}

.elegantexam-results-header {
    text-align: center;
    margin: 1.5rem auto;
    padding: 1rem;
    background-color: #4F46E5;
    color: #FFFFFF;
    border-radius: 12px;
    max-width: 1280px;
    width: 100%;
}

@media (min-width: 768px) {
    .elegantexam-results-header {
        padding: 1.5rem;
        max-width: 960px;
    }
}

@media (min-width: 1280px) {
    .elegantexam-results-header {
        max-width: 1280px;
    }
}

.elegantexam-results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .elegantexam-results-header h2 {
        font-size: 1.75rem;
    }
}

.elegantexam-score-table {
    width: 100%;
    max-width: 1280px;
    margin: 1.5rem auto;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.elegantexam-score-table th,
.elegantexam-score-table td {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    min-width: 120px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.elegantexam-score-table th {
    background-color: #4F46E5;
    color: #FFFFFF;
    font-weight: 600;
    text-transform: uppercase;
}

.elegantexam-score-table td {
    background-color: #F8FAFC;
}

.elegantexam-score-table tr:nth-child(odd) td {
    background-color: #F1F5F9;
}

.elegantexam-score-table th:first-child {
    border-top-left-radius: 12px;
}

.elegantexam-score-table th:last-child {
    border-top-right-radius: 12px;
}

.elegantexam-score-table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.elegantexam-score-table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

@media (max-width: 767px) {
    .elegantexam-score-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    .elegantexam-score-table th,
    .elegantexam-score-table td {
        min-width: 100px;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

.elegantexam-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 1280px;
    margin: 1.5rem auto;
    width: 100%;
}

@media (min-width: 768px) {
    .elegantexam-results-list {
        gap: 1.5rem;
        max-width: 960px;
    }
}

@media (min-width: 1280px) {
    .elegantexam-results-list {
        max-width: 1280px;
    }
}

.elegantexam-result-card {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    word-break: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.elegantexam-result-card.elegantexam-correct {
    border-color: #10B981;
    background-color: #D1FAE5;
}

.elegantexam-result-card.elegantexam-incorrect {
    border-color: #EF4444;
    background-color: #FEE2E2;
}

.elegantexam-result-card.elegantexam-unanswered {
    border-color: #6B7280;
    background-color: #E5E7EB;
}

.elegantexam-result-card::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    font-family: 'Roboto', 'Segoe UI Emoji', sans-serif;
    font-size: 1.25rem;
    line-height: 1.5rem;
    text-align: center;
}

.elegantexam-result-card.elegantexam-correct::before {
    content: '\2714';
    color: #10B981;
}

.elegantexam-result-card.elegantexam-incorrect::before {
    content: '\2718';
    color: #EF4444;
}

.elegantexam-result-card.elegantexam-unanswered::before {
    content: '\2212';
    color: #6B7280;
}

.elegantexam-result-card-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E2E8F0;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .elegantexam-result-card-header {
        font-size: 1.25rem;
    }
}

.elegantexam-result-card-body {
    font-size: 0.875rem;
    color: #1E293B;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .elegantexam-result-card-body {
        font-size: 1rem;
    }
}

.elegantexam-result-question-text {
    margin-bottom: 1rem;
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.elegantexam-result-answer-container {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #F1F5F9;
    border-radius: 6px;
}

.elegantexam-result-answer-container p {
    margin: 0.5rem 0;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.elegantexam-result-answer-container p strong {
    font-weight: 600;
    color: #1E293B;
    min-width: 120px;
    display: inline-block;
}

.elegantexam-explanation-button {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 120px;
    min-height: 44px;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #FFFFFF;
    background-color: #6B7280;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin: 1rem auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .elegantexam-explanation-button {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

.elegantexam-explanation-button:hover {
    background-color: #4B5563;
    transform: scale(1.03);
    opacity: 0.95;
}

.elegantexam-back-button-container {
    text-align: center;
    margin: 1.5rem auto;
    max-width: 1280px;
}

.elegantexam-back-button {
    min-width: 120px;
    min-height: 44px;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #FFFFFF;
    background-color: #4F46E5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .elegantexam-back-button {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

.elegantexam-back-button:hover {
    background-color: #4338CA;
    transform: scale(1.03);
    opacity: 0.95;
}

.elegantexam-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.elegantexam-popup {
    background: #FFFFFF;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    min-width: 320px;
    max-height: 90vh;
    position: relative;
    overflow-y: auto;
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.elegantexam-popup:has(video),
.elegantexam-popup:has(iframe) {
    padding: 0;
    max-width: 960px;
    max-height: 90vh;
    overflow: hidden;
}

@media (max-width: 767px) {
    .elegantexam-popup {
        min-width: 300px;
        max-width: 95vw;
        max-height: 95vh;
    }
    .elegantexam-popup:has(video),
    .elegantexam-popup:has(iframe) {
        max-width: 95vw;
        max-height: 95vh;
        overflow: hidden;
    }
}

.elegantexam-popup-content {
    display: block;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 1.5rem;
}

.elegantexam-explanation-body {
    font-size: 0.875rem;
    color: #1E293B;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.elegantexam-explanation-body:has(video),
.elegantexam-explanation-body:has(iframe) {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    .elegantexam-explanation-body {
        font-size: 1rem;
    }
    .elegantexam-explanation-body:has(video),
    .elegantexam-explanation-body:has(iframe) {
        padding: 0;
    }
}

.elegantexam-explanation-body video,
.elegantexam-explanation-body iframe {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
    object-fit: contain;
    margin: 0;
    padding: 0;
}

.mejs__container {
    width: 100% !important;
    height: auto !important;
    max-height: 80vh;
    border-radius: 12px;
    margin: 0 !important;
    padding: 0 !important;
}

.mejs__controls {
    background: #1E293B;
    padding: 0.75rem;
    border-radius: 0 0 12px 12px;
}

.mejs__time {
    color: #FFFFFF;
    font-family: 'Roboto', sans-serif;
}

.mejs__playpause-button > button,
.mejs__volume-button > button,
.mejs__fullscreen-button > button {
    background-color: transparent;
    border: none;
    color: #FFFFFF;
    transition: color 0.3s ease;
}

.mejs__playpause-button > button:hover,
.mejs__volume-button > button:hover,
.mejs__fullscreen-button > button:hover {
    color: #4F46E5;
}

.mejs__time-slider {
    background: #FFFFFF;
    border-radius: 4px;
}

.mejs__time-current {
    background-color: #10B981;
}

.elegantexam-popup-content p {
    font-size: 0.875rem;
    color: #64748B;
    line-height: 1.6;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background-color: #F1F5F9;
    border-radius: 6px;
    white-space: normal;
}

@media (min-width: 768px) {
    .elegantexam-popup-content p {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

.elegantexam-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.elegantexam-icon.correct-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2310B981"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>');
}

.elegantexam-icon.incorrect-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23EF4444"><path d="M24 2.4l-2.4-2.4-9.6 9.6-9.6-9.6-2.4 2.4 9.6 9.6-9.6 9.6 2.4 2.4 9.6-9.6 9.6 9.6 2.4-2.4-9.6-9.6z"/></svg>');
}

@media (min-width: 768px) {
    .elegantexam-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
}

@media (max-width: 767px) {
    .elegantexam-icon {
        width: 1rem;
        height: 1rem;
    }
}

.elegantexam-leaderboard-table {
    width: 100%;
    max-width: 1280px;
    margin: 1.5rem auto;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    table-layout: fixed;
}

@media (max-width: 767px) {
    .elegantexam-leaderboard-table {
        width: 100%;
        max-width: 100%;
        display: table;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

.elegantexam-leaderboard-table th,
.elegantexam-leaderboard-table td {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    min-width: 120px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.elegantexam-leaderboard-table th {
    background-color: #4F46E5;
    color: #FFFFFF;
    font-weight: 600;
    text-transform: uppercase;
}

.elegantexam-leaderboard-table td {
    background-color: #F8FAFC;
}

.elegantexam-leaderboard-table tr:nth-child(odd) td {
    background-color: #F1F5F9;
}

.elegantexam-leaderboard-table th:first-child {
    border-top-left-radius: 12px;
}

.elegantexam-leaderboard-table th:last-child {
    border-top-right-radius: 12px;
}

.elegantexam-leaderboard-table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.elegantexam-leaderboard-table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.elegantexam-leaderboard-table tr.rank-1 td:first-child::before,
.elegantexam-leaderboard-table tr.rank-2 td:first-child::before,
.elegantexam-leaderboard-table tr.rank-3 td:first-child::before {
    content: '';
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
    vertical-align: middle;
    font-family: 'Segoe UI Emoji', 'Noto Color Emoji', 'Roboto', sans-serif;
}

.elegantexam-leaderboard-table tr.rank-1 td:first-child::before {
    content: '\1F947';
    font-size: 1.5rem;
}

.elegantexam-leaderboard-table tr.rank-2 td:first-child::before {
    content: '\1F948';
    font-size: 1.5rem;
}

.elegantexam-leaderboard-table tr.rank-3 td:first-child::before {
    content: '\1F949';
    font-size: 1.5rem;
}

@media (max-width: 767px) {
    .elegantexam-leaderboard-table th,
    .elegantexam-leaderboard-table td {
        min-width: 100px;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    .elegantexam-leaderboard-table tr.rank-1 td:first-child::before,
    .elegantexam-leaderboard-table tr.rank-2 td:first-child::before,
    .elegantexam-leaderboard-table tr.rank-3 td:first-child::before {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 1.25rem;
    }
}

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

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}