* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Test List Styles */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.test-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.test-card h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.test-card p {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Test View Styles */
.test-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.test-info {
    flex: 1;
}

.test-info h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.module-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Question Styles */
.question {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.question-content {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.question-content h4,
.question-content strong {
    color: #4a5568;
    margin: 1rem 0 0.5rem 0;
}

.choices {
    display: grid;
    gap: 0.75rem;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice:hover {
    border-color: #cbd5e0;
    background: #edf2f7;
}

.choice.selected {
    border-color: #667eea;
    background: #ebf4ff;
}

.choice input[type="radio"],
.choice input[type="checkbox"] {
    margin: 0;
}

.choice-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 24px;
}

.choice-content {
    flex: 1;
}

/* Fill in the blank */
.fill-blank-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.fill-blank-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Test Controls */
.test-controls {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

/* Results Styles */
.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.score-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.score-details {
    text-align: left;
}

.score-details p {
    font-size: 1.2rem;
    color: #4a5568;
}

.question-result {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-result.correct {
    border-left: 4px solid #48bb78;
}

.question-result.incorrect {
    border-left: 4px solid #f56565;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.result-status.correct {
    background: #48bb78;
}

.result-status.incorrect {
    background: #f56565;
}

.result-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.result-answers {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-answers p {
    font-size: 0.9rem;
}

.explanation {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.explanation h4 {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.results-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .test-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .score-summary {
        flex-direction: column;
        gap: 1rem;
    }
    
    .score-details {
        text-align: center;
    }
    
    .results-controls {
        flex-direction: column;
    }
}