/* yummy.nlink.kr - 야미 모바일 웹앱 스타일시트 */
:root {
  --primary: #F97316;
  --primary-hover: #EA580C;
  --primary-light: #FFEDD5;
  --primary-subtle: #FFF7ED;
  --secondary: #10B981;
  --secondary-light: #D1FAE5;
  --bg-page: #FFFBF5;
  --card-bg: #FFFFFF;
  --border: #F3E8DF;
  --text-main: #292524;
  --text-sub: #78716C;
  --text-muted: #A8A29E;
  --danger: #EF4444;
  --font: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
  --bottom-nav-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 16px));
}

input, textarea, [contenteditable="true"], .selectable {
  -webkit-user-select: text;
  user-select: text;
  font-family: inherit;
}

/* Container & Header */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-page);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 251, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.badge-pwa {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-info {
  background: #F5EBE1;
  color: var(--text-sub);
}

/* Tab Panels */
.tab-content {
  display: none;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* Profile summary card */
.profile-banner {
  background: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(249, 115, 22, 0.15);
}

.profile-info h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #7C2D12;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-info p {
  font-size: 0.85rem;
  color: #9A3412;
  margin-top: 2px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.btn-white {
  background: #FFF;
  color: #7C2D12;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Quick Action / Adult Toggle Switch */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-subtle);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.switch-label-wrap {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #9A3412;
  display: flex;
  align-items: center;
  gap: 6px;
}

.switch-desc {
  font-size: 0.78rem;
  color: #C2410C;
  margin-top: 2px;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #D6D3D1;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Ingredient Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #F5EBE1;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.chip.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.chip-remove {
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
}

/* Primary Button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #FFF;
  border: none;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
  background: var(--primary-hover);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: #FFF;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

/* Recipe Card */
.recipe-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.recipe-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.recipe-meta-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.tag-time { background: #FEF3C7; color: #B45309; }
.tag-diff { background: #E0E7FF; color: #4338CA; }
.tag-nutrient { background: #D1FAE5; color: #047857; }

.recipe-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-sub);
  margin: 12px 0 6px;
}

.ingredient-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.ingredient-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #FAF4EE;
}

.ingredient-table td:last-child {
  text-align: right;
  color: var(--text-sub);
}

.owned-badge {
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.75rem;
  margin-left: 4px;
}

.cooking-steps {
  list-style: none;
  padding-left: 0;
  margin-bottom: 14px;
}

.cooking-steps li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #44403C;
}

.cooking-steps li:before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--primary);
  font-weight: bold;
}

/* ⭐ Adult Derivation Box (어른 반찬 파생 카드) */
.adult-derivation-box {
  background: #FFF7ED;
  border: 1px dashed var(--primary);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}

.adult-derivation-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #9A3412;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.adult-derivation-tip {
  font-size: 0.86rem;
  color: #7C2D12;
  line-height: 1.5;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Modal System */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  background: #FFF;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.12);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: #F5EBE1;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  cursor: pointer;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(41, 37, 36, 0.94);
  color: #FFF;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
