/* KRNL Music Player Styles */

:root {
	--player-height: 500px;
	--primary-color: black;
	--primary-hover: grey;
	--bg-color: #f5f5f5;
	--bg-light: #ffffff;
	--text-primary: #333333;
	--text-secondary: #666666;
	--text-tertiary: #999999;
	--border-color: #e0e0e0;
	--transition: all 0.2s ease;
}

.krnl-player-wrapper {
	margin: 20px 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--text-primary);
}

.krnl-player-container {
	background: var(--bg-light);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
}

/* Player Header */

.krnl-player-header {
	display: flex;
	align-items: center;
	padding: 20px;
	background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
	border-bottom: 1px solid var(--border-color);
	gap: 20px;
}

.krnl-player-cover {
	flex-shrink: 0;
	width: 120px;
	height: 120px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bg-color);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.krnl-player-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.krnl-player-info {
	flex: 1;
	min-width: 0;
}

.krnl-player-info h3 {
	margin: 0 0 8px 0;
	font-size: 20px;
	font-weight: 600;
	color: var(--text-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.krnl-player-info p {
	margin: 0 0 12px 0;
	font-size: 13px;
	color: var(--text-secondary);
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.krnl-player-stats {
	display: flex;
	gap: 20px;
	font-size: 12px;
	color: var(--text-tertiary);
}

.krnl-stat-songs {
	display: flex;
	align-items: center;
}

/* Controls Section */

.krnl-player-controls {
	padding: 20px;
	background: var(--bg-white);
	border-bottom: 1px solid var(--border-color);
}

.krnl-audio-container {
	display: none;
}

/* Progress Bar */

.krnl-player-progress {
	margin-bottom: 15px;
}

.krnl-progress-bar {
	position: relative;
	height: 4px;
	background: #e0e0e0;
	border-radius: 2px;
	cursor: pointer;
	margin-bottom: 8px;
	overflow: hidden;
}

.krnl-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--primary-color), #42a5f5);
	width: 0%;
	transition: width 0.1s linear;
	border-radius: 2px;
}

.krnl-progress-handle {
	position: absolute;
	top: 50%;
	left: 0%;
	width: 12px;
	height: 12px;
	background: var(--primary-color);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	cursor: grab;
	opacity: 0;
	transition: opacity 0.2s;
}

.krnl-progress-bar:hover .krnl-progress-handle {
	opacity: 1;
}

.krnl-progress-bar:active .krnl-progress-handle {
	cursor: grabbing;
}

.krnl-time-display {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--text-tertiary);
	font-weight: 500;
}

/* Control Buttons */

.krnl-controls-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.krnl-buttons-left,
.krnl-buttons-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.krnl-btn {
	background: none;
	border: 1px solid var(--border-color);
	border-radius: 50%;
	width: 40px;
	height: 40px;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-secondary);
	font-size: 18px;
	transition: var(--transition);
	outline: none;
}

.krnl-btn:hover {
	background: var(--bg-color);
	color: var(--primary-color);
	border-color: var(--primary-color);
}

.krnl-btn:active {
	transform: scale(0.95);
}

.krnl-btn-play,
.krnl-btn-pause {
	width: 48px;
	height: 48px;
	background: var(--primary-color);
	color: white;
	border-color: var(--primary-color);
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.krnl-btn-play:hover,
.krnl-btn-pause:hover {
	background: var(--primary-hover);
	border-color: var(--primary-hover);
	box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

/* Playback Icons */

.krnl-icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.krnl-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.krnl-btn:disabled:hover {
	background: none;
	color: var(--text-secondary);
	border-color: var(--border-color);
	box-shadow: none;
}

/* Loop Button */

.krnl-btn-loop {
	position: relative;
	opacity: 0.6;
	transition: opacity 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.krnl-icon-loop {
	width: 20px;
	height: 20px;
	stroke: currentColor;
}

.krnl-btn-loop[data-loop-state="one"] {
	opacity: 1;
	color: var(--primary-color);
	border-color: var(--primary-color);
}

.krnl-btn-loop[data-loop-state="one"]::after {
	content: '1';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 10px;
	font-weight: bold;
	color: var(--primary-color);
	pointer-events: none;
}

.krnl-btn-loop[data-loop-state="all"] {
	opacity: 1;
	color: white;
	border-color: var(--primary-color);
	background: black;
}

.krnl-btn-loop:hover {
	opacity: 1;
	background: var(--bg-color);
	color: var(--primary-color);
	border-color: var(--primary-color);
}

/* Volume Control */

.krnl-volume-control {
	display: flex;
	align-items: center;
	gap: 8px;
}

.krnl-volume-slider {
	width: 100px;
	height: 4px;
	-webkit-appearance: none;
	appearance: none;
	background: #e0e0e0;
	border-radius: 2px;
	cursor: pointer;
	outline: none;
}

.krnl-volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 10px;
	height: 10px;
	background: var(--primary-color);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.krnl-volume-slider::-moz-range-thumb {
	width: 10px;
	height: 10px;
	background: var(--primary-color);
	border-radius: 50%;
	cursor: pointer;
	border: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Now Playing */

.krnl-now-playing {
	padding: 10px 0;
	border-top: 1px solid var(--border-color);
	font-size: 12px;
	color: var(--text-secondary);
}

.krnl-now-playing-label {
	font-weight: 600;
	color: var(--text-tertiary);
}

.krnl-now-playing-title {
	font-weight: 500;
	color: var(--primary-color);
	margin-left: 6px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
	// display: inline-block;
}

/* Playlist Songs */

.krnl-playlist-songs {
	padding: 20px;
	background: var(--bg-color);
	border-top: 1px solid var(--border-color);
	max-height: 350px;
	overflow-y: auto;
}

.krnl-playlist-songs h4 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.krnl-song-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.krnl-song-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	margin-bottom: 8px;
	background: var(--bg-light);
	border-radius: 4px;
	border-left: 3px solid transparent;
	cursor: pointer;
	transition: var(--transition);
}

.krnl-song-item:hover {
	background: #f9f9f9;
	border-left-color: var(--primary-color);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.krnl-song-item.active {
	background: #e3f2fd;
	border-left-color: var(--primary-color);
}

.krnl-song-item.playing .krnl-song-number::before {
	content: '♫ ';
	color: var(--primary-color);
	animation: krnl-pulse 1s ease-in-out infinite;
}

@keyframes krnl-pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.krnl-song-number {
	font-size: 12px;
	color: var(--text-tertiary);
	font-weight: 600;
	min-width: 24px;
	text-align: center;
}

.krnl-song-item.active .krnl-song-number {
	color: var(--primary-color);
}

.krnl-song-title {
	flex: 1;
	font-size: 13px;
	color: var(--text-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
}

.krnl-song-item:hover .krnl-song-title {
	color: var(--primary-color);
}

.krnl-song-item.active .krnl-song-title {
	color: var(--primary-color);
	font-weight: 600;
}

.krnl-song-duration {
	font-size: 11px;
	color: var(--text-tertiary);
	font-weight: 500;
	flex-shrink: 0;
	min-width: 35px;
}

/* Per-Song Loop Button */

.krnl-song-loop-btn {
	// width: 28px;
	// height: 28px;
	border: 1px solid var(--border-color);
	background: transparent;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: var(--transition);
	opacity: 0.4;
	position: relative;
}

.krnl-song-loop-btn svg {
	width: 14px;
	height: 14px;
	stroke: black;
}

.krnl-loop-indicator {
	position: absolute;
	font-size: 8px;
	font-weight: bold;
	color: var(--text-secondary);
	display: none;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.krnl-song-item:hover .krnl-song-loop-btn {
	opacity: 0.7;
	border-color: var(--text-secondary);
}

.krnl-song-loop-btn.active {
	opacity: 1;
	background: rgba(25, 118, 210, 0.1);
	border-color: var(--primary-color);
}

.krnl-song-loop-btn.active svg {
	stroke: var(--primary-color);
}

.krnl-song-loop-btn.active .krnl-loop-indicator {
	display: block;
	color: var(--primary-color);
}

.krnl-song-duration {
	text-align: right;
}

/* Scrollbar Styling */

.krnl-playlist-songs::-webkit-scrollbar {
	width: 6px;
}

.krnl-playlist-songs::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.krnl-playlist-songs::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.krnl-playlist-songs::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Responsive Design */

@media (max-width: 768px) {
	.krnl-player-header {
		// flex-direction: column;
		align-items: flex-start;
		padding: 15px;
		gap: 15px;
	}

	.krnl-player-cover {
		width: 80px;
		height: 80px;
	}

	.krnl-player-info h3 {
		font-size: 16px;
	}

	.krnl-player-info p {
		-webkit-line-clamp: 1;
		font-size: 12px;
	}

	.krnl-controls-row {
		flex-wrap: wrap;
	}

	.krnl-buttons-left,
	.krnl-buttons-right {
		flex: 1 1 auto;
	}

	.krnl-btn {
		width: 36px;
		height: 36px;
		font-size: 16px;
	}

	.krnl-btn-play,
	.krnl-btn-pause {
		width: 44px;
		height: 44px;
		font-size: 18px;
	}

	.krnl-volume-slider {
		width: 60px;
	}

	.krnl-playlist-songs {
		padding: 15px;
		max-height: 250px;
	}

	.krnl-song-item {
		padding: 10px;
		margin-bottom: 6px;
	}

	.krnl-song-title {
		font-size: 12px;
	}

	.krnl-song-duration {
		font-size: 10px;
		min-width: 30px;
	}

	.krnl-time-display {
		font-size: 11px;
	}

	.krnl-now-playing {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.krnl-player-wrapper {
		margin: 10px 0;
	}

	.krnl-player-header {
		padding: 10px;
		gap: 10px;
	}

	.krnl-player-cover {
		width: 60px;
		height: 60px;
	}

	.krnl-player-info h3 {
		font-size: 14px;
		margin-bottom: 4px;
	}

	.krnl-player-info p {
		display: none;
	}

	.krnl-player-controls {
		padding: 15px;
	}

	.krnl-player-progress {
		margin-bottom: 12px;
	}

	.krnl-controls-row {
		gap: 5px;
		margin-bottom: 10px;
	}

	.krnl-btn {
		width: 32px;
		height: 32px;
		font-size: 14px;
	}

	.krnl-btn-play,
	.krnl-btn-pause {
		width: 40px;
		height: 40px;
	}

	.krnl-volume-control {
		gap: 6px;
	}

	.krnl-volume-slider {
		width: 50px;
	}

	.krnl-buttons-right {
		flex: 1;
		justify-content: flex-end;
	}

	.krnl-now-playing {
		font-size: 10px;
		padding: 8px 0;
	}

	.krnl-playlist-songs {
		padding: 12px;
		max-height: 200px;
	}

	.krnl-song-item {
		padding: 8px;
		margin-bottom: 4px;
		gap: 8px;
	}

	.krnl-song-number {
		font-size: 10px;
		min-width: 20px;
	}

	.krnl-song-title {
		font-size: 11px;
	}

	.krnl-song-duration {
		font-size: 9px;
		min-width: 25px;
	}
}

/* Carousel Styles */

.krnl-carousel-container {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #f5f5f5;
	border-radius: 8px;
	margin: 20px 0;
}

.krnl-carousel-track {
	display: flex;
	flex-direction: row;
	width: 100%;
	height: 100%;
	transition: transform 0.5s ease-in-out;
}

.krnl-carousel-slide {
	flex: 0 0 100%;
	height: 100%;
}

.krnl-player-wrapper-carousel {
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.krnl-player-wrapper-carousel .krnl-player-container {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.krnl-player-wrapper-carousel .krnl-playlist-songs {
	max-height: none;
	flex: 1;
}

.krnl-carousel-btn {
	width: 50px;
	height: 50px;
	background: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.3s ease;
}

.krnl-carousel-btn:hover {
	background: rgba(0, 0, 0, 0.8);
}

.krnl-carousel-btn svg {
	width: 24px;
	height: 24px;
}

.krnl-carousel-prev {
	order: -1;
	margin-right: 10px;
}

.krnl-carousel-next {
	order: 1;
	margin-left: 10px;
}

.krnl-carousel-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-top: 15px;
}

.krnl-carousel-dots {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 15px;
}

.krnl-carousel-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
}

.krnl-carousel-dot:hover {
	background: rgba(255, 255, 255, 0.8);
}

.krnl-carousel-dot.active {
	background: white;
	width: 30px;
	border-radius: 6px;
}

@media (max-width: 768px) {
	.krnl-carousel-btn {
		width: 40px;
		height: 40px;
	}

	.krnl-carousel-prev {
		left: 10px;
	}

	.krnl-carousel-next {
		right: 10px;
	}
}

@media (max-width: 480px) {
	.krnl-carousel-btn {
		width: 40px;
		height: 40px;
	}

	.krnl-carousel-prev {
		left: 10px;
	}

	.krnl-carousel-next {
		right: 10px;
	}
}
