* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: #f5f5f0;
    min-height: 100vh;
    padding: 20px;
    color: #2c3e50;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Styles - Same as other pages */
.main-nav {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 20px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 4px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px 30px;
    border-bottom: 4px solid #3498db;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content > div:first-child {
    flex: 1;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 300;
}

.home-button {
    display: inline-block;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.home-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.test-controls {
    padding: 40px 30px;
    background: #fafafa;
}

.course-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.course-selector label {
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.course-selector select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    min-width: 300px;
}

.course-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.course-selector button {
    padding: 12px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px; /* Touch-friendly minimum size */
}

.course-selector button:hover {
    background: #2980b9;
}

.test-container {
    padding: 30px;
    background: #fafafa;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.test-info h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.question-counter {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.timer {
    background: #ecf0f1;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.question-container {
    margin-bottom: 30px;
}

.question {
    background: white;
    padding: 25px;
    border-radius: 6px;
    border-left: 5px solid #3498db;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.options {
    list-style: none;
}

.option {
    padding: 15px 20px;
    margin: 12px 0;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px; /* Touch-friendly minimum size */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.option span {
    flex: 1;
}

.option:hover {
    background: #f0f7ff;
    border-color: #3498db;
}

.option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3498db;
}

.option.selected {
    background: #e8f4f8;
    border-color: #3498db;
    font-weight: 600;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.test-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.test-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#prevBtn, #nextBtn {
    background: #95a5a6;
    color: white;
}

#prevBtn:hover:not(:disabled), #nextBtn:hover {
    background: #7f8c8d;
}

#prevBtn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

#submitBtn {
    background: #27ae60;
    color: white;
}

#submitBtn:hover {
    background: #229954;
}

.results-container {
    padding: 40px 30px;
    background: #fafafa;
}

.results-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.score-display {
    text-align: center;
    margin-bottom: 40px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.score-text {
    font-size: 1.2rem;
    color: #34495e;
    font-weight: 600;
}

.wrong-answers {
    margin-top: 40px;
}

.wrong-answers h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.wrong-answer-item {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 5px solid #e74c3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wrong-answer-item .question-text {
    color: #2c3e50;
    margin-bottom: 15px;
}

.wrong-answer-item .explanation {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.results-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.results-actions button:first-child {
    background: #3498db;
    color: white;
}

.results-actions button:first-child:hover {
    background: #2980b9;
}

.results-actions button:last-child {
    background: #95a5a6;
    color: white;
}

.results-actions button:last-child:hover {
    background: #7f8c8d;
}

footer {
    background: #2c3e50;
    padding: 25px;
    text-align: center;
    color: #ecf0f1;
    border-top: 3px solid #3498db;
}

footer p {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

footer strong {
    color: #3498db;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

footer b {
    color: #0de546;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.about-link-footer {
    display: inline-block;
    margin-top: 15px;
    color: #3498db;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: color 0.3s ease;
    padding: 8px 15px;
    border-radius: 6px;
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.about-link-footer:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.15);
}

/* Tablet styles */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
    
    .test-container {
        padding: 25px;
    }
    
    .results-container {
        padding: 35px 25px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        padding: 10px 5px;
        font-size: 0.95rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: #2c3e50;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
        width: 100%;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    .container {
        max-width: 100%;
        border-radius: 4px;
    }
    
    header {
        padding: 25px 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .header-content > div:first-child {
        width: 100%;
    }

    .home-button {
        width: 100%;
        max-width: 200px;
        text-align: center;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .test-controls {
        padding: 30px 20px;
    }

    .course-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .course-selector label {
        font-size: 0.95rem;
    }

    .course-selector select {
        min-width: 100%;
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .course-selector button {
        width: 100%;
        padding: 12px 20px;
    }

    .test-container {
        padding: 20px 15px;
    }

    .test-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding-bottom: 15px;
    }
    
    .test-info h2 {
        font-size: 1.3rem;
    }
    
    .question-counter {
        font-size: 0.9rem;
    }
    
    .timer {
        padding: 8px 15px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }

    .question {
        padding: 20px 15px;
    }
    
    .question-text {
        font-size: 1.05rem;
        margin-bottom: 15px;
        line-height: 1.5;
    }

    .option {
        padding: 12px 15px;
        margin: 10px 0;
        font-size: 0.95rem;
    }
    
    .option input[type="radio"] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .test-actions {
        flex-direction: column;
        gap: 10px;
    }

    .test-actions button {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .results-container {
        padding: 30px 20px;
    }
    
    .results-container h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
        font-size: 2rem;
    }
    
    .score-text {
        font-size: 1.1rem;
    }
    
    .wrong-answers h3 {
        font-size: 1.2rem;
    }
    
    .wrong-answer-item {
        padding: 15px;
        margin: 12px 0;
    }
    
    .wrong-answer-item .question-text {
        font-size: 1rem;
    }
    
    .wrong-answer-item .explanation {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .results-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-actions button {
        width: 100%;
        padding: 12px 20px;
    }
    
    footer {
        padding: 20px 15px;
    }
    
    footer p {
        font-size: 0.9rem;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    header {
        padding: 20px 12px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .home-button {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .test-controls {
        padding: 25px 15px;
    }
    
    .course-selector select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .course-selector button {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .test-container {
        padding: 15px 12px;
    }
    
    .test-info h2 {
        font-size: 1.2rem;
    }
    
    .question {
        padding: 15px 12px;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .test-actions button {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .results-container {
        padding: 25px 15px;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
        font-size: 1.8rem;
    }
    
    .score-text {
        font-size: 1rem;
    }
    
    .wrong-answer-item {
        padding: 12px;
    }
    
    .wrong-answer-item .question-text {
        font-size: 0.95rem;
    }
    
    .wrong-answer-item .explanation {
        padding: 10px;
        font-size: 0.85rem;
    }
}

