/**
 * Losesize Nutrition Tools - Frontend Styles
 *
 * Design System Colors:
 * - Moss: #5D7052
 * - Clay: #C18C5D
 * - Rice: #FDFCF8
 * - Loam: #2C2C24
 * - Stone: #F0EBE5
 * - Dried: #78786C
 * - Sienna: #A85448
 * - Mist: #F3F4F1
 *
 * Fonts:
 * - Fraunces (serif) for headings
 * - Nunito (sans-serif) for body
 */

/* ============================================
   Base Wrapper
   ============================================ */
.ls-tool-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem;
	font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Search Bar
   ============================================ */
.ls-search-bar {
	width: 100%;
	margin-bottom: 2rem;
}

.ls-search-input {
	width: 100%;
	padding: 1rem 1.5rem;
	font-family: 'Nunito', sans-serif;
	font-size: 1.125rem;
	color: #2C2C24;
	background: #FDFCF8;
	border: 2px solid #5D7052;
	border-radius: 9999px;
	outline: none;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ls-search-input::placeholder {
	color: #78786C;
}

.ls-search-input:focus {
	border-color: #5D7052;
	box-shadow: 0 0 0 4px rgba(93, 112, 82, 0.15);
}

/* ============================================
   Results Grid
   ============================================ */
.ls-results-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin-bottom: 2rem;
}

@media (max-width: 1024px) {
	.ls-results-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.ls-results-grid {
		grid-template-columns: 1fr;
	}
}

/* ============================================
   Food Card
   ============================================ */
.ls-food-card {
	background: #FDFCF8;
	border-radius: 2rem 3rem 2.5rem 1.5rem;
	padding: 1.5rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ls-food-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 40px -10px rgba(93, 112, 82, 0.15);
}

.ls-food-card-title {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.25rem;
	font-weight: 700;
	color: #2C2C24;
	margin: 0 0 0.5rem 0;
	line-height: 1.3;
}

.ls-food-card-brand {
	font-size: 0.875rem;
	color: #78786C;
	margin-bottom: 1rem;
}

.ls-food-card-serving {
	font-size: 0.75rem;
	color: #78786C;
	margin-bottom: 1rem;
}

/* ============================================
   Macro Grid
   ============================================ */
.ls-macro-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

.ls-macro-item {
	text-align: center;
}

.ls-macro-value {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 700;
	color: #5D7052;
	line-height: 1.2;
}

.ls-macro-value .unit {
	font-size: 0.75rem;
	font-weight: 400;
	color: #78786C;
}

.ls-macro-label {
	font-family: 'Nunito', sans-serif;
	font-size: 0.75rem;
	color: #78786C;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ============================================
   Macro Bars
   ============================================ */
.ls-macro-bars {
	margin-top: 1rem;
}

.ls-macro-bar-row {
	margin-bottom: 0.5rem;
}

.ls-macro-bar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.25rem;
}

.ls-macro-bar-name {
	font-size: 0.75rem;
	color: #78786C;
}

.ls-macro-bar-value {
	font-size: 0.75rem;
	font-weight: 600;
	color: #2C2C24;
}

.ls-macro-bar {
	width: 100%;
	height: 8px;
	background: #F0EBE5;
	border-radius: 4px;
	overflow: hidden;
}

.ls-macro-bar-fill {
	height: 100%;
	border-radius: 4px;
	transition: width 0.6s ease;
}

.ls-macro-bar-fill.protein {
	background: #5D7052;
}

.ls-macro-bar-fill.fat {
	background: #C18C5D;
}

.ls-macro-bar-fill.carbs {
	background: #4A4A40;
}

.ls-macro-bar-fill.calories {
	background: #A85448;
}

.ls-macro-bar-fill.fiber {
	background: #78786C;
}

/* ============================================
   Source Badge
   ============================================ */
.ls-source-badge {
	font-size: 0.75rem;
	color: #78786C;
	background: #F0EBE5;
	border-radius: 9999px;
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.75rem;
	margin-top: 1rem;
}

.ls-source-badge svg {
	width: 12px;
	height: 12px;
	margin-right: 0.375rem;
}

/* ============================================
   Disclaimer
   ============================================ */
.ls-disclaimer {
	background: #F7EDE4;
	color: #A85448;
	border-radius: 1rem;
	padding: 1rem 1.5rem;
	font-size: 0.875rem;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-top: 2rem;
}

.ls-disclaimer svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.ls-disclaimer-text {
	line-height: 1.5;
}

/* ============================================
   Detail Card
   ============================================ */
.ls-detail-card {
	background: #FDFCF8;
	border-radius: 2rem;
	padding: 2rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ls-detail-header {
	margin-bottom: 1.5rem;
}

.ls-detail-title {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.75rem;
	font-weight: 700;
	color: #2C2C24;
	margin: 0 0 0.5rem 0;
}

.ls-detail-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	font-size: 0.875rem;
	color: #78786C;
}

.ls-detail-meta-item {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

/* ============================================
   Nutrient Table
   ============================================ */
.ls-nutrient-table {
	width: 100%;
	border-collapse: collapse;
}

.ls-nutrient-table th,
.ls-nutrient-table td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid #F0EBE5;
}

.ls-nutrient-table th {
	font-weight: 600;
	color: #2C2C24;
	font-size: 0.875rem;
}

.ls-nutrient-table td {
	color: #78786C;
	font-size: 0.875rem;
}

.ls-nutrient-table td:last-child {
	text-align: right;
	font-weight: 600;
	color: #2C2C24;
}

.ls-nutrient-table tr:hover td {
	background: #F3F4F1;
}

/* ============================================
   Compare Grid
   ============================================ */
.ls-compare-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

@media (max-width: 768px) {
	.ls-compare-grid {
		grid-template-columns: 1fr;
	}
}

.ls-compare-card {
	background: #FDFCF8;
	border-radius: 2rem;
	padding: 1.5rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ls-compare-card.ls-compare-winner {
	background: #F3F5F2;
	border-left: 4px solid #5D7052;
}

.ls-compare-header {
	margin-bottom: 1rem;
}

.ls-compare-title {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.25rem;
	font-weight: 700;
	color: #2C2C24;
	margin: 0 0 0.25rem 0;
}

.ls-compare-brand {
	font-size: 0.875rem;
	color: #78786C;
}

.ls-compare-stat {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75rem 0;
	border-bottom: 1px solid #F0EBE5;
}

.ls-compare-stat:last-child {
	border-bottom: none;
}

.ls-compare-stat-name {
	font-size: 0.875rem;
	color: #78786C;
}

.ls-compare-stat-value {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.125rem;
	font-weight: 700;
	color: #2C2C24;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ls-compare-stat-value.winner {
	color: #5D7052;
}

.ls-compare-checkmark {
	color: #5D7052;
	font-size: 1rem;
}

/* ============================================
   Recipe Analyzer
   ============================================ */
.ls-recipe-textarea {
	width: 100%;
	min-height: 200px;
	padding: 1rem 1.5rem;
	font-family: 'Nunito', sans-serif;
	font-size: 1rem;
	color: #2C2C24;
	background: #FDFCF8;
	border: 2px solid #F0EBE5;
	border-radius: 1.5rem;
	resize: vertical;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ls-recipe-textarea:focus {
	border-color: #5D7052;
	box-shadow: 0 0 0 4px rgba(93, 112, 82, 0.15);
}

.ls-recipe-textarea::placeholder {
	color: #78786C;
}

/* ============================================
   Recipe Results
   ============================================ */
.ls-recipe-results {
	margin-top: 2rem;
}

.ls-recipe-totals {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
	.ls-recipe-totals {
		grid-template-columns: repeat(2, 1fr);
	}
}

.ls-recipe-total-item {
	background: #FDFCF8;
	border-radius: 1rem;
	padding: 1.25rem;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ls-recipe-total-value {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 2rem;
	font-weight: 700;
	color: #5D7052;
}

.ls-recipe-total-label {
	font-size: 0.75rem;
	color: #78786C;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 0.25rem;
}

.ls-recipe-servings {
	background: #F3F4F1;
	border-radius: 1rem;
	padding: 1rem 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.ls-recipe-servings-label {
	font-size: 0.875rem;
	color: #78786C;
}

.ls-recipe-servings-value {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.25rem;
	font-weight: 700;
	color: #2C2C24;
}

/* ============================================
   Meal Planner
   ============================================ */
.ls-meal-planner {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 2rem;
}

@media (max-width: 1024px) {
	.ls-meal-planner {
		grid-template-columns: 1fr;
	}
}

.ls-meal-search {
	/* Left column */
}

.ls-meal-sidebar {
	/* Right column */
}

.ls-meal-items {
	background: #FDFCF8;
	border-radius: 2rem;
	padding: 1.5rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
	margin-bottom: 1.5rem;
}

.ls-meal-items-title {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.25rem;
	font-weight: 700;
	color: #2C2C24;
	margin: 0 0 1rem 0;
}

.ls-meal-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75rem 0;
	border-bottom: 1px solid #F0EBE5;
}

.ls-meal-item:last-child {
	border-bottom: none;
}

.ls-meal-item-name {
	font-size: 0.875rem;
	color: #2C2C24;
	flex: 1;
}

.ls-meal-item-servings {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 1rem;
}

.ls-meal-item-servings input {
	width: 60px;
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
	border: 1px solid #F0EBE5;
	border-radius: 0.5rem;
	text-align: center;
}

.ls-meal-item-remove {
	background: none;
	border: none;
	color: #A85448;
	cursor: pointer;
	padding: 0.25rem;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.ls-meal-item-remove:hover {
	opacity: 1;
}

.ls-meal-totals {
	background: #F3F5F2;
	border-radius: 1.5rem;
	padding: 1.5rem;
}

.ls-meal-totals-title {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1rem;
	font-weight: 700;
	color: #2C2C24;
	margin: 0 0 1rem 0;
}

.ls-meal-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0;
}

.ls-meal-total-label {
	font-size: 0.875rem;
	color: #78786C;
}

.ls-meal-total-value {
	font-family: 'Fraunces', Georgia, serif;
	font-weight: 700;
	color: #5D7052;
}

.ls-meal-actions {
	display: flex;
	gap: 1rem;
	margin-top: 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */
.ls-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 2rem;
	font-family: 'Nunito', sans-serif;
	font-size: 0.9375rem;
	font-weight: 600;
	border: none;
	border-radius: 9999px;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	text-decoration: none;
}

.ls-btn:hover {
	transform: translateY(-1px);
}

.ls-btn:active {
	transform: translateY(0);
}

.ls-btn-primary,
.ls-btn {
	background: #5D7052;
	color: #FDFCF8;
}

.ls-btn-primary:hover,
.ls-btn:hover {
	background: #515F48;
}

.ls-btn-secondary {
	background: #C18C5D;
	color: #FDFCF8;
}

.ls-btn-secondary:hover {
	background: #B07748;
}

.ls-btn-outline {
	background: transparent;
	color: #5D7052;
	border: 2px solid #5D7052;
}

.ls-btn-outline:hover {
	background: #5D7052;
	color: #FDFCF8;
}

.ls-btn-sm {
	padding: 0.5rem 1rem;
	font-size: 0.8125rem;
}

.ls-btn-full {
	width: 100%;
}

/* ============================================
   Loading Spinner
   ============================================ */
.ls-loading {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 3rem;
}

.ls-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #F0EBE5;
	border-top-color: #5D7052;
	border-radius: 50%;
	animation: ls-spin 0.8s linear infinite;
}

@keyframes ls-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ============================================
   Empty State
   ============================================ */
.ls-empty-state {
	text-align: center;
	padding: 3rem;
	color: #78786C;
}

.ls-empty-state-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

.ls-empty-state-text {
	font-size: 1rem;
}

/* ============================================
   Error State
   ============================================ */
.ls-error {
	background: #F7EDE4;
	color: #A85448;
	border-radius: 1rem;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.ls-error svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

/* ============================================
   Compare Search Inputs
   ============================================ */
.ls-compare-inputs {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 1rem;
	align-items: center;
	margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
	.ls-compare-inputs {
		grid-template-columns: 1fr;
	}
}

.ls-compare-vs {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 700;
	color: #78786C;
	text-align: center;
}

@media (max-width: 768px) {
	.ls-compare-vs {
		display: none;
	}
}

/* ============================================
   Selected Food Badge
   ============================================ */
.ls-selected-food {
	background: #F3F5F2;
	border-radius: 1rem;
	padding: 1rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.5rem;
}

.ls-selected-food-name {
	font-size: 0.875rem;
	font-weight: 600;
	color: #2C2C24;
}

.ls-selected-food-clear {
	background: none;
	border: none;
	color: #A85448;
	cursor: pointer;
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
}

/* ============================================
   Pagination
   ============================================ */
.ls-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2rem;
}

.ls-pagination-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.75rem;
	font-family: 'Nunito', sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	color: #2C2C24;
	background: #FDFCF8;
	border: 2px solid #F0EBE5;
	border-radius: 9999px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ls-pagination-btn:hover {
	border-color: #5D7052;
	color: #5D7052;
}

.ls-pagination-btn.active {
	background: #5D7052;
	border-color: #5D7052;
	color: #FDFCF8;
}

.ls-pagination-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ============================================
   Hidden Utility
   ============================================ */
.ls-hidden {
	display: none !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
	.ls-tool-wrapper {
		padding: 1rem;
	}

	.ls-detail-card {
		padding: 1.5rem;
	}

	.ls-macro-value {
		font-size: 1.25rem;
	}

	.ls-recipe-total-value {
		font-size: 1.5rem;
	}
}
