/* ==========================================================
   NC Meal Planner
   Deliberately has no own --vars: reuses the theme's existing
   custom properties (--green-700, --border, --radius-lg, etc,
   all defined on `body` in nc-theme-v2/assets/css/styles.css,
   which loads on every page already) so this plugin's UI is
   visually identical to the rest of the site for free.
   ========================================================== */

/* ── Login gate ── */
.ncmp-login-gate {
	max-width: 460px;
	margin: 0 auto;
	text-align: center;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 48px 32px;
}
.ncmp-login-gate-icon { font-size: 40px; margin-bottom: 14px; }
.ncmp-login-gate h3 { font-size: 19px; font-weight: 800; margin: 0 0 10px; }
.ncmp-login-gate p { font-size: 14px; color: var(--text-600); line-height: 1.6; margin: 0 0 24px; }
.ncmp-login-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Week navigator ── */
.ncmp-week-nav {
	display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.ncmp-nav-btn {
	width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
	background: #fff; font-size: 18px; cursor: pointer; display: flex;
	align-items: center; justify-content: center; color: var(--text-900);
}
.ncmp-nav-btn:hover { background: #f6f5f1; }
.ncmp-week-label { font-size: 16px; font-weight: 800; min-width: 200px; text-align: center; }
.ncmp-today-btn {
	margin-left: auto; font-size: 12.5px; font-weight: 700; padding: 8px 16px;
	border-radius: 16px; border: 1px solid var(--border); background: #fff; cursor: pointer;
}
.ncmp-today-btn:hover { background: #f6f5f1; }

/* ── Goal targets bar ── */
.ncmp-targets-bar {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
	font-size: 13.5px; color: var(--text-600); padding: 12px 16px; background: #f9f8f5;
	border-radius: var(--radius-sm); margin-bottom: 20px;
}
.ncmp-targets-bar strong { color: var(--text-900); }
.ncmp-link { font-size: 13px; font-weight: 700; color: var(--green-700); text-decoration: none; white-space: nowrap; }

/* ── Days row ── */
.ncmp-days-row {
	display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px;
	scroll-snap-type: x proximity;
}
.ncmp-day-card {
	flex: 0 0 240px; scroll-snap-align: start;
	border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px;
	display: flex; flex-direction: column; gap: 10px;
}
.ncmp-day-card--today { border-color: var(--green-600); background: #f7fbf8; }
.ncmp-day-head { display: flex; align-items: baseline; gap: 6px; }
.ncmp-day-name { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-400); letter-spacing: .04em; }
.ncmp-day-num { font-size: 16px; font-weight: 800; }
.ncmp-day-cal { margin-left: auto; font-size: 12px; font-weight: 700; }

.ncmp-slot { border-top: 1px solid var(--border); padding-top: 8px; }
.ncmp-slot-head {
	display: flex; align-items: center; justify-content: space-between;
	font-size: 12px; font-weight: 700; color: var(--text-600); margin-bottom: 6px;
}
.ncmp-add-btn {
	width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--green-700);
	color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: flex;
	align-items: center; justify-content: center; padding: 0;
}
.ncmp-add-btn:hover { background: var(--green-600); }

.ncmp-slot-items { display: flex; flex-direction: column; gap: 5px; min-height: 4px; }
.ncmp-item-chip {
	display: flex; align-items: center; gap: 6px; background: #f6f5f1; border-radius: 8px;
	padding: 6px 8px; font-size: 12px;
}
.ncmp-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ncmp-item-cal { color: var(--text-400); white-space: nowrap; }
.ncmp-item-del {
	border: none; background: none; color: var(--text-400); cursor: pointer; font-size: 11px;
	padding: 0 2px;
}
.ncmp-item-del:hover { color: #ef4444; }

/* ── Shopping list ── */
.ncmp-shopping-section { margin-top: 28px; }
.ncmp-shopping-list {
	margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px;
}
.ncmp-shopping-group { margin-bottom: 18px; }
.ncmp-shopping-group:last-child { margin-bottom: 0; }
.ncmp-shopping-group h5 { font-size: 13px; font-weight: 800; margin: 0 0 8px; color: var(--green-700); }
.ncmp-shopping-line { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.ncmp-shopping-line input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green-700); }
.ncmp-shopping-empty { color: var(--text-400); font-size: 13.5px; text-align: center; padding: 20px 0; }

/* ── Add-item modal (self-contained, NOT reusing nc-food-analyzer's
   .nca-modal classes, since this plugin is independent of that one) ── */
.ncmp-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.ncmp-modal.ncmp-hidden { display: none !important; }
.ncmp-modal-overlay { position: absolute; inset: 0; background: rgba(15,20,16,.55); }
.ncmp-modal-box {
	position: relative; background: #fff; border-radius: var(--radius-lg); padding: 28px;
	width: 92%; max-width: 480px; max-height: 82vh; overflow-y: auto;
}
.ncmp-modal-close {
	position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%;
	border: none; background: #f1f0ec; color: var(--text-600); font-size: 14px; cursor: pointer;
}
.ncmp-modal-close:hover { background: #e7e6e2; }
.ncmp-modal-title { font-size: 17px; font-weight: 800; margin: 0 0 16px; }

.ncmp-modal-tabs { display: flex; gap: 6px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 11px; padding: 4px; }
.ncmp-modal-tab {
	flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 600;
	color: var(--text-600); cursor: pointer;
}
.ncmp-modal-tab.active { background: var(--green-700); color: #fff; }

.ncmp-search-input, .ncmp-text-input {
	width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
	font-size: 14px; font-family: inherit; color: var(--text-900); margin-bottom: 12px;
}
.ncmp-field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-600); margin-bottom: 6px; }

.ncmp-search-results { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.ncmp-result-row {
	display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px;
	padding: 10px 12px;
}
.ncmp-result-info { flex: 1; min-width: 0; }
.ncmp-result-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncmp-result-meta { font-size: 11.5px; color: var(--text-400); margin-top: 2px; }
.ncmp-result-servings {
	width: 46px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; text-align: center; font-size: 13px;
}
.ncmp-result-add {
	flex-shrink: 0; border: none; background: var(--green-700); color: #fff; font-size: 12px; font-weight: 700;
	padding: 8px 12px; border-radius: 8px; cursor: pointer;
}
.ncmp-result-add:hover { background: var(--green-600); }
.ncmp-result-add:disabled { background: var(--text-400); cursor: default; }
.ncmp-search-empty { color: var(--text-400); font-size: 13px; text-align: center; padding: 16px 0; }

.ncmp-custom-macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ncmp-custom-macro-grid label { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-600); margin-bottom: 5px; }
.ncmp-custom-macro-grid input {
	width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px; font-size: 13.5px;
}

@media (max-width: 640px) {
	.ncmp-day-card { flex: 0 0 220px; }
	.ncmp-week-label { min-width: 0; font-size: 14px; }
	.ncmp-targets-bar { flex-direction: column; align-items: flex-start; }
}
