/* LP診断システム フロントエンド用スタイル（縦を長く：6個選択肢対応） */
.lp-diagnosis-container {
    max-width: 600px; /* 元の横幅に戻す */
    margin: 0 auto;
    padding: 20px; /* 元のパディングに戻す */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Hiragino Sans', 'ヒラギノ角ゴシック', 'Yu Gothic', 'YuGothic', sans-serif;
    position: relative;
    /* 高さを大幅に拡大（6個の選択肢に対応）＋スクロール維持 */
    min-height: 600px; /* 最低高さを設定 */
    max-height: 85vh; /* 画面サイズを超えた場合はスクロール */
    overflow-y: auto; /* スクロール有効のまま */
    overflow-x: hidden;
}

/* カスタムスクロールバー */
.lp-diagnosis-container::-webkit-scrollbar {
    width: 8px;
}

.lp-diagnosis-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.lp-diagnosis-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.lp-diagnosis-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 質問エリア - 縦を大幅に拡大 */
.lp-diagnosis-questions {
    min-height: 500px; /* 200px → 500px に大幅拡大 */
    position: relative;
}

.question-slide {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    display: none;
    /* パディング調整でコンパクト化 */
    padding: 10px 0; /* 上下にスペース追加 */
}

/* 表示状態の質問スライド */
.question-slide[style*="display: block"],
.question-slide[style*="display:block"] {
    display: block !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* 非表示状態の質問スライド */
.question-slide[style*="display: none"],
.question-slide[style*="display:none"] {
    display: none !important;
    opacity: 0 !important;
    transform: translateX(20px) !important;
}

.question-slide h4 {
    font-size: 18px; /* 20px → 18px に縮小 */
    color: #333;
    margin-bottom: 20px; /* 25px → 20px に縮小 */
    line-height: 1.5; /* 1.6 → 1.5 に縮小 */
    font-weight: 600;
    /* 文字サイズの動的調整 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 質問文の長さに応じた文字サイズ調整（JavaScript不要のシンプル版） */
.question-slide h4[data-length="long"] {
    font-size: 16px;
    line-height: 1.4;
}

.question-slide h4[data-length="very-long"] {
    font-size: 14px;
    line-height: 1.3;
}

/* 回答オプション */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 12px → 10px に縮小 */
}

.answer-options.yesno,
.answer-options.multiple {
    gap: 12px; /* 15px → 12px に縮小 */
}

.answer-options.scale {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px; /* 10px → 8px に縮小 */
}

/* 回答ボタン */
.answer-btn {
    padding: 12px 20px; /* 15px 25px → 12px 20px に縮小 */
    border: 2px solid #e0e0e0;
    background: #ffffff;
    border-radius: 8px;
    font-size: 15px; /* 16px → 15px に縮小 */
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    min-height: 45px; /* 50px → 45px に縮小 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.answer-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    position: relative;
}

/* 選択済み状態のチェックマーク */
.answer-btn.selected::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 14px;
    font-weight: bold;
}

.answer-btn.clicked {
    animation: btnClick 0.2s ease;
}

@keyframes btnClick {
    0% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-2px) scale(0.95); }
    100% { transform: translateY(-2px) scale(1); }
}

/* スケール回答専用 */
.scale-btn {
    flex: 1;
    max-width: 55px; /* 60px → 55px に縮小 */
    min-width: 45px; /* 50px → 45px に縮小 */
    padding: 10px 6px; /* 12px 8px → 10px 6px に縮小 */
    font-weight: 600;
    font-size: 14px; /* 明示的にサイズ指定 */
}

/* テキスト回答 */
.answer-options.text {
    gap: 15px; /* 20px → 15px に縮小 */
}

.answer-text {
    width: 100%;
    min-height: 80px; /* 100px → 80px に縮小 */
    padding: 12px; /* 15px → 12px に縮小 */
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px; /* 16px → 15px に縮小 */
    color: #333;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.answer-text:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.next-btn {
    align-self: flex-end;
    padding: 10px 25px; /* 12px 30px → 10px 25px に縮小 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px; /* 16px → 15px に縮小 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* 無効化された次へボタン */
.next-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.next-btn.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* バリデーションエラースタイル */
.validation-error {
    background: #ffebee;
    border: 1px solid #f44336;
    border-left: 4px solid #f44336;
    color: #c62828;
    padding: 10px 12px; /* 12px 15px → 10px 12px に縮小 */
    margin-bottom: 15px; /* 20px → 15px に縮小 */
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: errorSlideDown 0.3s ease;
    font-size: 14px; /* 明示的にサイズ指定 */
}

.validation-error .dashicons {
    font-size: 16px; /* 18px → 16px に縮小 */
    flex-shrink: 0;
}

.validation-error .error-text {
    font-weight: 500;
}

@keyframes errorSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 結果エリア */
.lp-diagnosis-result {
    text-align: center;
    padding: 30px 15px; /* 40px 20px → 30px 15px に縮小 */
}

.lp-diagnosis-result h3 {
    color: #333;
    font-size: 24px; /* 28px → 24px に縮小 */
    margin-bottom: 15px; /* 20px → 15px に縮小 */
    font-weight: 600;
}

.lp-diagnosis-result > p {
    color: #666;
    font-size: 15px; /* 16px → 15px に縮小 */
    margin-bottom: 25px; /* 30px → 25px に縮小 */
}

/* 完了時の各タイプ共通スタイル */
.completion-message,
.completion-redirect,
.completion-image-link,
.completion-custom-html {
    text-align: center;
    padding: 30px 15px; /* 40px 20px → 30px 15px に縮小 */
}

.completion-content {
    margin: 15px 0; /* 20px 0 → 15px 0 に縮小 */
    line-height: 1.6;
    color: #555;
    font-size: 15px; /* 明示的にサイズ指定 */
}

/* 完了時画像 */
.completion-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-link {
    display: inline-block;
    text-decoration: none;
}

.image-link:hover .completion-image {
    transform: scale(1.05);
}

.image-description {
    margin: 12px 0; /* 15px 0 → 12px 0 に縮小 */
    font-size: 15px; /* 16px → 15px に縮小 */
    color: #666;
}

/* リダイレクト用カウントダウン */
.redirect-countdown {
    background: #f8f9ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px; /* 20px → 15px に縮小 */
    margin: 15px 0; /* 20px 0 → 15px 0 に縮小 */
}

.countdown-timer {
    font-size: 40px; /* 48px → 40px に縮小 */
    font-weight: bold;
    color: #667eea;
    margin: 8px 0; /* 10px 0 → 8px 0 に縮小 */
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 完了時アクション */
.completion-actions {
    margin-top: 25px; /* 30px → 25px に縮小 */
    padding-top: 15px; /* 20px → 15px に縮小 */
    border-top: 1px solid #e8ecff;
}

.restart-btn {
    padding: 12px 25px; /* 15px 30px → 12px 25px に縮小 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px; /* 16px → 15px に縮小 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* 統計表示 */
.result-stats {
    font-size: 13px; /* 14px → 13px に縮小 */
    color: #666;
    background: #f8f9ff;
    padding: 8px 12px; /* 10px 15px → 8px 12px に縮小 */
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin: 12px 0; /* 15px 0 → 12px 0 に縮小 */
    display: inline-block;
}

/* 分岐メッセージ */
.branching-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px; /* 20px 30px → 15px 25px に縮小 */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    animation: messageSlideIn 0.5s ease;
}

.branching-redirect-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 25px; /* 30px → 25px に縮小 */
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    text-align: center;
    animation: messageSlideIn 0.5s ease;
}

.redirect-content h4 {
    color: #667eea;
    margin: 8px 0; /* 10px 0 → 8px 0 に縮小 */
    font-size: 18px; /* 20px → 18px に縮小 */
}

.redirect-content .dashicons {
    font-size: 28px; /* 32px → 28px に縮小 */
    color: #667eea;
}

.redirect-countdown {
    font-size: 40px; /* 48px → 40px に縮小 */
    font-weight: bold;
    color: #667eea;
    margin: 12px 0; /* 15px 0 → 12px 0 に縮小 */
    animation: pulse 1s infinite;
}

.message-content {
    display: flex;
    align-items: center;
    gap: 10px; /* 12px → 10px に縮小 */
}

.message-content .dashicons {
    font-size: 22px; /* 24px → 22px に縮小 */
}

.message-content p {
    margin: 0;
    font-size: 15px; /* 16px → 15px に縮小 */
    font-weight: 500;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ローディング効果 */
.lp-diagnosis-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: loading 2s linear infinite;
    opacity: 0;
    border-radius: 12px 12px 0 0;
}

.lp-diagnosis-container.loading::before {
    opacity: 1;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* アクセシビリティ：フォーカス状態の改善 */
.answer-btn:focus,
.answer-text:focus,
.next-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* スクリーンリーダー用の隠しテキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .lp-diagnosis-container {
        margin: 10px;
        padding: 25px; /* 外枠の余白を少し増やす */
        max-height: 85vh; /* モバイルでは少し高めに */
    }
    
    .question-slide h4 {
        font-size: 16px; /* 18px → 16px に縮小 */
        margin-bottom: 15px; /* 20px → 15px に縮小 */
    }
    
    .answer-btn {
        padding: 10px 15px; /* 12px 20px → 10px 15px に縮小 */
        font-size: 14px; /* 15px → 14px に縮小 */
        min-height: 40px; /* 45px → 40px に縮小 */
    }
    
    .answer-options.scale {
        gap: 6px; /* 8px → 6px に縮小 */
    }
    
    .scale-btn {
        min-width: 40px; /* 45px → 40px に縮小 */
        max-width: 45px; /* 55px → 45px に縮小 */
        padding: 8px 5px; /* 10px 6px → 8px 5px に縮小 */
        font-size: 13px; /* 14px → 13px に縮小 */
    }
    
    .completion-message,
    .completion-redirect,
    .completion-image-link,
    .completion-custom-html {
        padding: 25px 12px; /* 30px 15px → 25px 12px に縮小 */
    }
    
    .countdown-timer {
        font-size: 32px; /* 40px → 32px に縮小 */
    }
    
    .answer-text {
        min-height: 70px; /* 80px → 70px に縮小 */
        padding: 10px; /* 12px → 10px に縮小 */
    }
}

@media (max-width: 480px) {
    .lp-diagnosis-container {
        margin: 5px;
        padding: 20px; /* 外枠の余白を少し増やす */
        max-height: 90vh; /* 小画面では高めに設定 */
    }
    
    .question-slide h4 {
        font-size: 15px; /* 16px → 15px に縮小 */
        margin-bottom: 12px; /* 15px → 12px に縮小 */
    }
    
    .answer-btn {
        padding: 8px 12px; /* 10px 15px → 8px 12px に縮小 */
        font-size: 13px; /* 14px → 13px に縮小 */
        min-height: 36px; /* 40px → 36px に縮小 */
    }
    
    .answer-options.scale {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px; /* 6px → 5px に縮小 */
    }
    
    .scale-btn {
        flex: none;
        width: 38px; /* 40px → 38px に縮小 */
        padding: 6px 4px; /* 8px 5px → 6px 4px に縮小 */
        font-size: 12px; /* 13px → 12px に縮小 */
    }
    
    .completion-message,
    .completion-redirect,
    .completion-image-link,
    .completion-custom-html {
        padding: 20px 10px; /* 25px 12px → 20px 10px に縮小 */
    }
    
    .restart-btn {
        padding: 10px 20px; /* 12px 25px → 10px 20px に縮小 */
        font-size: 14px; /* 15px → 14px に縮小 */
    }
    
    .answer-text {
        min-height: 60px; /* 70px → 60px に縮小 */
        font-size: 14px; /* 15px → 14px に縮小 */
    }
}

/* 質問文の長さに応じた動的調整用のJavaScript補助クラス */
.question-text-short { font-size: 18px; line-height: 1.5; }
.question-text-medium { font-size: 16px; line-height: 1.4; }
.question-text-long { font-size: 14px; line-height: 1.3; }
.question-text-very-long { font-size: 13px; line-height: 1.25; }