/**
 * KundenKarte Graph-Ansicht Styles
 * Nutzt Dolibarr CSS-Variablen für Theme-Kompatibilität
 */

/* Graph Container */
.kundenkarte-graph-wrapper {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin-top: 10px;
	overflow: visible;
	box-sizing: border-box;
}

#kundenkarte-graph-container {
	width: 100%;
	max-width: 100%;
	height: 400px;
	min-height: 300px;
	max-height: 80vh;
	border: 1px solid var(--inputbordercolor, #3a3a3a);
	border-radius: 4px;
	background: var(--colorbackbody, #1d1e20);
	overflow: hidden;
	box-sizing: border-box;
	resize: vertical;
}

@media (max-width: 768px) {
	#kundenkarte-graph-container {
		height: 300px;
	}
}

/* Toolbar: Aktionen links, Zoom rechts */
.kundenkarte-graph-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	gap: 8px;
}

.kundenkarte-graph-actions {
	display: flex;
	gap: 6px;
}

.kundenkarte-graph-actions .button {
	white-space: nowrap;
}

.kundenkarte-graph-zoom-controls {
	display: flex;
	gap: 4px;
}

#btn-graph-wheel-zoom.active {
	background: var(--butactionbg, #4390dc) !important;
	color: #fff !important;
	border-color: var(--butactionbg, #4390dc) !important;
}

/* Legende */
.kundenkarte-graph-legend {
	display: flex;
	gap: 15px;
	padding: 8px 12px;
	margin-top: 8px;
	background: var(--colorbacktitle1, rgba(30, 30, 50, 0.8));
	border-radius: 4px;
	font-size: 11px;
	color: var(--colortext, #aaa);
	flex-wrap: wrap;
}

.kundenkarte-graph-legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.kundenkarte-graph-legend-line {
	width: 20px;
	height: 2px;
	display: inline-block;
}

.kundenkarte-graph-legend-line.cable {
	background: #5a8a5a;
}

.kundenkarte-graph-legend-line.passthrough {
	background: none;
	border-top: 2px dashed #505860;
	height: 0;
}

.kundenkarte-graph-legend-box {
	width: 16px;
	height: 12px;
	border-radius: 2px;
	display: inline-block;
}

.kundenkarte-graph-legend-box.building {
	background: #2a2b2d;
	border: 1px dashed #4390dc;
}

.kundenkarte-graph-legend-box.device {
	background: #2d4a3a;
	border: 2px solid #5a9a6a;
}

/* Loading Overlay */
.kundenkarte-graph-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	color: var(--colortext, #aaa);
	font-size: 14px;
	z-index: 10;
	border-radius: 4px;
}

.kundenkarte-graph-loading i {
	margin-right: 8px;
}

/* Graph Tooltip */
.kundenkarte-graph-tooltip {
	position: absolute;
	z-index: 100;
	background: var(--colorbacktabcard1, #1e2a3a);
	border: 1px solid var(--inputbordercolor, #3a6a8e);
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 12px;
	color: var(--colortext, #ccc);
	max-width: 300px;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.kundenkarte-graph-tooltip .tooltip-title {
	font-weight: bold;
	color: var(--colortextlink, #7ab0d4);
	margin-bottom: 4px;
	font-size: 13px;
}

.kundenkarte-graph-tooltip .tooltip-type {
	color: var(--colortext, #888);
	font-size: 11px;
	margin-bottom: 6px;
	opacity: 0.7;
}

.kundenkarte-graph-tooltip .tooltip-field {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 2px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kundenkarte-graph-tooltip .tooltip-field-label {
	color: var(--colortext, #888);
	opacity: 0.7;
}

.kundenkarte-graph-tooltip .tooltip-field-value {
	color: var(--colortext, #ddd);
	text-align: right;
}

/* Leer-Zustand */
.kundenkarte-graph-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 300px;
	color: var(--colortext, #666);
	font-size: 14px;
	opacity: 0.6;
}

.kundenkarte-graph-empty i {
	font-size: 48px;
	margin-bottom: 16px;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
	.kundenkarte-graph-toolbar {
		flex-wrap: wrap;
	}

	.kundenkarte-graph-actions {
		flex: 1 1 100%;
		order: 2;
	}

	.kundenkarte-graph-actions .button {
		flex: 1;
		text-align: center;
		padding: 10px 8px !important;
		font-size: 12px !important;
	}

	.kundenkarte-graph-zoom-controls {
		order: 1;
		margin-left: auto;
	}

	.kundenkarte-graph-zoom-controls .button {
		padding: 10px 8px !important;
		font-size: 12px !important;
	}
}
