/**
 * Стили для калькулятора КБЖУ
 * ToolKitch.ru
 */

/* Форма */
.kbzu-form .btn-group .btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.kbzu-form .form-control:focus,
.kbzu-form .form-select:focus {
	border-color: var(--bs-success);
	box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Результаты */
.kbzu-results {
	animation: fadeIn 0.5s ease-in-out;
}

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

/* Отображение калорий */
.kbzu-calories-display {
	position: relative;
	display: inline-block;
}

.kbzu-value {
	font-size: 4rem;
	font-weight: 700;
	color: var(--bs-success);
	line-height: 1;
}

.kbzu-unit {
	display: block;
	font-size: 1.25rem;
	color: var(--bs-secondary);
	margin-top: 0.5rem;
}

@media (max-width: 576px) {
	.kbzu-value {
		font-size: 3rem;
	}
}

/* Карточки макронутриентов */
.macro-card {
	transition:
		transform 0.2s ease-in-out,
		box-shadow 0.2s ease-in-out;
}

.macro-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.macro-card .material-icons {
	font-size: 2.5rem;
}

/* Визуализация БЖУ */
.macro-chart-container {
	padding: 20px 0;
}

.macro-bar {
	display: flex;
	height: 40px;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	background-color: #e9ecef;
}

.macro-bar-segment {
	height: 100%;
	transition: width 0.5s ease-in-out;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 600;
	font-size: 0.75rem;
}

.macro-bar-segment.protein {
	background: linear-gradient(90deg, #0d6efd 0%, #0b5ed7 100%);
}

.macro-bar-segment.fat {
	background: linear-gradient(90deg, #ffc107 0%, #ffb300 100%);
	color: #000;
}

.macro-bar-segment.carbs {
	background: linear-gradient(90deg, #0dcaf0 0%, #0bb5d8 100%);
}

.macro-legend {
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.macro-legend .badge {
	padding: 0.5em 1em;
	font-weight: 500;
}

/* Аккордеон для рекомендаций */
.accordion-button {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 500;
}

.accordion-button:not(.collapsed) {
	background-color: rgba(25, 135, 84, 0.1);
	color: var(--bs-success);
}

.accordion-button::after {
	margin-left: auto;
}

/* Таблицы */
.table th {
	font-weight: 600;
	font-size: 0.875rem;
}

.table td {
	vertical-align: middle;
	font-size: 0.875rem;
}

/* Бейджи целей */
.badge {
	padding: 0.5em 1em;
	font-weight: 500;
}

/* Список с иконками */
main .list-unstyled li {
	position: relative;
	padding-left: 1.5rem;
}

main .list-unstyled li::before {
	content: '✓';
	position: absolute;
	left: 0;
	color: var(--bs-success);
	font-weight: 700;
}

/* Адаптивность */
@media (max-width: 768px) {
	.kbzu-value {
		font-size: 2.5rem;
	}

	.kbzu-unit {
		font-size: 1rem;
	}

	.macro-bar {
		height: 30px;
	}

	.macro-legend {
		flex-direction: column;
		align-items: center;
		gap: 0.5rem;
	}

	.macro-card .material-icons {
		font-size: 2rem;
	}
}

/* Печать */
@media print {
	.kbzu-form,
	.accordion,
	.btn {
		display: none !important;
	}

	.kbzu-results {
		display: block !important;
	}

	.kbzu-value {
		font-size: 2rem;
	}

	.macro-bar {
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}
}

/* Анимация при загрузке */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateX(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.macro-bar-segment {
	animation: slideIn 0.5s ease-in-out;
	animation-fill-mode: both;
}

.macro-bar-segment.protein {
	animation-delay: 0.1s;
}

.macro-bar-segment.fat {
	animation-delay: 0.2s;
}

.macro-bar-segment.carbs {
	animation-delay: 0.3s;
}

/* Hover эффекты для карточек */
.card {
	transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Цвета для границ карточек макронутриентов */
.border-primary {
	border-width: 2px !important;
}

.border-warning {
	border-width: 2px !important;
}

.border-info {
	border-width: 2px !important;
}

.border-success {
	border-width: 2px !important;
}
