/* 🌙 あいめ式感情診断フォーム - サイト統一デザイン適用版 */
/* 月と星の詩的世界観 × 感情ケア × 美しいデザイン言語 */

:root {
    /* サイト共通カラーパレット */
    --night-gradient: radial-gradient(ellipse at top, #3a2d5c 0%, #1A202C 80%);
    --starlight: #FBD38D;
    --moon-glow: rgba(251, 211, 141, 0.6);
    --glass-bg-light: rgba(255, 255, 255, 0.1);
    --glass-bg-medium: rgba(255, 255, 255, 0.15);
    --glass-bg-strong: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(15px);
    --glass-blur-strong: blur(20px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --purple-primary: #8b7cf6;
    --purple-secondary: #a78bfa;
    --purple-glow: rgba(139, 124, 246, 0.3);
    --purple-light: rgba(139, 124, 246, 0.1);
    
    /* 感情ケアの温かい色合い */
    --warm-text: #f7fafc;
    --gentle-text: rgba(247, 250, 252, 0.9);
    --soft-text: rgba(247, 250, 252, 0.7);
    --accent-warm: #fbd38d;
    --accent-soft: rgba(251, 211, 141, 0.3);
}

/* 🌌 統一された背景システム */
body {
    font-family: 'Noto Serif JP', serif;
    background: var(--night-gradient);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    margin: 0;
    box-sizing: border-box;
}

/* 🌟 美しい星空アニメーション */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, var(--starlight), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(251, 211, 141, 0.8), transparent),
        radial-gradient(1px 1px at 90% 40%, var(--starlight), transparent),
        radial-gradient(1px 1px at 10% 80%, rgba(251, 211, 141, 0.6), transparent),
        radial-gradient(2px 2px at 80% 30%, var(--starlight), transparent),
        radial-gradient(1px 1px at 60% 90%, rgba(251, 211, 141, 0.7), transparent);
    background-repeat: repeat;
    background-size: 300px 200px;
    animation: gentleStarTwinkle 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes gentleStarTwinkle {
    0%, 100% { opacity: 0.6; transform: translateY(0px); }
    25% { opacity: 0.8; transform: translateY(-2px); }
    50% { opacity: 1; transform: translateY(0px); }
    75% { opacity: 0.7; transform: translateY(1px); }
}

/* 🌙 メインコンテナ - ガラスモーフィズム */
.container {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur-strong);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: min(600px, calc(100vw - 40px)); /* デフォルトのレスポンシブ設定 */
    margin: 100px auto 40px auto; /* 上部にヘッダー分のマージン、下部にフッター分のマージンを追加 */
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* 🎭 詩的なタイトル */
.main-title {
    text-align: center;
    color: var(--warm-text);
    margin-bottom: 8px;
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 20px var(--purple-glow);
    line-height: 1.3;
}

.subtitle {
    text-align: center;
    color: var(--gentle-text);
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 300;
    margin: 0 0 32px 0;
    font-style: italic;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

/* 🌟 進歩を表すプログレスバー */
.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent
    );
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple-primary), var(--accent-warm));
    transition: width 0.5s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* 📋 美しいステップ表示 */
.step-container {
    margin-bottom: 30px;
}

.step-title {
    color: var(--warm-text);
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-align: center;
}

.step-description {
    color: var(--gentle-text);
    font-size: clamp(14px, 3vw, 16px);
    margin-bottom: 24px;
    text-align: center;
    font-weight: 300;
    line-height: 1.6;
}

/* 🎯 選択肢 - 月光のような優しさ */
.option {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(251, 211, 141, 0.1), 
        transparent
    );
    transition: left 0.6s ease;
}

.option:hover::before {
    left: 100%;
}

.option:hover {
    background: var(--glass-bg-medium);
    border-color: rgba(251, 211, 141, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 32px rgba(139, 124, 246, 0.2),
        0 0 0 1px rgba(251, 211, 141, 0.2);
}

.option.selected {
    background: var(--purple-light);
    border-color: var(--purple-primary);
    transform: translateY(-1px);
    box-shadow: 
        0 8px 32px var(--purple-glow),
        0 0 0 2px var(--purple-primary);
}

.option-text {
    color: var(--warm-text);
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* 🌟 魔法のようなツールチップ */
.info-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    background: linear-gradient(135deg, var(--purple-primary), var(--accent-warm));
    color: white;
    border-radius: 50%;
    cursor: help;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--purple-glow);
}

.info-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(139, 124, 246, 0.5);
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(251, 211, 141, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(251, 211, 141, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    color: #f7fafc !important;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 300;
    text-align: left;
}

.tooltip * {
    color: #f7fafc !important;
}

.tooltip-title {
    color: #FBD38D !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

.tooltip-content {
    color: #f7fafc !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin-bottom: 8px !important;
}

.tooltip-examples {
    color: rgba(247, 250, 252, 0.8) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    font-style: italic !important;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(26, 32, 44, 0.95);
}

.tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* 🎪 美しいボタン */
.button {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px var(--purple-glow);
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.6s ease;
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(139, 124, 246, 0.4);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 🌙 ナビゲーションボタン */
.nav-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.button-secondary {
    background: var(--glass-bg-medium);
    backdrop-filter: var(--glass-blur);
    color: var(--warm-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.button-secondary:hover {
    background: var(--glass-bg-strong);
    border-color: rgba(251, 211, 141, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* 📱 レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 32px 24px;
        /* margin と width は simple-diagnosis.html で設定される */
        border-radius: 20px;
    }
    
    .option {
        padding: 16px 18px;
        margin-bottom: 10px;
    }
    
    .tooltip {
        min-width: 260px;
        max-width: 90vw;
        padding: 14px 18px;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .button {
        width: 100%;
        padding: 18px 24px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 24px 20px;
    }
    
    .step-title {
        font-size: 20px;
    }
    
    .step-description {
        font-size: 14px;
    }
}

/* 🎨 特別なアニメーション効果 */
.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ✨ 魔法のような光の効果 */
.magical-glow {
    position: relative;
}

.magical-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--purple-primary), var(--accent-warm), var(--purple-secondary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magical-glow:hover::after {
    opacity: 0.3;
}

/* 🔧 元の診断システムとの互換性スタイル */
.step-info {
    text-align: center;
    margin-bottom: 30px;
    color: var(--gentle-text);
    font-size: 14px;
    font-weight: 300;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--warm-text);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.required-star {
    color: var(--accent-warm);
    margin-left: 4px;
}

select, input[type="text"], textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--warm-text);
    font-size: 14px;
    font-family: 'Noto Serif JP', serif;
    transition: all 0.3s ease;
}

select:focus, input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 2px rgba(139, 124, 246, 0.2);
}

select option {
    background: #1A202C;
    color: var(--warm-text);
}

.buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

/* 結果表示の互換性 */
.result-container {
    text-align: center;
    padding: 30px 20px;
}

.result-title {
    color: var(--warm-text);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 2px 20px var(--purple-glow);
}

.result-content {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    text-align: left;
}

.emotion-category {
    color: var(--accent-warm);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.emotion-description {
    color: var(--gentle-text);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.advice-section {
    background: rgba(251, 211, 141, 0.1);
    border-left: 4px solid var(--accent-warm);
    padding: 15px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
}

.advice-title {
    color: var(--accent-warm);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.advice-content {
    color: var(--gentle-text);
    font-size: 14px;
    line-height: 1.5;
}