* {
    box-sizing: border-box;
}

.review-hint {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 13px;
    color: #555;
    background: #f0f7ff;
    border-left: 3px solid #007bff;
    border-radius: 4px;
}

.solution-box {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f8fff4;
    border-left: 3px solid #2d8a34;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.solution-title {
    margin: 0 0 6px;
    font-weight: 700;
    color: #1f6024;
}

.solution-text {
    margin: 0;
    color: #2f2f2f;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: #f9f9f9;
    margin: 0;
    padding: 0;
}

.container,
.question-block,
.score-card,
.option-text,
a,
p,
h1,
h2,
h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.start-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.name_place {
    display: flex;
    justify-self: center;
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.name_place:focus {
    outline: none;
    border-color: #15b300;
    box-shadow: 0 0 10px rgba(21, 179, 0, 0.3);
    background-color: #f0fff0;
}

.name_place::placeholder {
    color: #999;
    font-style: italic;
}
#start_btn{
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: fit-content;
    padding: 12px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 20px;
    background: #007bff;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    overflow: hidden;
}
#start_btn:hover{
     background: #15b300;
    transform:scale(1.02) translateY(-2px);
     box-shadow: 0 2px 8px rgba(208, 132, 0, 0.8);
     overflow: hidden;
}
.start_test{
    text-decoration: none;
    color: white;
}

#timer {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    border: 2px solid transparent;
    font-size: 30px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(7, 233, 18, 0.871);
    border-radius: 8px;
    background-color: #fff;
    max-width: calc(100vw - 20px);
    word-break: break-word;
}

.container {
    max-width: 800px;
    width: calc(100% - 24px);
    margin: 50px auto;
    background: #fff;
    padding: 25px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.question-block {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #1dc0dd;
    border-radius: 8px;
    background: #f7f7f7;
}
.question-block:hover{
    box-shadow: 0 8px 20px rgba(72, 9, 9, 0.7);
    z-index: 2;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid black;
}

.option input {
    margin-top: 3px;
    flex-shrink: 0;
}

.option-text {
    min-width: 0;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
}

.option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}
.option:hover{
    transform: translate(5px);
    box-shadow: 0 2px 8px rgba(26, 10, 202, 0.8);
}
.option.selected {
    outline: 2px solid #ffa500;  
}
.submit-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: #007bff;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.submit-btn:hover {
    background: #15b300;
    transform:scale(1.05) translateY(-4px);
     box-shadow: 0 2px 8px rgba(208, 132, 0, 0.8);
}

.submit-review-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.submit-review-modal[hidden] {
    display: none !important;
}

.submit-review-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 20, 38, 0.55);
    z-index: 0;
}

.submit-review-panel {
    position: relative;
    z-index: 1;
    border: 1px solid #bfdcff;
    background: #f2f8ff;
    border-radius: 10px;
    padding: 14px;
    margin: 0;
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.submit-review-panel h2 {
    margin: 0 0 10px;
    text-align: left;
    color: #1f3a6d;
    font-size: 20px;
}

.submit-review-meta,
.submit-review-time,
.submit-review-subtitle {
    text-align: left;
    margin: 0 0 10px;
}

.submit-review-subtitle {
    color: #1f3a6d;
    font-size: 18px;
}

.submit-review-summary {
    text-align: left;
    margin: 0 0 10px;
}

.question-number-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.q-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}

.q-link.attempted {
    background: #dbf7e4;
    border-color: #39a867;
    color: #1f6b3e;
}

.q-link.unattempted {
    background: #ffe8e8;
    border-color: #db4d4d;
    color: #8e1e1e;
}

.submit-review-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.submit-now-btn,
.close-review-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.submit-now-btn {
    background: #0a7b2c;
    color: #fff;
}

.close-review-btn {
    background: #f0f0f0;
    color: #333;
}

.submit-now-btn:hover,
.close-review-btn:hover {
    transform: translateY(-1px);
}
.quiz-form.submitted .option,
.quiz-form.submitted .option input,
.quiz-form.submitted .option span {
    pointer-events: none !important;
    cursor: default !important;
}
.quiz-form.submitted .option:hover {
    background-color: inherit !important;
    transform: none !important;
    box-shadow: none !important;
}
.score-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}
.negative-marking-note {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-top: 15px;
}

.score-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.score-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.stat-item.correct {
    border-left-color: #27ae60;
}

.stat-item.wrong {
    border-left-color: #e74c3c;
}

.stat-item.skipped {
    border-left-color: #f39c12;
}

.stat-item.final-score {
    border-left-color: #9b59b6;
    font-weight: bold;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    font-weight: bold;
    color: #2c3e50;
}

.links , .go_back {
    margin-top: 25px;
    text-align: center;
}

.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.links a,.go_back {
    display: inline-block;
    margin: 0;
    padding: 8px 15px;
    background: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
}

.links a:hover, .go_back:hover {
    background: #78840f;
    transform:scale(1.02) translateY(-3px);
     box-shadow: 5px 2px 8px rgba(122, 10, 202, 0.8);
}

img,
video,
iframe,
table {
    max-width: 100%;
}

@media (max-width: 768px) {
    .container {
        width: calc(100% - 16px);
        margin: 20px auto;
        padding: 15px;
    }

    .question-block {
        padding: 12px;
    }

    #timer {
        top: 10px;
        left: 10px;
        right: 10px;
        font-size: clamp(14px, 4vw, 18px);
        padding: 6px 8px;
    }

    .score-stats {
        grid-template-columns: 1fr;
    }

    .submit-review-panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 12px;
    }

    .option:hover,
    .question-block:hover,
    .submit-btn:hover,
    .links a:hover,
    .go_back:hover {
        transform: none;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    #start_btn,
    .submit-btn,
    .submit-now-btn,
    .close-review-btn,
    .links a,
    .go_back {
        width: 100%;
    }

    .links {
        flex-direction: column;
        align-items: stretch;
    }

    .submit-review-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
