/* Base Styles */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --correct-color: #2ecc71;
    --incorrect-color: #e74c3c;
    --warning-color: #f39c12;
    --pass-color: #27ae60;
    --fail-color: #e74c3c;
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Screen Styles */
.screen {
    display: block;
}

.hidden {
    display: none;
}

/* Intro Screen */
.intro-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.instructions {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid var(--accent-color);
}

.instructions h2 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.instructions p, .instructions li {
    margin-bottom: 10px;
}

.instructions ol, .instructions ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.time-warning {
    background-color: #fff3cd;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    border-left: 5px solid var(--warning-color);
}

/* Test Screen */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.test-info {
    font-weight: bold;
    color: var(--secondary-color);
}

.timer {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 10px;
}

.progress-bar {
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
}

.question-container {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 25px;
    line-height: 1.6;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option {
    padding: 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option:hover {
    background-color: #e9e9e9;
}

.option.selected {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.nav-btn {
    padding: 12px 25px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.nav-btn:hover {
    background-color: #1a252f;
}

.nav-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.submit-btn {
    background-color: var(--primary-color);
}

.submit-btn:hover {
    background-color: #c0392b;
}

/* Results Screen */
.results-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    gap: 50px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--dark-color);
    border: 10px solid var(--accent-color);
}

.score-text {
    font-size: 1.2rem;
}

.score-text p {
    margin-bottom: 10px;
}

.pass-text {
    color: var(--pass-color);
    font-weight: bold;
    font-size: 1.3rem;
}

.fail-text {
    color: var(--fail-color);
    font-weight: bold;
    font-size: 1.3rem;
}

.section-breakdown {
    margin-bottom: 40px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 150px 1fr 80px;
    align-items: center;
    gap: 15px;
}

.breakdown-label {
    font-weight: bold;
}

.breakdown-bar {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 10px;
    transition: width 1s ease;
}

.breakdown-score {
    text-align: right;
    font-weight: bold;
}

.feedback-section {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.feedback-text p {
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #2980b9;
}

/* Review Screen */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.review-questions-container {
    margin-top: 20px;
}

.review-question {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.review-question.correct {
    border-left: 4px solid var(--correct-color);
}

.review-question.incorrect {
    border-left: 4px solid var(--incorrect-color);
}

.review-question-text {
    font-weight: bold;
    margin-bottom: 15px;
}

.review-options {
    margin-bottom: 15px;
}

.review-option {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
}

.review-option.selected {
    font-weight: bold;
}

.review-option.correct-answer {
    background-color: rgba(46, 204, 113, 0.2);
    border-left: 3px solid var(--correct-color);
}

.review-option.incorrect-answer {
    background-color: rgba(231, 76, 60, 0.2);
    border-left: 3px solid var(--incorrect-color);
}

.explanation {
    font-style: italic;
    color: #555;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .score-display {
        flex-direction: column;
        gap: 20px;
    }
    
    .breakdown-item {
        grid-template-columns: 1fr;
    }
    
    .breakdown-label {
        margin-bottom: 5px;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn, .btn {
        width: 100%;
    }
}
