:root {
    --primary: #2d3436;
    --accent: #6c5ce7; /* Purple accent for brain/metabolic theme */
    --accent-light: #a29bfe;
    --bg: #f9f8ff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text: #2d3436;
    --text-muted: #636e72;
    --border: #dfe6e9;
    --shadow-bold: 0 20px 40px rgba(108, 92, 231, 0.08);
}

[data-theme="dark"] {
    --primary: #dfe6e9;
    --bg: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.95);
    --text: #f0f6fc;
    --text-muted: #8b949e;
    --border: #30363d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

header {
    height: 70px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card-bg);
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.1rem; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-selector { display: flex; background: var(--border); border-radius: 20px; padding: 2px; }
.lang-selector button { border: none; background: none; padding: 4px 10px; border-radius: 18px; font-size: 0.75rem; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.lang-selector button.active { background: var(--accent); color: white; }
.icon-btn { background: none; border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Hero */
.hero-section { max-width: 800px; margin: 4rem auto 3rem; text-align: center; padding: 0 2rem; }
.hero-badge { display: inline-block; padding: 0.5rem 1.2rem; background: var(--accent); color: white; font-weight: 800; border-radius: 30px; font-size: 0.8rem; margin-bottom: 1.5rem; }
.hero-title { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 1.5rem; word-break: keep-all; }
.hero-title span { color: var(--accent); }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 800px; margin: 0 auto; word-break: keep-all; }

/* Tool */
.tool-section { max-width: 600px; margin: 0 auto; padding: 0 2rem; }
.card-glass { background: var(--card-bg); border: 1px solid var(--border); border-radius: 32px; padding: 2.5rem; box-shadow: var(--shadow-bold); }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.full-width { grid-column: span 2; }

.input-group label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-muted); }
.input-group input, .input-group select { width: 100%; padding: 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 1rem; font-weight: 600; }

.gender-selector { display: flex; gap: 0.5rem; }
.gender-btn { flex: 1; padding: 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-weight: 700; color: var(--text-muted); }
.gender-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

.primary-btn { width: 100%; background: var(--accent); color: white; border: none; padding: 1.2rem; font-size: 1.1rem; font-weight: 700; border-radius: 16px; cursor: pointer; box-shadow: 0 10px 20px rgba(108, 92, 231, 0.2); }
.primary-btn:hover { transform: translateY(-3px); filter: brightness(1.1); }

/* Result */
.result-box { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); animation: fadeIn 0.5s ease-out; }
.result-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.res-card { background: var(--bg); padding: 1.5rem; border-radius: 20px; text-align: center; }
.res-card small { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; margin-bottom: 0.5rem; }
.res-card div { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.res-card div small { display: inline; font-size: 0.9rem; }

.info-alert { background: rgba(108, 92, 231, 0.05); padding: 1.5rem; border-radius: 16px; border-left: 4px solid var(--accent); }
.info-alert h4 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--accent); }
.info-alert p { font-size: 0.9rem; color: var(--text-muted); }

/* History */
.history-section { max-width: 600px; margin: 3rem auto; padding: 0 2rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.text-btn { background: none; border: none; color: var(--text-muted); font-weight: 700; cursor: pointer; }
.history-list { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.history-item { padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.hist-val { font-weight: 800; color: var(--accent); }
.hist-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }

.compliance-info { max-width: 600px; margin: 4rem auto; padding: 0 2rem; display: grid; gap: 1rem; }
.info-card { background: rgba(0,0,0,0.02); padding: 1.5rem; border-radius: 16px; }
.info-card h4 { font-size: 0.9rem; margin-bottom: 0.4rem; }
.info-card p { font-size: 0.85rem; color: var(--text-muted); }

footer { padding: 4rem 2rem; text-align: center; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }
.footer-logo { font-weight: 800; margin-bottom: 0.5rem; }

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

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .result-cards { grid-template-columns: 1fr; }
}
