/* ===== UI可視性改善の追加CSS ===== */

/* 診断フローの「次へ」ボタンの視認性向上 */
#next-1,
#next-2,
#next-3,
#next-4,
#next-5,
#next-6,
#next-7,
button[id^="next-"],
button[id$="-btn"] {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    padding: 0.875rem 2rem !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4) !important;
    border: 2px solid #047857 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

#next-1:hover,
#next-2:hover,
#next-3:hover,
#next-4:hover,
#next-5:hover,
#next-6:hover,
#next-7:hover,
button[id^="next-"]:hover,
button[id$="-btn"]:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.5) !important;
}

#next-1:disabled,
#next-2:disabled,
#next-3:disabled,
#next-4:disabled,
#next-5:disabled,
#next-6:disabled,
#next-7:disabled,
button[id^="next-"]:disabled,
button[id$="-btn"]:disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    border-color: #d1d5db !important;
    transform: none !important;
}

/* 「診断結果を見る」ボタンのゴールド強調 */
#calculate-btn,
button[onclick*="calculate"],
button.btn-gold {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.4) !important;
    border: 2px solid #B8860B !important;
}

#calculate-btn:hover,
button[onclick*="calculate"]:hover,
button.btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.5) !important;
}

/* カテゴリーカードとquiz-optionの一貫性 */
.category-card {
    background: white;
    border: 2px solid #d1d5db !important;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    border-color: #059669 !important;
    background-color: #ecfdf5 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15) !important;
}

.category-card.selected {
    border-color: #059669 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25) !important;
}

/* エラーメッセージの視認性 */
.error-message {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* フィールド直下のエラーメッセージ */
.field-error-message {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    color: #ef4444 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    margin-top: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.25rem;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    animation: slideInDown 0.3s ease-out;
}

.field-error-message i {
    color: #ef4444;
    flex-shrink: 0;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功メッセージ */
.success-message {
    background: #f0fdf4;
    border: 2px solid #10b981;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* フォーカス状態の強調 */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 3px solid rgba(5, 150, 105, 0.3) !important;
    outline-offset: 2px !important;
}

/* ===== アニメーション拡張 ===== */

/* フェードイン・アウト */
.fade-enter {
    opacity: 0;
    transform: translateY(10px);
}

.fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ローディングスピナー */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #2ECC71;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 結果カードのスタガー（遅延）表示 */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card-animate {
    opacity: 0;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-0 { animation-delay: 0.1s; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.3s; }

/* シェイクアニメーション（バリデーションエラー用） */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* フィールドエラー状態 */
.field-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* ===== 進捗バーの強化 ===== */
.progress-bar-enhanced {
    height: 10px !important;
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-enhanced .bg-green-600 {
    background: linear-gradient(90deg, #059669 0%, #10b981 50%, #34d399 100%) !important;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
    position: relative;
}

.progress-bar-enhanced .bg-green-600::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    border-radius: 999px 999px 0 0;
}

/* 進捗テキストの強調 */
.progress-text-enhanced {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #059669 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* ===== quiz-option選択時のアニメーション強化 ===== */
.quiz-option {
    position: relative;
}

.quiz-option.selected::after {
    animation: checkmarkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkmarkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.quiz-option.selected {
    animation: selectPulse 0.3s ease-out;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ===== スケルトンローディング ===== */
.skeleton-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
