/**
 * Details Module Styles
 *
 * @package WP_Immo_Detail
 */

/* 2-column layout for Objektangaben tab */
.wp-immo-details-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 80px;
	margin-top: 0;
}

.wp-immo-details-2col-left,
.wp-immo-details-2col-right {
	display: flex;
	flex-direction: column;
}

/* Groups within Objektangaben tab */
.wp-immo-details-group {
	margin-bottom: 30px;
}

.wp-immo-details-group:first-child {
	margin-top: 0;
}

.wp-immo-details-group:last-child {
	margin-bottom: 0;
}

.wp-immo-details-group-title {
	margin: 0 0 15px 0 !important;
	color: var(--wp-immo-ci-color-1);
}

/* Field list */
.wp-immo-details-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.wp-immo-details-item {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	padding: 6px 0;
	border-bottom: 1px solid #ddd;
}

.wp-immo-details-label {
	font-weight: 400;
	color: var(--wp-immo-ci-color-2);
}

.wp-immo-details-value {
	color: var(--wp-immo-ci-color-2);
	text-align: right;
	font-weight: 700;
}

/* Map */
.wp-immo-details-map {
	width: 100%;
}

.wp-immo-details-map p:first-child {
	margin-top: 0;
}

.wp-immo-map-container {
	width: 100%;
	height: 400px;
	background: var(--global-palette8, #F7FAFC);
	border-radius: 4px;
}

/* Map Loading Indicator */
.wp-immo-map-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 40px 20px;
	color: var(--wp-immo-ci-color-2);
}

.wp-immo-map-loading .spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid var(--wp-immo-ci-color-1);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 15px;
}

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

.wp-immo-map-loading .text {
	font-size: 14px;
	color: var(--wp-immo-ci-color-2);
}

/* Energy Efficiency Scale */
.wp-immo-energy-scale {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid #ddd;
}

.wp-immo-energy-scale-title {
	margin: 0 0 20px 0;
	color: var(--wp-immo-ci-color-1);
	font-size: 18px;
}

.wp-immo-energy-scale-wrapper {
	position: relative;
	margin-bottom: 30px;
}

.wp-immo-energy-scale-bars {
	display: flex;
	flex-direction: row;
	gap: 0;
	max-width: 100%;
	position: relative;
}

.wp-immo-energy-bar {
	position: relative;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.wp-immo-energy-bar:first-child {
	border-radius: 4px 0 0 4px;
}

.wp-immo-energy-bar:last-child {
	border-radius: 0 4px 4px 0;
	border-right: none;
}

.wp-immo-energy-bar-label {
	color: #fff;
	font-weight: 700;
	font-size: 18px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	position: relative;
	z-index: 1;
}

/* Active bar (no transform, just for reference) */
.wp-immo-energy-bar-active {
	/* No special styling */
}

/* Scale ticks BELOW the bars */
.wp-immo-energy-ticks {
	position: relative;
	height: 20px;
	margin-top: 0;
}

.wp-immo-energy-tick {
	position: absolute;
	top: 0;
	width: 1px;
	height: 5px;
	background: #333;
	transform: translateX(-50%);
}

.wp-immo-energy-tick-value {
	position: absolute;
	top: 7px;
	font-size: 11px;
	color: #666;
	white-space: nowrap;
	transform: translateX(-50%);
}

/* Arrow pointing DOWN to the value - BELOW the scale numbers */
.wp-immo-energy-arrow-wrapper {
	position: absolute;
	top: 56px;
	height: 40px;
}

.wp-immo-energy-arrow {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-bottom: 15px solid #333;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.wp-immo-energy-arrow-value {
	position: absolute;
	top: 18px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 14px;
	font-weight: 700;
	color: #333;
	white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
	.wp-immo-details-2col {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.wp-immo-details-item {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.wp-immo-details-value {
		text-align: left;
	}

	.wp-immo-energy-scale-wrapper {
		margin-bottom: 20px;
	}

	.wp-immo-energy-bar {
		height: 35px;
	}

	.wp-immo-energy-bar-label {
		font-size: 14px;
	}

	.wp-immo-energy-ticks {
		height: 18px;
	}

	.wp-immo-energy-tick {
		height: 4px;
	}

	.wp-immo-energy-tick-value {
		font-size: 9px;
		top: 6px;
	}

	.wp-immo-energy-arrow-wrapper {
		top: 48px;
	}

	.wp-immo-energy-arrow {
		border-bottom-width: 12px;
		border-left-width: 8px;
		border-right-width: 8px;
	}

	.wp-immo-energy-arrow-value {
		font-size: 12px;
		top: 14px;
	}
}
