@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* High-Contrast & Clear Theme */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff; /* より明るい背景で読みやすさを向上 */
    color: #111827; /* gray-900 - より濃い文字色 */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* テキスト選択の無効化 */
button, .option-label {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* High-contrast question card */
.question-card {
    background: white;
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1); /* 0.2sから0.1sに短縮 */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.05), 0 2px 4px -2px rgba(0,0,0,.05);
}

.question-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -4px rgba(0,0,0,.07);
    transform: translateY(-2px);
}

.question-card.answered {
    border-left: 5px solid #0d9488; /* teal-600 */
    background: #f0fdfa; /* teal-50 */
}

/* 質問ヘッダー */
.question-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.question-number-badge {
    background: linear-gradient(135deg, #14b8a6, #0d9488); /* teal */
    border-radius: 12px;
    padding: 0.75rem 1rem;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.question-number {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    display: block;
}

.question-text {
    font-size: 1.375rem; /* 少し大きく */
    font-weight: 600;
    color: #111827; /* gray-900 */
    line-height: 1.7; /* より広い行間 */
    flex: 1;
    margin: 0;
    letter-spacing: 0.025em; /* 文字間隔を追加 */
}

/* オプションコンテナ */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* オプション入力（非表示） */
.option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* オプションラベル */
.option-label {
    display: block;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid #e5e7eb; /* gray-200 */
    background: #ffffff;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-label:hover {
    border-color: #5eead4; /* teal-300 */
    background: #f0fdfa; /* teal-50 */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
}

/* オプションコンテンツ */
.option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.option-emoji {
    font-size: 1.25rem;
}

.option-text {
    flex: 1;
    font-size: 1.0625rem; /* 少し大きく */
    font-weight: 500;
    color: #1f2937; /* gray-800 - より濃い色で読みやすく */
    line-height: 1.5; /* 適切な行間 */
}

.option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db; /* gray-300 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.check-icon {
    width: 12px;
    height: 12px;
    color: white;
    transform: scale(0);
    transition: transform 0.15s ease;
}

/* 選択時のスタイル */
.option-input:checked + .option-label {
    border-color: #0d9488; /* teal-600 */
    background: #ccfbf1; /* teal-100 */
}

.option-input:checked + .option-label .option-text {
    color: #134e4a; /* teal-900 */
    font-weight: 600;
}

.option-input:checked + .option-label .option-check {
    background: #0d9488;
    border-color: #0d9488;
}

.option-input:checked + .option-label .check-icon {
    transform: scale(1);
}

/* 回答済みインジケーター */
.answer-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #10b981; /* emerald-500 */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    flex-shrink: 0;
}

.answer-indicator.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ローディングスタイル */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff; /* 統一された背景色 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(13, 148, 136, 0.2);
    border-left: 4px solid #0d9488;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

.loading-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    color: #1f2937; /* より濃い色で読みやすく */
    font-size: 1rem;
}

/* アニメーション定義 */
@keyframes slideUpFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 質問カードのアニメーション */
.opacity-0 {
    opacity: 0;
}

.translate-y-8 {
    transform: translateY(2rem);
}

.animate-slide-up {
    animation: slideUp 0.15s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-bounce-in {
    animation: bounceIn 0.15s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .question-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .question-header {
        gap: 0.75rem; /* 少し間隔を狭めて回答済みマークのスペースを確保 */
        align-items: center; /* 中央揃えで統一感を保つ */
    }
    
    .question-number-badge {
        padding: 0.5rem 0.75rem;
        min-width: 40px;
    }
    
    .question-text {
        font-size: 1.125rem;
        flex: 1;
        min-width: 0; /* min-width: 100%を削除して改行を防ぐ */
        word-break: break-word; /* 長い単語も適切に改行 */
        overflow-wrap: break-word; /* 互換性のため */
    }
    
    .answer-indicator {
        margin-left: 0.5rem; /* 適度な間隔を確保 */
        margin-top: 0;
        font-size: 0.625rem; /* さらに小さく */
        padding: 0.25rem 0.5rem; /* パディングも小さく */
        flex-shrink: 0; /* 縮小されないように */
        white-space: nowrap; /* テキストの改行を防ぐ */
    }
    
    .option-content {
        padding: 0.75rem 1rem;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
}

/* 非常に小さい画面では回答済みマークのテキストを非表示 */
@media (max-width: 480px) {
    .answer-indicator .indicator-text {
        display: none;
    }
    
    .answer-indicator {
        padding: 0.25rem;
        min-width: 24px;
        justify-content: center;
    }
} 