:root {
  --accent: #00b894;
  --accent-light: #55efc4;
  --bg: #f8fffb;
  --card-bg: rgba(255, 255, 255, 0.9);
  --text: #2d3436;
  --text-muted: #636e72;
  --border: #dfe6e9;
}

[data-theme="dark"] {
  --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; }

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

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

.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.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
}

.nav-actions { display: flex; gap: 1rem; align-items: center; }

.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;
}

.hero-section {
  max-width: 800px;
  margin: 4rem auto 3rem;
  text-align: center;
  padding: 0 2rem;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--accent);
  color: white;
  font-weight: 700;
  border-radius: 30px;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-title span { color: var(--accent); }

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

.tool-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 2rem;
}

.card-glass {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* Food Categories */
.food-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.category-btn:hover { border-color: var(--accent); }

.category-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Food Grid */
.food-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.food-option {
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.food-option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.02);
}

.food-option .food-name {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.food-option .food-cal {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

/* Custom Button */
.custom-btn {
  width: 100%;
  padding: 0.75rem;
  background: none;
  border: 2px dashed var(--border);
  color: var(--text-muted);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.custom-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Add Food Form */
.add-food-form {
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.input-group { margin-bottom: 1rem; }

.input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.input-group input {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.input-group input[readonly] { background: var(--border); }

.calorie-preview {
  text-align: center;
  padding: 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 1rem;
}

[data-theme="dark"] .calorie-preview { background: rgba(0,184,148,0.2); }

/* Selected Foods */
.food-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.food-name { font-weight: 700; }
.food-amount { font-size: 0.85rem; color: var(--text-muted); }

.food-calories {
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remove-btn {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Daily Summary */
.daily-summary {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.summary-item {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
}

.summary-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
}

.daily-goal-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 1rem 0 0.5rem;
  overflow: hidden;
}

.goal-progress {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s;
}

.goal-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  opacity: 0.7;
}

.goal-edit-btn:hover { opacity: 1; }

.goal-input {
  width: 80px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Buttons */
.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;
}

.primary-btn:hover { transform: translateY(-2px); }

.secondary-btn {
  width: 100%;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 16px;
  cursor: pointer;
  margin-top: 1rem;
}

/* History */
.history-section, .compliance-info {
  max-width: 600px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.history-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.history-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.empty-msg {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Compliance */
.info-card {
  background: rgba(0,0,0,0.03);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

[data-theme="dark"] .info-card { background: rgba(255,255,255,0.03); }

.info-card h4 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer {
  padding: 4rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.footer-logo {
  font-weight: 800;
  color: var(--text-muted);
}

.hidden { display: none; }

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