:root {
    --primary-color: #8e44ad;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --active-nav-bg: #f3e5f5;
    --active-nav-color: #6c3483
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f9;
    line-height: 1.6
}

.exam-header-banner {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding-top: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .03)
}

.test-footer-simple {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    background-color: #fff;
    border-top: 1px solid #eee
}

.header,
.footer {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    height: auto
}

.exam-header-details {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 3px double var(--primary-color);
    margin-bottom: 1rem;
    position: relative
}

.exam-header-details h1 {
    font-size: 2rem;
    margin-bottom: .5rem;
    color: var(--primary-color)
}

.exam-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 1.1rem
}

.header-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px
}

.back-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .3s
}

.back-link:hover {
    color: var(--primary-color)
}

.footer p,
.test-footer-simple p {
    margin: .5rem 0;
    color: #666
}

.footer a,
.test-footer-simple a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600
}

.container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 15px
}

.test-paper-container {
    display: flex;
    gap: 20px;
    margin-top: 20px
}

.sidebar {
    flex: 0 0 220px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .08)
}

.sidebar h3 {
    margin-top: 0;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2em
}

.section-nav {
    display: flex;
    flex-direction: column
}

.nav-button {
    background-color: var(--light-color);
    border: none;
    padding: 12px 15px;
    margin-bottom: 8px;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    transition: all .3s ease;
    font-size: 1rem;
    color: var(--dark-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05)
}

.nav-button:hover {
    background-color: var(--active-nav-bg);
    color: var(--active-nav-color);
    transform: translateX(3px)
}

.nav-button.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 123, 255, .2)
}

.test-content {
    flex-grow: 1;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .08)
}

.question-section {
    display: none;
    animation: fadeIn .5s ease-in-out
}

.question-section.active {
    display: block
}

.question-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    font-size: 1.8em;
    text-align: center
}

.general-instructions {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #856404
}

.question-block {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .05)
}

.question-block p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #333;
    font-size: 1.05em
}

.question-block strong {
    color: var(--dark-color)
}

.question-block label {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #444;
    cursor: pointer
}

.question-block input[type=radio] {
    margin-right: 10px;
    transform: scale(1.1);
    accent-color: var(--primary-color)
}

.question-block textarea {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-height: 100px;
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 10px;
    resize: vertical;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05)
}

.submit-test-btn {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 12px 25px;
    font-size: 1.2rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 4px 10px rgba(40, 167, 69, .2)
}

.submit-test-btn:hover {
    background-color: #218838;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, .3)
}

.test-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap
}

.next-section-btn {
    padding: 12px 25px;
    font-size: 1.2rem;
    border-radius: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 4px 10px rgba(142, 68, 173, .2)
}

.next-section-btn:hover {
    background-color: #6c3483;
    transform: translateY(-3px)
}

.solutions-section {
    padding-top: 30px;
    border-top: 2px dashed #e0e0e0;
    margin-top: 50px
}

.solutions-section h2 {
    color: var(--danger-color);
    border-bottom-color: var(--danger-color)
}

.solution-block {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-left: 5px solid var(--danger-color);
    border-radius: 8px;
    background-color: #fff9f9;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .05)
}

.solution-block h3 {
    color: var(--danger-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em
}

.solution-block p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6
}

.solution-block strong {
    color: var(--dark-color)
}

.solution-block .explanation {
    font-style: italic;
    color: #666;
    border-top: 1px dashed #f0f0f0;
    padding-top: 10px;
    margin-top: 15px
}

.btn {
    padding: 12px 28px;
    font-size: 1.1em;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all .3s
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, .3)
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff
}

.btn-secondary:hover {
    background-color: #5a6268
}

.btn:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    transform: none;
    box-shadow: none
}

.sidebar-toggle {
    display: none;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: -2px 0 8px rgba(0, 0, 0, .15);
    font-size: 1.2rem
}

@media (max-width:992px) {
    .test-paper-container {
        flex-direction: column
    }

    .sidebar-toggle {
        display: block
    }

    .sidebar {
        position: fixed;
        right: -280px;
        top: 50%;
        transform: translateY(-50%);
        width: 260px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1000;
        transition: right .3s cubic-bezier(.4, 0, .2, 1);
        border: 1px solid #eee;
        border-right: none
    }

    .sidebar.active {
        right: 0;
        max-height: none;
        overflow-y: visible
    }

    .section-nav {
        flex-direction: column
    }

    .exam-header-details {
        display: block !important;
        text-align: center;
        padding: 10px 0
    }

    .exam-header-details h1 {
        font-size: 1.5rem;
        margin-bottom: .3rem
    }

    .exam-header-details h2 {
        font-size: 1rem;
        margin-bottom: .5rem
    }

    .exam-meta {
        flex-direction: column;
        gap: .5rem;
        font-size: .9rem
    }

    .header .container {
        padding: 0 15px
    }
}

@media (max-width:768px) {
    .container {
        margin: 1rem auto
    }

    .test-content {
        padding: 20px
    }

    .test-actions {
        flex-direction: column;
        width: 100%;
        gap: 15px
    }
}

@media (max-width:480px) {
    body {
        font-size: 14px
    }

    .test-content {
        padding: 15px
    }

    .submit-test-btn,
    .next-section-btn {
        width: 100%;
        padding: 12px;
        font-size: 1.1rem
    }

    .question-section h2 {
        font-size: 1.5em
    }

    .question-block p {
        font-size: 1em
    }
}