/* ===============================
   リセット & 基本スタイル
   =============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* メインカラー */
    --primary-color: #4CAF93;
    --primary-light: #6ECEB2;
    --primary-dark: #3A9178;
    
    /* アクセントカラー */
    --accent-color: #FF9A76;
    --accent-light: #FFB396;
    
    /* グレースケール */
    --text-dark: #2C3E50;
    --text-gray: #5A6C7D;
    --bg-light: #F8FAFB;
    --white: #FFFFFF;
    
    /* タイプ別カラー */
    --type-a-color: #FF6B6B;
    --type-b-color: #4ECDC4;
    --type-c-color: #FFB347;
    
    /* シャドウ */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #E8F5F1 0%, #F0F9FF 100%);
    color: var(--text-dark);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===============================
   ページ共通スタイル
   =============================== */
.page {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

.content-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* ===============================
   トップページ
   =============================== */
.hero-section {
    width: 100%;
    overflow: hidden;
    max-height: 45vh;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.main-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    margin: 30px 0 20px;
    line-height: 1.5;
}

.intro-text {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin: 20px 0 30px;
    text-align: center;
}

.intro-text p {
    font-size: 1rem;
    color: var(--text-gray);
    margin: 8px 0;
}

.highlight-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 16px !important;
}

.start-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.button-icon {
    font-size: 1.3rem;
}

/* ===============================
   診断ページ
   =============================== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.3);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    transition: width 0.4s ease;
    width: 0%;
}

.question-counter {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: 30px 0 20px;
    font-weight: 500;
}

.question-counter span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.question-text {
    background: var(--white);
    padding: 28px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-button {
    background: var(--white);
    border: 2px solid #E8F0F2;
    border-radius: 12px;
    padding: 18px 20px;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.option-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(78, 205, 196, 0.1), transparent);
    transition: left 0.5s ease;
}

.option-button:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

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

.option-button:active {
    transform: scale(0.98);
}

/* ===============================
   結果ページ
   =============================== */
.result-header {
    text-align: center;
    margin: 30px 0;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.result-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
}

.result-card {
    background: var(--white);
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.result-type-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    text-align: center;
}

.result-type-badge.type-a {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
}

.result-type-badge.type-b {
    background: linear-gradient(135deg, #4ECDC4 0%, #6FE0D8 100%);
}

.result-type-badge.type-c {
    background: linear-gradient(135deg, #FFB347 0%, #FFC670 100%);
}

.result-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 16px;
    margin: 20px auto;
    display: block;
    box-shadow: var(--shadow-sm);
}

.result-type-name {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin: 20px 0 30px;
    color: var(--text-dark);
}

.result-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.result-section.highlight-section {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3D6 100%);
    border: 2px solid var(--accent-color);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-text {
    font-size: 1rem;
    color: var(--text-gray);
    line-height: 1.8;
}

/* ===============================
   SNSシェアセクション
   =============================== */
.share-section {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin: 24px 0;
}

.share-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-button {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.share-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.share-icon {
    width: 20px;
    height: 20px;
}

.line-button {
    background: #06C755;
}

.line-button:hover:not(:disabled) {
    background: #05B04D;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.x-button {
    background: #000000;
}

.x-button:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.instagram-button {
    background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCAF45 100%);
}

.instagram-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===============================
   CTAセクション
   =============================== */
.cta-section {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin: 24px 0;
}

.cta-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.6;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--white);
    color: var(--accent-color);
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-button .arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.cta-button:hover .arrow {
    transform: translateX(4px);
}

/* ===============================
   リトライボタン
   =============================== */
.retry-button {
    width: 100%;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.retry-button:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===============================
   フッター
   =============================== */
.footer {
    text-align: center;
    padding: 24px 20px;
    background: rgba(255,255,255,0.8);
    color: var(--text-gray);
    font-size: 0.85rem;
    position: relative;
    margin-top: 40px;
}

/* ===============================
   レスポンシブ調整
   =============================== */
@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 1.1rem;
        padding: 24px 20px;
        min-height: 100px;
    }
    
    .result-type-name {
        font-size: 1.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-button {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .content-wrapper {
        padding: 40px 20px;
    }
    
    .hero-section {
        max-height: 50vh;
    }
    
    .main-title {
        font-size: 2.2rem;
        margin: 40px 0 30px;
    }
    
    .question-text {
        font-size: 1.5rem;
    }
}

/* ===============================
   アニメーション
   =============================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    animation: slideInUp 0.6s ease-out;
}

.result-section {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.result-section:nth-child(1) { animation-delay: 0.1s; }
.result-section:nth-child(2) { animation-delay: 0.2s; }
.result-section:nth-child(3) { animation-delay: 0.3s; }
.result-section:nth-child(4) { animation-delay: 0.4s; }

/* ===============================
   ローディング状態
   =============================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '読み込み中...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1rem;
    z-index: 1000;
}
