/* Front‑end styles for NRI Quiz plugin */

.nri-quiz-wrapper {
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    font-family: inherit;
}

/* Start screen */
.nri-quiz-start {
    padding: 40px;
    text-align: center;
}
.nri-quiz-start h2 {
    margin-top: 0;
    font-size: 28px;
}
.nri-input {
    padding: 10px;
    width: 60%;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.nri-btn {
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
.nri-btn:hover {
    background: #006799;
}

/* Quiz container */
.nri-quiz-container {
    padding: 0;
}

/* Quiz header container now uses a table layout instead of flex. */
.nri-quiz-header {
    background: #2196f3;
    color: #fff;
    padding: 10px;
    font-weight: bold;
    border-bottom: 2px solid #1976d2;
}

/* Header table cells */
.nri-header-table td {
    padding: 5px 10px;
}

/* Name/photo cell */
.nri-header-name .nri-user {
    display: flex;
    align-items: center;
}

/* Timer cell */
.nri-header-time .nri-time {
    color: #dc3545;
    font-weight: bold;
    font-size: 20px;
}

/* Score cell */
.nri-header-score .nri-score {
    color: #28a745;
    font-weight: bold;
    font-size: 20px;
}

/* Header sections */
.nri-header-left,
.nri-header-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 80px;
    font-size: 16px;
}
.nri-header-center {
    flex-grow: 1;
    text-align: center;
}
.nri-title {
    font-size: 18px;
    margin-bottom: 4px;
}
.nri-user {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.nri-user-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    margin-right: 8px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' stroke='%231976d2' stroke-width='2'><circle cx='12' cy='8' r='4'/><path d='M2 22c0-5 4-8 10-8s10 3 10 8' fill='none'/></svg>");
    background-size: cover;
    background-position: center;
}
.nri-countdown .nri-time,
.nri-header-left .nri-time {
    color: #dc3545;
    font-weight: bold;
}
.nri-score-box .nri-score,
.nri-header-right .nri-score {
    color: #28a745;
    font-weight: bold;
}

.nri-quiz-body {
    padding: 20px;
}

.nri-question-number {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}
.nri-question-text {
    font-size: 22px;
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight:500;
}
.nri-question-image {
    text-align: center;
    margin-bottom: 15px;
}
.nri-question-image img {
    max-height: 120px;
    max-width: 100%;
}

.nri-options {
    border-top: 1px solid #ddd;
}
.nri-option {
    display: flex;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s;
}
.nri-option:last-child {
    border-bottom: none;
}
.nri-option:hover {
    background: #f5faff;
}
.nri-option-index {
    margin-right: 10px;
    font-weight: bold;
    color: #333;
    min-width: 20px;
}
.nri-option input[type=radio] {
    margin-right: 10px;
    transform: scale(1.5);
}
.nri-option-image {
    margin-right: 10px;
    flex-shrink: 0;
}
.nri-option-image img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    background-color: #fff;
}
.nri-option-text {
    flex-grow: 1;
    font-size: 18px;
}

/* Highlight correct/incorrect answers */
.nri-option.nri-correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}
.nri-option.nri-incorrect {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

/* Confirm button */
.nri-confirm-wrapper {
    text-align: center;
    margin-top: 15px;
}
.nri-confirm-btn {
    padding: 10px 30px;
    font-size: 16px;
    margin: 0 auto;
    display: inline-block;
    background: #17a2b8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.nri-confirm-btn:hover:not(:disabled) {
    background: #138496;
}
.nri-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Result page enhancements */
.nri-result-info p {
    margin: 5px 0;
    font-size: 18px;
    font-weight:500;
}
.nri-result-message {
    font-size: 18px;
    margin: 10px 0;
}
.nri-result-summary p {
    margin: 4px 0;
    font-size: 16px;
}
.nri-performance-link {
    display: block;
    margin: 15px 0;
    color: #0073aa;
    text-decoration: underline;
}
.nri-exit-btn {
    background: #dc3545;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.nri-exit-btn:hover {
    background: #c82333;
}

/* Metrics boxes on result page */
.nri-result-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}
.nri-metric-box {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 5px;
    min-width: 180px;
    text-align: center;
}
.nri-metric-box .nri-metric-label {
    font-weight: bold;
    margin-bottom: 4px;
}
.nri-metric-box .nri-metric-value {
    font-size: 18px;
    color: #0073aa
    font-weight:500;
}

@media (max-width: 768px) {
    /* Adjust header table layout for small screens */
    .nri-header-table td {
        display: table-cell;
        width: 33%;
        text-align: center;
        padding: 5px;
    }
    .nri-header-name .nri-user {
        justify-content: center;
    }
    .nri-result-metrics {
        
        align-items: center;
    }
}

/* Result screen */
.nri-quiz-result {
    padding: 0px;
    text-align: center;
}
.nri-result-inner {
    
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    background: #fff;
}
.nri-result-status h2 {
    font-size: 32px;
    margin: 0 0 10px;
    font-weight:500;
}
.nri-check {
    width: 60px;
    height: 60px;
    margin: 10px auto;
    position: relative;
}
.nri-pass-check::before,
.nri-fail-check::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    left: 0;
    top: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.nri-pass-check::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="%2328a745"><path d="M38 72.6L13.4 48 5 56.8l33 33L95 32.9 86.4 24z"/></svg>');
}
.nri-fail-check::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="%23dc3545"><path d="M10 25l15-15 60 60-15 15z"/><path d="M85 25L70 10 10 70l15 15z"/></svg>');
}
.nri-result-score p,
.nri-result-details p {
    margin: 5px 0;
    font-size: 16px;
}
.nri-restart-btn {
    margin-top: 20px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .nri-quiz-wrapper {
        width: 100% !important;
    }
    .nri-quiz-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .nri-countdown, .nri-score-box {
        margin-top: 5px;
    }
    .nri-question-text {
        font-size: 18px;
    }
    .nri-option-text {
        font-size: 16px;
    }
}