/**
 * Hybrid Music Viewer Styles
 * Supports both PDF and MusicXML display
 *
 * @package Kingdom_Connect
 */

#kc-music-viewer {
	margin: 20px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

#kc-viewer-controls {
	margin-bottom: 20px;
	padding: 15px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.kc-viewer-toggle-buttons {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}

.kc-viewer-toggle-buttons button {
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 3px;
	transition: background-color 0.2s, border-color 0.2s;
}

.kc-viewer-toggle-buttons button:hover {
	background: #f0f0f0;
}

.kc-viewer-toggle-buttons button.button-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.kc-viewer-toggle-buttons button.button-primary:hover {
	background: #135e96;
	border-color: #135e96;
}

.kc-pdf-controls,
.kc-xml-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	padding: 10px;
	background: #f5f5f5;
	border-radius: 3px;
}

.kc-pdf-controls button,
.kc-xml-controls button {
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 3px;
	transition: background-color 0.2s;
}

.kc-pdf-controls button:hover:not(:disabled),
.kc-xml-controls button:hover:not(:disabled) {
	background: #f0f0f0;
}

.kc-pdf-controls button:disabled,
.kc-xml-controls button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.kc-pdf-controls span,
.kc-xml-controls span {
	font-size: 14px;
	font-weight: 500;
}

/* ChordPro Display Styles */
.kc-chordpro-container {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 30px;
	min-height: 400px;
}

.kc-chordpro-display {
	max-width: 900px;
	margin: 0 auto;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 16px;
	line-height: 2;
	color: #333;
}

.kc-chord-line {
	margin: 12px 0;
	min-height: 32px;
	position: relative;
	padding-left: 5px;
}

.kc-chord-line-empty {
	margin: 8px 0;
	height: 16px;
}

.kc-chord {
	color: #d32f2f;
	font-weight: 700;
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
	margin-right: 6px;
	padding: 2px 4px;
	background: #fff3e0;
	border-radius: 3px;
	display: inline-block;
	vertical-align: top;
	min-width: 30px;
	text-align: center;
}

.kc-chord-text {
	color: #333;
	font-size: 16px;
	line-height: 2;
	display: inline;
	white-space: pre-wrap;
}

/* ChordPro Controls */
.kc-chordpro-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	padding: 10px;
	background: #f5f5f5;
	border-radius: 3px;
	flex-wrap: wrap;
}

.kc-chordpro-controls label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
}

.kc-chordpro-controls select {
	padding: 6px 12px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
}

.kc-chordpro-controls select:hover {
	border-color: #999;
}

.kc-chordpro-controls select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.kc-chordpro-controls button {
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 3px;
	transition: background-color 0.2s;
	font-weight: 500;
}

.kc-chordpro-controls button:hover {
	background: #f0f0f0;
}

.kc-chordpro-controls button#kc-download-pdf {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.kc-chordpro-controls button#kc-download-pdf:hover {
	background: #135e96;
	border-color: #135e96;
}

/* Print styles for chord chart */
@media print {
	.kc-chordpro-container {
		border: none;
		padding: 20px;
		background: #fff;
	}

	.kc-chordpro-display {
		max-width: 100%;
	}

	.kc-chord {
		color: #d32f2f !important;
		background: transparent !important;
		border: none !important;
	}

	.kc-chord-text {
		color: #000 !important;
	}

	.kc-chordpro-controls {
		display: none !important;
	}

	.kc-viewer-controls {
		display: none !important;
	}
}

#kc-viewer-content {
	position: relative;
	width: 100%;
	min-height: 400px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: auto;
}

#kc-pdf-canvas {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	height: auto;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#kc-xml-container {
	width: 100%;
	padding: 20px;
	overflow-x: auto;
}

#kc-xml-container svg {
	max-width: 100%;
	height: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	#kc-music-viewer {
		padding: 10px;
	}

	#kc-viewer-controls {
		padding: 10px;
	}

	.kc-viewer-toggle-buttons {
		flex-wrap: wrap;
		gap: 8px;
	}

	.kc-viewer-toggle-buttons button {
		padding: 6px 12px;
		font-size: 12px;
	}

	.kc-pdf-controls,
	.kc-xml-controls {
		flex-wrap: wrap;
		gap: 10px;
	}

	.kc-pdf-controls button,
	.kc-xml-controls button {
		padding: 6px 12px;
		font-size: 12px;
	}

	.kc-pdf-controls span,
	.kc-xml-controls span {
		font-size: 12px;
		width: 100%;
		text-align: center;
	}

	.kc-chordpro-controls {
		flex-wrap: wrap;
		gap: 10px;
		padding: 8px;
	}

	.kc-chordpro-controls label,
	.kc-chordpro-controls select,
	.kc-chordpro-controls button {
		font-size: 12px;
	}

	.kc-chordpro-container {
		padding: 15px;
	}

	.kc-chordpro-display {
		font-size: 14px;
	}

	.kc-chord-line {
		margin: 8px 0;
		font-size: 14px;
	}

	.kc-chord {
		font-size: 12px;
		padding: 1px 3px;
		min-width: 25px;
	}

	.kc-chord-text {
		font-size: 14px;
	}

	#kc-viewer-content {
		min-height: 300px;
	}
}
