/*********************************
/*  Apps Start
*********************************/
.loader-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(var(--color-white-rgb), 0.85);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 9999;

	.loader-content {
		text-align: center;
		color: var(--color-heading);
		font-weight: var(--font-medium);
		font-size: 16px;

		.spinner {
			width: 50px;
			height: 50px;
			border: 6px solid #ccc;
			border-top-color: var(--color-primary);
			border-radius: 50%;
			animation: spin 0.8s linear infinite;
			margin: 0 auto 10px;
		}
	}
}

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

.app__container {
	max-width: 1200px;
	margin: auto;
	background: var(--color-white);
	padding: 30px;
	border-radius: 20px;
	// box-shadow: var(--shadow);
	backdrop-filter: blur(30px);

	.upload__area {
		border: 2px solid var(--color-border);
		padding: 40px 30px;
		background: var(--color-bg);
		text-align: center;
		cursor: pointer;
		margin-bottom: 20px;
		border-radius: var(--radius-16);
		transition: var(--transition);

		&:hover,
		&.dragover {
			border-color: rgba(var(--color-primary-rgb), 0.5);
			background: rgba(var(--color-primary-rgb), 0.1);
		}

		.icon {
			font-size: 50px;
			color: var(--color-primary);
			margin-bottom: 20px;
		}

		h4 {
			font-size: 24px;
			line-height: 36px;
			font-weight: var(--font-semibold);
			color: var(--color-heading);
			margin-bottom: 10px;
			display: block;

			@include respond(tabport) {
				font-size: 22px;
				line-height: 30px;
			}
		}

		p {
			font-size: 16px;
			line-height: 24px;
			color: var(--color-content);
			margin: 0;
		}

		.sg-btn {
			margin-top: 20px;

			&:hover {
				background: var(--color-primary);
				border: 1px solid var(--color-primary);
				color: var(--color-white);
			}
		}
	}

	.upload-preview {
		width: 100%;
		height: 100%;
		display: none;
		align-items: center;
		justify-content: center;
		// background-color: rgba(255, 255, 255, 0.9);

		&.show {
			display: flex;
		}
	}

	.image-preview {
		max-width: 400px;
		border-radius: var(--radius);
	}


	.close-preview {
		position: absolute;
		top: 10px;
		right: 10px;
		width: 30px;
		height: 30px;
		background-color: rgba(0, 0, 0, 0.6);
		color: white;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		font-size: 12px;
		z-index: 10;
		transition: all 0.2s ease;

		&:hover {
			background-color: rgba(0, 0, 0, 0.8);
			transform: scale(1.1);
		}
	}
}

.preview__thumb {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
	margin-top: 20px;

	.image__card {
		border-radius: 12px;
		overflow: hidden;
		box-shadow: 0 5px 15px var(--shadow);
		border: 1px solid var(--color-border);
		transition: var(--transition);
		background: var(--color-bg);
		padding: 10px;

		img {
			width: 100%;
			height: 140px;
			object-fit: cover;
			border-radius: var(--radius);
			background: var(--color-bg);
			border-bottom: 1px solid var(--border-color);
			object-position: top center;
		}

		p {
			font-size: 16px;
			font-weight: var(--font-medium);
			color: var(--color-heading);
			display: block;
			margin-bottom: 0;

			span {
				font-size: 14px;
				display: block;
				font-weight: var(--font-regular);
			}
		}

		.download-btn {
			font-family: var(--font-default);
			font-weight: var(--font-regular);
			font-size: 14px;
			line-height: 18px;
			color: var(--color-white);
			background: var(--color-primary);
			border: 1px solid var(--color-primary);
			width: 100%;
			padding: 8px 10px;
			border-radius: var(--radius);
			text-align: center;
			display: block;
			transition: var(--transition);
			margin-top: 10px;

			i {
				font-size: 12px;
			}

			&:hover {
				background: var(--color-heading);
				border: 1px solid var(--color-heading);
				color: var(--color-white);
			}
		}
	}
}


.btn-loader {
	display: none;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top: 2px solid white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	position: absolute;
	right: 15px;
	margin-left: 10px;
}

.btn-loader.show {
	display: block;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.error-message {
	color: var(--color-danger);
	margin-top: 16px;
	display: none;
	padding: 6px 15px;
	background-color: rgba(var(--color-danger-rgb), 0.1);
	border-radius: 6px;
	font-weight: 500;
	font-size: 14px;
	font-weight: 400;
}

/*********************************
/*  Apps End
*********************************/

.results-container {
	height: 100%;
	display: none;

	&.show {
		display: block;
	}
}

.results-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--color-border);
	padding-bottom: 12px;
	flex-wrap: wrap;
	gap: 16px;

	.result-title {
		font-size: 26px;
		font-weight: 700;
		line-height: 36px;
		margin: 0;
	}

	.results-actions {
		display: flex;
		gap: 16px;
		flex-wrap: wrap;
	}
}

/* Food header with image */
.food-header {
	display: flex;
	gap: 24px;
	margin-bottom: 32px;
	align-items: center;

	.food-image-container {
		width: 120px;
		height: 120px;
		overflow: hidden;
		border-radius: var(--radius);
		flex-shrink: 0;
		// box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
		border: 3px solid white;
		outline: 1px solid var(--color-border);
	}

	.food-result-image {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.food-info {
		flex: 1;
	}
}

.macro-chart {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	border-radius: var(--radius);
	// box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

	.macro-item {
		text-align: center;
		background: rgba(var(--color-primary-rgb), 0.08);
		border: 1px solid rgba(var(--color-primary-rgb), 0.08);
		padding: 20px 16px;
		border-radius: var(--radius);
		transition: var(--transition);

		&:hover {
			background: rgba(var(--color-primary-rgb), 0.15);
			border-color: rgba(var(--color-primary-rgb), 0.15);
		}

		.macro-value {
			font-size: 24px;
			font-weight: 700;
			color: var(--color-primary);
			margin-bottom: 8px;
			display: block;
		}

		.macro-label {
			font-size: 16px;
			color: var(--color-content);
			font-weight: 500;
		}
	}
}

.nutrition-table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
	border-radius: var(--radius);
	overflow: hidden;

	th {
		background-color: var(--color-primary);
		color: white;
		text-align: left;
		padding: 16px;
		font-weight: 600;
	}

	td {
		font-size: 16px;
		line-height: 24px;
		color: var(--color-content);
		padding: 16px;
		border: 1px solid var(--color-border);
	}

	tr {
		background: transparent;

		&:nth-child(even) {
			background-color: rgba(var(--color-primary-rgb), 0.08);
		}
	}
}


.health-tags {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 16px;

	.health-tag {
		font-size: 14px;
		line-height: 18px;
		color: var(--color-primary);
		background: rgba(var(--color-primary-rgb), 0.1);
		padding: 6px 14px;
		border-radius: 30px;
		font-weight: 500;
		border: 1px solid rgba(var(--color-primary-rgb), 0.1);
		transition: var(--transition);

		&:hover {
			background: rgba(var(--color-primary-rgb), 0.15);
			border-color: rgba(var(--color-primary-rgb), 0.15);
		}
	}
}

/* Recipe section styles */
.recipe-section {
	background: rgba(var(--color-primary-rgb), 0.08);
	padding: 20px;
	border-radius: var(--radius);
	border-left: 4px solid var(--color-primary);
	margin-top: 24px;

	.recipe-title {
		font-size: 20px;
		font-weight: 700;
		color: var(--color-primary);
		margin-bottom: 16px;
	}
	.recipe-text {
		font-size: 16px;
		line-height: 1.7;
		color: var(--color-content);
		white-space: pre-line;
	}
}


.food-name {
	font-size: 1.6rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: var(--dark);
}

.food-description {
	color: var(--gray-600);
	font-size: 1.05rem;
	margin-bottom: 16px;
}

/* Reset button styles */
.reset-btn {
	background-color: white;
	color: var(--gray-600);
	border: 1px solid var(--gray-300);
	padding: 0.85rem 2rem;
	border-radius: 30px;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.reset-btn:hover {
	background-color: var(--gray-100);
	color: var(--gray-800);
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}