
:root {
    --primary-color: #4CAF50;
    --secondary-color: #81C784;
    --background-color: #f8f9fa;
    --container-bg: #ffffff;
    --text-color: #2d3436;
    --text-light: #636e72;
    --border-color: #dfe6e9;
    --button-bg: #f1f2f6;
    --button-hover-bg: #dfe4ea;
    --rice-color: #F0EAD6;
    --grains-color: #FFA500;
    --meat-color: #FFC0CB;
    --veg-color: #90EE90;
    --water-color: #ADD8E6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 70px; /* Header height */
}

/* Header & Nav */
header {
    background-color: var(--container-bg);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

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

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Content Layout */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.content-section {
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.content-section:last-of-type {
    border-bottom: none;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: #2d3436;
}

h1 { font-size: 2rem; text-align: center; }
h2 { font-size: 1.5rem; border-left: 5px solid var(--primary-color); padding-left: 15px; margin-bottom: 25px; }
.subtitle { text-align: center; color: var(--text-light); margin-bottom: 40px; }

/* Calculator Section */
.calculator-container {
    background: var(--container-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.stage-selection {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.stage-selection input[type="radio"] { display: none; }

.stage-selection label {
    background-color: var(--button-bg);
    border-radius: 30px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.stage-selection input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
}

.stage-description {
    background-color: #f1f9f1;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

#stage-age { font-weight: bold; color: var(--primary-color); margin-bottom: 5px; }
#stage-info { font-size: 0.9rem; color: var(--text-light); }

.amount-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

#amount {
    width: 150px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: right;
}

#calculator-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#calculator-form button:hover { background-color: #45a049; }

.input-guidance { text-align: center; font-size: 0.85rem; color: var(--text-light); margin-bottom: 20px; }

/* Result Area */
.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.legend > div { display: flex; align-items: center; font-size: 0.85rem; }
.dot { height: 10px; width: 10px; border-radius: 50%; margin-right: 6px; }
.dot.rice { background-color: var(--rice-color); }
.dot.grains { background-color: var(--grains-color); }
.dot.meat { background-color: var(--meat-color); }
.dot.veg { background-color: var(--veg-color); }
.dot.water { background-color: var(--water-color); }

.ingredients-ratio .bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
    background-color: #eee;
}

.bar-segment { 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #333;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); 
    border-right: 1px solid rgba(255,255,255,0.3); 
}

#rice-bar { background-color: var(--rice-color); }
#grains-bar { background-color: var(--grains-color); }
#meat-bar { background-color: var(--meat-color); }
#veg-bar { background-color: var(--veg-color); }
#water-bar { background-color: var(--water-color); }

.results { list-style: none; }
.results li {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f1f2f6;
}

.results .name { font-weight: 500; }
.results .value { font-weight: bold; color: var(--primary-color); }

/* Info Cards & Grid */
.info-card {
    background: var(--container-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.guide-item {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.guide-item h3 { font-size: 1.1rem; color: var(--primary-color); margin-bottom: 10px; }
.guide-item p { font-size: 0.9rem; color: var(--text-light); }

/* Ad Container */
.ad-container {
    margin: 10px auto;
    text-align: center;
    background: transparent;
    padding: 10px;
    border-radius: 10px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    .nav-menu { display: none; }
    .calculator-container, .info-card { padding: 25px; }
    h1 { font-size: 1.5rem; }
    .amount-input { flex-direction: column; }
    #amount { width: 100%; }
    #calculator-form button { width: 100%; }
}
