/* 아기 발달과정 체크리스트 - 디자인 시스템
   흰 배경 + 연한 파란색 포인트, 둥근 카드, Material 느낌의 은은한 그림자 */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --accent: #0ea5e9;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 8px 20px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
    --radius: 20px;
    --radius-sm: 12px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --primary: #60a5fa;
    --primary-light: #1e3a5f;
    --primary-border: #2563eb;
    --accent: #38bdf8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

body {
    margin: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* 헤더 */
.app-header {
    text-align: center;
    margin-bottom: 20px;
}
.app-header .emoji { font-size: 2.5rem; }
.app-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 8px 0 4px;
}
.app-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}
.theme-toggle:hover { box-shadow: var(--shadow-hover); }

/* 카드 공통 */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

/* 생년월일 입력 + 계산 결과 */
.birth-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.birth-input-row input[type="date"] {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
}
.age-result {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.age-result .stat {
    text-align: center;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
}
.age-result .stat .num {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}
.age-result .stat .label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 진행률 바 */
.progress-wrap {
    margin-top: 14px;
}
.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.progress-track {
    height: 10px;
    border-radius: 999px;
    background: var(--primary-light);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* 검색 + 필터 */
.search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.filter-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.filter-chip:hover { border-color: var(--primary-border); }
.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 타임라인 */
.timeline {
    position: relative;
    margin-top: 24px;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}
.month-card {
    position: relative;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.2s ease;
}
.month-card.in-view { opacity: 1; transform: translateY(0); }
.month-card::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid var(--bg);
}
.month-card.current::before {
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.month-card .panel {
    cursor: default;
}
.month-card:hover .panel { box-shadow: var(--shadow-hover); }

.month-card.current .panel {
    border-color: var(--primary);
    border-width: 2px;
    animation: pulse-border 2.2s ease-in-out infinite;
}
@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.month-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.month-card-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.current-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}
.card-actions { display: flex; gap: 6px; }
.icon-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}
.icon-btn:hover { border-color: var(--primary-border); color: var(--primary); }
.icon-btn.favorited { color: #f59e0b; border-color: #fcd34d; }

.card-section { margin-top: 14px; }
.card-section h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
    font-size: 0.9rem;
    line-height: 1.6;
    padding-left: 22px;
    position: relative;
    margin-bottom: 4px;
}
.checklist li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}
.text-line { font-size: 0.9rem; line-height: 1.6; color: var(--text); margin: 0; }
.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.item-chip {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.empty-note { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* 메모 */
.note-box textarea {
    width: 100%;
    min-height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
}
.note-box .note-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}
.note-box button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.note-saved-list {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.note-saved-list .entry { margin-bottom: 4px; }
.note-saved-list .entry .date { font-weight: 700; color: var(--text); }

/* 공유 툴바 */
.share-row {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    flex-wrap: wrap;
}
.share-row button {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.share-row button:hover { border-color: var(--primary-border); color: var(--primary); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
}
.faq-item p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin: 10px 0 0; }

.no-results { text-align: center; color: var(--text-muted); padding: 32px 0; }

footer.app-footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* 반응형 */
@media (min-width: 768px) {
    .container { padding: 40px 24px 100px; }
    .age-result .stat .num { font-size: 1.5rem; }
}

/* 인쇄 */
@media print {
    .theme-toggle, .search-input, .filter-row, .share-row, .icon-btn, .note-box, #birth-panel { display: none !important; }
    body { background: white; color: black; }
    .month-card { opacity: 1 !important; transform: none !important; page-break-inside: avoid; }
    .panel { box-shadow: none; border: 1px solid #ccc; }
    .timeline::before { display: none; }
}
