/**
 * 診断クイズプラグイン - フロントエンドCSS（更新版）
 * SVGデザインに準拠したスタイル
 */

/* コンテナスタイル */
.diagnosis-quiz-container {
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5e5;
    font-family: Arial, sans-serif;
}

/* ヘッダースタイル */
.diagnosis-quiz-header {
    margin-bottom: 30px;
    text-align: center;
}

.diagnosis-quiz-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.diagnosis-quiz-description {
    font-size: 14px;
    color: #666;
}

/* 進捗バースタイル */
.diagnosis-quiz-progress-container {
    margin-bottom: 30px;
}

.diagnosis-quiz-progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.diagnosis-quiz-progress-indicator {
    height: 100%;
    background-color: #4caf50;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.diagnosis-quiz-progress-text {
    font-size: 12px;
    color: #666;
    text-align: left;
}

/* 質問スタイル */
.diagnosis-quiz-question {
    display: none;
    margin-bottom: 30px;
}

.diagnosis-quiz-question.active {
    display: block;
}

.diagnosis-quiz-question-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    line-height: 1.4;
}

/* 選択肢スタイル */
.diagnosis-quiz-choices {
    margin-bottom: 30px;
}

.diagnosis-quiz-choice {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.diagnosis-quiz-choice input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.diagnosis-quiz-choice-text {
    display: block;
    padding: 15px 20px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    transition: all 0.2s ease;
    position: relative;
    font-size: 14px;
    color: #333;
}

.diagnosis-quiz-choice:hover .diagnosis-quiz-choice-text {
    background-color: #f8f8f8;
}

.diagnosis-quiz-choice input[type="radio"]:checked + .diagnosis-quiz-choice-text {
    background-color: #f0f7ff;
    border-color: #0073aa;
    border-width: 2px;
}

.diagnosis-quiz-choice input[type="radio"]:checked + .diagnosis-quiz-choice-text:after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-color: #0073aa;
    border-radius: 50%;
}

.diagnosis-quiz-choice input[type="radio"]:checked + .diagnosis-quiz-choice-text:before {
    content: '';
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    z-index: 1;
}

/* エラースタイル */
.diagnosis-quiz-error {
    color: #dc3232;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* ナビゲーションスタイル */
.diagnosis-quiz-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.diagnosis-quiz-prev-btn,
.diagnosis-quiz-next-btn,
.diagnosis-quiz-submit-btn,
.diagnosis-quiz-restart-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    font-family: Arial, sans-serif;
}

.diagnosis-quiz-prev-btn {
    background-color: #f0f0f0;
    color: #666;
}

.diagnosis-quiz-prev-btn:hover {
    background-color: #e0e0e0;
}

.diagnosis-quiz-next-btn,
.diagnosis-quiz-submit-btn {
    background-color: #0073aa;
    color: #fff;
}

.diagnosis-quiz-next-btn:hover,
.diagnosis-quiz-submit-btn:hover {
    background-color: #005f8b;
}

.diagnosis-quiz-restart-btn {
    background-color: #4caf50;
    color: #fff;
}

.diagnosis-quiz-restart-btn:hover {
    background-color: #3d8b40;
}

/* 結果スタイル */
.diagnosis-quiz-results {
    margin-top: 20px;
}

.diagnosis-quiz-result {
    text-align: center;
    padding: 30px 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e5e5e5;
}

.diagnosis-quiz-result-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.diagnosis-quiz-result-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* ローディングスタイル */
.diagnosis-quiz-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.diagnosis-quiz-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.diagnosis-quiz-loading-text {
    font-size: 18px;
    color: #333;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* レスポンシブ調整 */
@media screen and (max-width: 600px) {
    .diagnosis-quiz-container {
        padding: 15px;
        margin: 20px 10px;
        width: auto;
    }
    
    .diagnosis-quiz-title {
        font-size: 20px;
    }
    
    .diagnosis-quiz-description {
        font-size: 14px;
    }
    
    .diagnosis-quiz-question-text {
        font-size: 16px;
    }
    
    .diagnosis-quiz-choice-text {
        padding: 12px 15px;
    }
    
    .diagnosis-quiz-prev-btn,
    .diagnosis-quiz-next-btn,
    .diagnosis-quiz-submit-btn,
    .diagnosis-quiz-restart-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .diagnosis-quiz-result-title {
        font-size: 20px;
    }
    
    .diagnosis-quiz-result-description {
        font-size: 14px;
    }
}