/* 基本スタイル */
body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

main {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
}

.setting-item {
    margin-bottom: 20px;
}
.setting-item label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}
input[type="password"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

/* 結果表示 */
#feedback-text.correct { color: #2ecc71; }
#feedback-text.incorrect { color: #e74c3c; }
#explanation-box {
    background-color: #ecf0f1;
    border-left: 5px solid #3498db;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

/* ユーティリティ */
.hidden { display: none; }

/* ローディングスピナー */
#loading {
    text-align: center;
    padding: 40px;
}
.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer {
    margin-top: 30px;
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

/* ===== 選択肢ボタンのスタイル ===== */
#choices-container button {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #bdc3c7;
    background-color: #fff;
    color: #333; /* 文字色を黒に */
    border-radius: 8px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}
#choices-container button:hover:not(:disabled) {
    background-color: #ecf0f1;
    border-color: #3498db;
}
#choices-container button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
#choices-container button.selected {
    background-color: #3498db;
    color: #fff;
    border-color: #2980b9;
}
#choices-container button.correct {
    background-color: #2ecc71;
    color: #fff;
    border-color: #27ae60;
}
#choices-container button.incorrect {
    background-color: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}

/* クイズ画面のヘッダー */
#quiz-header {
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 10px;
}
#quiz-title { margin: 0; color: #2c3e50; }
#quiz-progress { margin: 5px 0 0; color: #7f8c8d; font-size: 14px; }
#question-text { white-space: pre-wrap; font-size: 1.1em; min-height: 50px; }

/* ボタン */
#submit-answer-btn, #next-step-btn, #submit-essay-btn, #restart-btn {
    width: 100%;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #3498db;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}
#submit-answer-btn:hover, #next-step-btn:hover, #submit-essay-btn:hover, #restart-btn:hover {
    background-color: #2980b9;
}


/* 英作文画面 */
#essay-prompt {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 20px;
}
#essay-textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* 結果画面 */
#score-list {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
}
#score-list li {
    font-size: 1.2em;
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
}
#final-advice {
    background-color: #e8f5e9;
    border-left: 4px solid #4CAF50;
    padding: 15px;
}

/* モード選択ボタンのデザイン */
.mode-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.mode-btn {
    flex: 1;
    padding: 20px;
    font-size: 1.2em;
    width: 100%;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}
#diagnostic-mode-btn { background-color: #2980b9; }
#diagnostic-mode-btn:hover { background-color: #3498db; }
#training-mode-btn { background-color: #27ae60; }
#training-mode-btn:hover { background-color: #2ecc71; }

.training-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.training-btn {
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}
#vocab-training-btn {
    background-color: #8e44ad; /* 紫系 */
}
#vocab-training-btn:hover {
    background-color: #9b59b6;
}
#grammar-training-btn {
    background-color: #16a085; /* 緑系 */
}
#grammar-training-btn:hover {
    background-color: #1abc9c;
}

#back-to-main-btn {
    margin-top: 10px;
    padding: 10px;
    background-color: #7f8c8d; /* グレー系 */
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
#back-to-main-btn:hover {
    background-color: #95a5a6;
}

/* 復習リストのスタイル */
.review-list {
    list-style-type: none;
    padding: 0;
}
.review-list li {
    background-color: #fdf2e9;
    border-left: 5px solid #e67e22;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
}
.review-list .question {
    font-weight: bold;
}
.review-list .answer {
    color: #27ae60;
}
#essay-training-btn {
    background-color: #f39c12; /* オレンジ系 */
}
#essay-training-btn:hover {
    background-color: #f1c40f;
}

/* 採点フィードバックのセクションスタイル */
.feedback-section {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
}
.feedback-section h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
}
/* ===== ここから追記 ===== */

/* 解説テキストの改行を有効にする */
#explanation-text {
    white-space: pre-wrap;
}
/* 自由英作文の課題文の改行を有効にする */
#essay-prompt {
    white-space: pre-wrap;
}
/* ===== ここから追記 ===== */
.word-count-guide {
    font-weight: bold;
    color: #e74c3c;
    text-align: right;
    margin-top: -10px;
    margin-bottom: 15px;
}