@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700;800&display=swap');

:root {
    --primary: #6b8e23; /* Olive Drab (目に優しい緑) */
    --primary-light: #a2b86c; /* 淡いオリーブ */
    --primary-dark: #556b2f; /* 濃いオリーブ */
    --secondary: #d4a373; /* 落ち着いたサンドベージュ */
    --text-main: #333333; /* 真っ黒ではない、柔らかいダークグレー */
    --text-muted: #666666; /* 落ち着いたグレー */
    --glass-bg: rgba(255, 252, 248, 0.9); /* 少し暖かみのある白（目に刺さらない） */
    --glass-border: rgba(230, 226, 216, 0.8);
    --bg-color: #f5f3e9; /* 落ち着いたアイボリー/ベージュ */
    --font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 15px;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #f5f3e9 0%, #e8e6d9 100%);
    overflow-x: hidden;
}

/* Background floating shapes (非常に淡く、眩しくないように) */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 15s ease-in-out infinite;
}
.shape1 {
    width: 400px; height: 400px;
    background: #d0d6b5; /* 淡いグリーン */
    top: -100px; left: -100px;
}
.shape2 {
    width: 500px; height: 500px;
    background: #e6d3c1; /* 淡いオレンジベージュ */
    bottom: -150px; right: -100px;
    animation-delay: -7s;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(20px) scale(1.05); }
    100% { transform: translateY(0px) scale(1); }
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 640px;
    position: relative;
    z-index: 10;
}

.screen {
    display: none;
    animation: slideUpFade 0.5s ease-out forwards;
}

.screen.active {
    display: block;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Cards (眩しくないように少し不透明度を高くし、影も柔らかく) */
.header-card, .content-card, .question-card, .column-card, .counseling-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); /* 非常に薄い影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-card {
    text-align: center;
    background: #ffffff;
    border-top: 5px solid var(--primary);
}

/* Typography */
h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-main);
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

p {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.subtitle {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
}

.note {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: #f0eee4; /* 薄いベージュ */
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 500;
}

/* Colorful Markers for Ego-gram */
.marker-cp { background: linear-gradient(180deg, transparent 60%, rgba(239, 68, 68, 0.4) 0) !important; font-weight: 700; color: #0f172a; padding: 0 4px; border-radius: 2px;} /* Red: Strictness */
.marker-np { background: linear-gradient(180deg, transparent 60%, rgba(236, 72, 153, 0.4) 0) !important; font-weight: 700; color: #0f172a; padding: 0 4px; border-radius: 2px;} /* Pink: Kindness */
.marker-a  { background: linear-gradient(180deg, transparent 60%, rgba(59, 130, 246, 0.4) 0) !important; font-weight: 700; color: #0f172a; padding: 0 4px; border-radius: 2px;} /* Blue: Logic */
.marker-fc { background: linear-gradient(180deg, transparent 60%, rgba(234, 179, 8, 0.4) 0) !important; font-weight: 700; color: #0f172a; padding: 0 4px; border-radius: 2px;} /* Yellow: Freedom */
.marker-ac { background: linear-gradient(180deg, transparent 60%, rgba(34, 197, 94, 0.4) 0) !important; font-weight: 700; color: #0f172a; padding: 0 4px; border-radius: 2px;} /* Green: Harmony */

/* Progress */
.progress-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    border: 1px solid var(--glass-border);
}

#question-counter {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.1rem;
    min-width: 60px;
}

.progress-bar {
    flex-grow: 1;
    height: 10px;
    background-color: #e5e3d8; /* 薄いベージュ */
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* Buttons (ギラつきをなくし、マットで落ち着いた質感に) */
button, .primary-btn {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none;
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.secondary-btn {
    background: #ffffff;
    color: var(--primary-dark);
    border: 1px solid var(--primary-light);
}

.secondary-btn:hover {
    background: #f8f9f5; /* ごく薄い緑 */
    color: var(--primary-dark);
}

/* Question Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-align: left;
    padding: 20px 24px;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.option-btn:hover {
    background: #fafbf7;
    border-color: var(--primary-light);
}

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

/* Layout for normal view */
.pdf-grid-container {
    display: flex;
    flex-direction: column;
}
.pdf-col-left, .pdf-col-right {
    display: contents; /* children flow naturally */
}

/* Layout for PDF export */
body.pdf-export-mode .app-container {
    max-width: none;
    margin: 0;
    padding: 0;
}
body.pdf-export-mode #pdf-content {
    width: 1200px;
    min-height: 1697px; /* 最小A4サイズを確保 */
    height: max-content; /* 中身に合わせて伸びる（はみ出し防止） */
    padding: 40px;
    background: #f5f3e9;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
body.pdf-export-mode .pdf-grid-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex: 1; /* takes remaining height */
    margin-top: 20px;
}
body.pdf-export-mode .pdf-col-left {
    flex: 5;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
body.pdf-export-mode .pdf-col-right {
    flex: 6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
body.pdf-export-mode .content-card,
body.pdf-export-mode .header-card {
    margin-bottom: 0;
    border-radius: 16px;
    box-shadow: none;
    border: 2px solid var(--glass-border);
}
body.pdf-export-mode .pdf-col-left .content-card,
body.pdf-export-mode .pdf-col-right .content-card {
    height: 100%;
}
body.pdf-export-mode .chart-container {
    flex: 1.2;
}
body.pdf-export-mode .counseling-card {
    flex: 0 0 auto;
}
body.pdf-export-mode .analysis-card {
    flex: 1;
}
body.pdf-export-mode .column-card, 
body.pdf-export-mode .contact-card {
    flex: 0 0 auto;
}

/* Adjust fonts for A4 */
body.pdf-export-mode h1 { font-size: 2.4rem; }
body.pdf-export-mode h2 { font-size: 1.6rem; }
body.pdf-export-mode h3 { font-size: 1.4rem; }
body.pdf-export-mode p { font-size: 1.1rem; line-height: 1.6; }
body.pdf-export-mode .analysis-item { padding: 20px; }
body.pdf-export-mode .analysis-item p { font-size: 1.1rem; }
body.pdf-export-mode .analysis-type-title { font-size: 1.6rem; }

/* Results */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
}

.analysis-type-title {
    font-size: 1.4rem;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.analysis-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-light);
    border-right: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.column-card {
    background: #f7f9f5 !important; /* 非常に淡い緑 */
    border-left: 5px solid var(--primary) !important;
}

.counseling-card {
    background: #fcfaf5 !important; /* 非常に淡いオレンジ */
    border-left: 5px solid var(--secondary) !important;
}

/* Responsive */
@media (max-width: 600px) {
    body { padding: 15px 10px; }
    .header-card, .content-card, .question-card, .column-card, .counseling-card {
        padding: 20px;
        border-radius: 12px;
    }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.25rem; }
    .option-btn { padding: 16px 20px; }
    .chart-container { height: 300px; }
}
