/* Some basic CSS to make the Audio controls in abcjs presentable. */

.abcjs-inline-audio {
	height: 40px;
	padding: 6px 12px;
	border-radius: 8px;
	background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
	display: flex;
	align-items: center;
	box-sizing: border-box;
	gap: 8px;
	box-shadow: 0 2px 8px rgba(74, 85, 104, 0.25);
}

.abcjs-inline-audio.abcjs-disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.abcjs-inline-audio .abcjs-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 6px;
	background: rgba(255, 255, 255, 0.1) !important;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	box-sizing: border-box;
	line-height: 1;
	cursor: pointer;
	transition: all 0.2s ease;
}

.abcjs-inline-audio .abcjs-btn:hover {
	background: rgba(255, 255, 255, 0.2) !important;
	transform: scale(1.05);
}

.abcjs-inline-audio .abcjs-btn:active {
	transform: scale(0.95);
}

.abcjs-btn g {
	fill: #ffffff;
	stroke: #ffffff;
	stroke-width: 1;
}

.abcjs-inline-audio .abcjs-btn:hover g {
	fill: #ffffff;
	stroke: #ffffff;
}

.abcjs-inline-audio .abcjs-midi-selection.abcjs-pushed {
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.25);
	box-sizing: border-box;
}

.abcjs-inline-audio .abcjs-midi-loop.abcjs-pushed {
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.25);
	box-sizing: border-box;
}

.abcjs-inline-audio .abcjs-midi-reset.abcjs-pushed {
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.25);
	box-sizing: border-box;
}

.abcjs-inline-audio .abcjs-midi-start .abcjs-pause-svg {
	display: none;
}

.abcjs-inline-audio .abcjs-midi-start .abcjs-loading-svg {
	display: none;
}

.abcjs-inline-audio .abcjs-midi-start.abcjs-pushed .abcjs-play-svg {
	display: none;
}

.abcjs-inline-audio .abcjs-midi-start.abcjs-loading .abcjs-play-svg {
	display: none;
}

.abcjs-inline-audio .abcjs-midi-start.abcjs-pushed .abcjs-pause-svg {
	display: block;
}

.abcjs-inline-audio .abcjs-midi-progress-background {
	background: rgba(255, 255, 255, 0.2);
	height: 8px;
	border-radius: 4px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	margin: 0 4px;
	position: relative;
	flex: 1;
	padding: 0;
	box-sizing: border-box;
	min-width: 100px;
}

.abcjs-inline-audio .abcjs-midi-progress-indicator {
	width: 16px;
	margin-left: -8px;
	height: 16px;
	background: #ffffff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	position: absolute;
	display: inline-block;
	border-radius: 50%;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	box-sizing: border-box;
	transition: left 0.1s linear;
}

.abcjs-inline-audio .abcjs-midi-clock {
	margin: 0 4px 0 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: 'Courier New', monospace;
	font-size: 14px;
	font-weight: 600;
	box-sizing: border-box;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.15);
	padding: 0 8px;
	border-radius: 4px;
	min-width: 60px;
	height: 36px;
	line-height: 1;
}

.abcjs-inline-audio .abcjs-tempo-wrapper {
	font-size: 12px;
	color: #ffffff;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 4px;
	align-self: center;
}

.abcjs-inline-audio .abcjs-midi-tempo {
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	margin: 0 4px;
	width: 50px;
	padding: 2px 4px;
	box-sizing: border-box;
	background: #ffffff;
	color: #333333;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.abcjs-inline-audio .abcjs-midi-tempo:focus {
	outline: none;
	border-color: rgba(102, 126, 234, 0.6);
	background: #ffffff;
	box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.abcjs-inline-audio .abcjs-loading .abcjs-loading-svg {
	display: inherit;
}

.abcjs-inline-audio .abcjs-loading {
	outline: none;
	animation-name: abcjs-spin;
	animation-duration: 1s;
	animation-iteration-count: infinite;
	animation-timing-function: linear;
}

.abcjs-inline-audio .abcjs-loading-svg circle {
	stroke: #ffffff;
	stroke-width: 3;
}

@keyframes abcjs-spin {
	from {transform:rotate(0deg);}
	to {transform:rotate(360deg);}
}

/* Adding the class "abcjs-large" will make the control easier on a touch device. */
.abcjs-large .abcjs-inline-audio {
	height: 56px;
	padding: 8px 16px;
	border-radius: 12px;
	gap: 12px;
}

.abcjs-large .abcjs-btn {
	width: 48px;
	height: 48px;
	padding: 8px;
	border-radius: 8px;
}

.abcjs-large .abcjs-midi-progress-background {
	height: 12px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 6px;
}

.abcjs-large .abcjs-midi-progress-indicator {
	height: 24px;
	width: 24px;
	top: 50%;
	transform: translateY(-50%);
	margin-left: -12px;
}

.abcjs-large .abcjs-midi-clock {
	font-size: 18px;
	margin: 0 12px;
	padding: 0 12px;
	min-width: 80px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.abcjs-large .abcjs-midi-tempo {
	font-size: 16px;
	width: 60px;
	padding: 4px 6px;
	background: #ffffff;
	color: #333333;
	font-weight: 600;
}

.abcjs-large .abcjs-tempo-wrapper {
	font-size: 14px;
	gap: 6px;
}

.abcjs-css-warning {
	display: none;
}

/* Highlight for playing notes */
#abcSvg svg .abcjs-highlight {
	filter: drop-shadow(0 0 4px rgba(250, 180, 36, 0.8));
}

/* 空心音符 - 保持透明填充，但增强边框和阴影 */
#abcSvg svg .abcjs-highlight rect[fill="none"],
#abcSvg svg .abcjs-highlight path[fill="none"],
#abcSvg svg .abcjs-highlight ellipse[fill="none"] {
	stroke: rgb(250, 180, 36) !important;
	stroke-width: 3px !important;
	fill: none !important;
	filter: drop-shadow(0 0 3px rgba(250, 180, 36, 0.9));
}

/* 实心音符 - 使用深色填充以区分 */
#abcSvg svg .abcjs-highlight rect[fill="#000000"],
#abcSvg svg .abcjs-highlight path[fill="#000000"],
#abcSvg svg .abcjs-highlight ellipse[fill="#000000"],
#abcSvg svg .abcjs-highlight rect[fill="black"],
#abcSvg svg .abcjs-highlight path[fill="black"],
#abcSvg svg .abcjs-highlight ellipse[fill="black"] {
	stroke: rgb(250, 180, 36) !important;
	stroke-width: 2px !important;
	fill: #000000 !important;
	filter: drop-shadow(0 0 3px rgba(250, 180, 36, 0.9));
}

/* 默认样式 - 处理未明确指定 fill 的情况 */
#abcSvg svg .abcjs-highlight rect,
#abcSvg svg .abcjs-highlight path,
#abcSvg svg .abcjs-highlight ellipse {
	stroke: rgb(250, 180, 36) !important;
	stroke-width: 2px !important;
	/* 不强制设置 fill，让原始 fill 属性生效 */
	filter: drop-shadow(0 0 3px rgba(250, 180, 36, 0.8));
}

/* Cursor line styling */
#abcSvg svg .abcjs-cursor {
	stroke: rgb(250, 180, 36);
	stroke-width: 2px;
	stroke-linecap: round;
}

/* Instrument selector styling */
#instrument-select {
	min-width: 140px;
	max-width: 200px;
}

/* Notation output container - ensure proper width handling */
#notationOutput {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
}

/* ABC SVG responsive sizing */
#abcSvg svg,
#jianpuSvg svg {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Jianpu specific fixes for responsive width */
#jianpuSvg {
	width: 100%;
	overflow: hidden;
}

#jianpuSvg svg {
	width: 100% !important;
	max-width: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.abcjs-inline-audio {
		height: 48px;
		padding: 6px 10px;
		gap: 6px;
		flex-wrap: wrap;
	}
	
	.abcjs-inline-audio .abcjs-btn {
		width: 40px;
		height: 40px;
	}
	
	.abcjs-inline-audio .abcjs-midi-progress-background {
		order: 10;
		width: 100%;
		margin-top: 4px;
	}
	
	.abcjs-large .abcjs-inline-audio {
		height: 60px;
	}
	
	/* Mobile layout for instrument selector */
	#instrument-select {
		min-width: 120px;
		font-size: 13px;
	}
	
	/* Smaller staff width on mobile */
	#abcSvg svg {
		max-width: calc(100vw - 60px);
	}
}
