/**
 * HL2GO Media Player Styles
 * 
 * Styled to match hl2go-modern theme with neon effects and dark theme
 */

/* Use theme CSS variables if available, otherwise use defaults */
:root {
	--hl2go-primary-color: var(--primary-color, #00ff88);
	--hl2go-secondary-color: var(--secondary-color, #0099ff);
	--hl2go-accent-color: var(--accent-color, #ff0066);
	--hl2go-bg-dark: var(--bg-dark, #0a0e27);
	--hl2go-bg-darker: var(--bg-darker, #050811);
	--hl2go-bg-card: var(--bg-card, #111827);
	--hl2go-text-primary: var(--text-primary, #ffffff);
	--hl2go-text-secondary: var(--text-secondary, #b0b8c4);
	--hl2go-border-color: var(--border-color, #1f2937);
	--hl2go-shadow-glow: var(--shadow-glow, 0 0 20px rgba(0, 255, 136, 0.3));
	--hl2go-gradient-primary: var(--gradient-primary, linear-gradient(135deg, #00ff88 0%, #0099ff 100%));
}

/* Main Player Container - Fixed at bottom */
.hl2go-media-player {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--hl2go-bg-card);
	border-top: 1px solid var(--hl2go-border-color);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
	z-index: 9999;
	padding: 1rem;
	font-family: 'Roboto', sans-serif;
	color: var(--hl2go-text-primary);
	backdrop-filter: blur(10px);
}

/* Player Content */
.hl2go-media-player .player-content {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	max-width: 1400px;
	margin: 0 auto;
	flex-wrap: wrap;
}

/* Track Info Section */
.hl2go-media-player .track-info {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex: 1;
	min-width: 200px;
}

.hl2go-media-player .track-thumbnail {
	width: 60px;
	height: 60px;
	border-radius: 5px;
	background: var(--hl2go-bg-dark);
	border: 1px solid var(--hl2go-border-color);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
}

.hl2go-media-player .track-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hl2go-media-player .track-thumbnail span {
	font-size: 1.5rem;
	color: var(--hl2go-text-secondary);
}

.hl2go-media-player .track-details {
	flex: 1;
	min-width: 0;
}

.hl2go-media-player .track-title {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--hl2go-text-primary);
	margin-bottom: 0.25rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hl2go-media-player .track-artist {
	font-size: 0.85rem;
	color: var(--hl2go-text-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Player Controls */
.hl2go-media-player .player-controls {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex: 2;
	min-width: 300px;
}

.hl2go-media-player .control-buttons {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.hl2go-media-player .control-btn {
	background: var(--hl2go-bg-dark);
	color: var(--hl2go-primary-color);
	border: 1px solid var(--hl2go-border-color);
	border-radius: 5px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 1.2rem;
	padding: 0;
	box-shadow: var(--hl2go-shadow-glow);
}

.hl2go-media-player .control-btn:hover {
	background: var(--hl2go-bg-card);
	box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
	transform: translateY(-2px);
	border-color: var(--hl2go-primary-color);
}

.hl2go-media-player .control-btn:active {
	transform: translateY(0);
}

.hl2go-media-player .play-pause-btn {
	width: 50px;
	height: 50px;
	font-size: 1.5rem;
	background: var(--hl2go-gradient-primary);
	color: var(--hl2go-bg-dark);
	border: none;
	box-shadow: var(--hl2go-shadow-glow);
}

.hl2go-media-player .play-pause-btn:hover {
	box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

/* Progress Section */
.hl2go-media-player .progress-section {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex: 1;
	min-width: 200px;
}

.hl2go-media-player .time-display {
	font-size: 0.85rem;
	color: var(--hl2go-text-secondary);
	min-width: 40px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.hl2go-media-player .progress-bar-container {
	flex: 1;
}

.hl2go-media-player .progress-bar {
	width: 100%;
	height: 12px;
	background: var(--hl2go-bg-dark);
	border: 1px solid var(--hl2go-border-color);
	border-radius: 6px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.hl2go-media-player .progress-fill {
	height: 100%;
	background: var(--hl2go-gradient-primary);
	border-radius: 6px;
	width: 0%;
	transition: width 0.1s linear;
	box-shadow: var(--hl2go-shadow-glow);
}

/* Touch-friendly hit area */
.hl2go-media-player .progress-bar-container {
	padding: 8px 0;
}

.hl2go-media-player .progress-bar:hover .progress-fill {
	box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

/* Volume Control */
.hl2go-media-player .volume-control {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 150px;
}

.hl2go-media-player .volume-btn {
	background: var(--hl2go-bg-dark);
	color: var(--hl2go-primary-color);
	border: 1px solid var(--hl2go-border-color);
	border-radius: 5px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 1rem;
	padding: 0;
	box-shadow: var(--hl2go-shadow-glow);
}

.hl2go-media-player .volume-btn:hover {
	background: var(--hl2go-bg-card);
	box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
	border-color: var(--hl2go-primary-color);
}

.hl2go-media-player .volume-slider-container {
	flex: 1;
}

.hl2go-media-player .volume-slider {
	width: 100%;
	height: 4px;
	background: var(--hl2go-bg-dark);
	border: 1px solid var(--hl2go-border-color);
	border-radius: 2px;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.hl2go-media-player .volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 12px;
	height: 12px;
	background: var(--hl2go-gradient-primary);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: var(--hl2go-shadow-glow);
	transition: all 0.3s ease;
}

.hl2go-media-player .volume-slider::-webkit-slider-thumb:hover {
	box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
	transform: scale(1.2);
}

.hl2go-media-player .volume-slider::-moz-range-thumb {
	width: 12px;
	height: 12px;
	background: var(--hl2go-gradient-primary);
	border-radius: 50%;
	cursor: pointer;
	border: none;
	box-shadow: var(--hl2go-shadow-glow);
	transition: all 0.3s ease;
}

.hl2go-media-player .volume-slider::-moz-range-thumb:hover {
	box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
	transform: scale(1.2);
}

/* YouTube Container (hidden but visible for ToS compliance) */
#youtubeContainer {
	position: fixed;
	bottom: 10px;
	right: 10px;
	width: 200px;
	height: 113px;
	z-index: 10000;
	opacity: 0.3;
	pointer-events: auto;
}

#youtubeContainer iframe {
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* SoundCloud Container (hidden) */
#soundcloudContainer {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.hl2go-media-player .player-content {
		gap: 1rem;
	}
	
	.hl2go-media-player .track-info {
		min-width: 150px;
	}
	
	.hl2go-media-player .player-controls {
		min-width: 250px;
	}
	
	.hl2go-media-player .volume-control {
		min-width: 120px;
	}
}

@media (max-width: 768px) {
	.hl2go-media-player {
		padding: 0.75rem;
	}
	
	.hl2go-media-player .player-content {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}
	
	.hl2go-media-player .track-info {
		min-width: auto;
	}
	
	.hl2go-media-player .track-thumbnail {
		width: 50px;
		height: 50px;
	}
	
	.hl2go-media-player .player-controls {
		flex-direction: column;
		gap: 0.75rem;
		min-width: auto;
	}
	
	.hl2go-media-player .control-buttons {
		justify-content: center;
	}
	
	.hl2go-media-player .progress-section {
		width: 100%;
		min-width: auto;
	}
	
	.hl2go-media-player .volume-control {
		width: 100%;
		min-width: auto;
	}
	
	.hl2go-media-player .time-display {
		font-size: 0.75rem;
		min-width: 35px;
	}
	
	#youtubeContainer {
		width: 150px;
		height: 85px;
		bottom: 5px;
		right: 5px;
	}

	/* Larger hit area for progress on mobile */
	.hl2go-media-player .progress-bar {
		height: 14px;
		border-radius: 8px;
	}
	.hl2go-media-player .progress-bar-container {
		padding: 12px 0;
	}
}

@media (max-width: 480px) {
	.hl2go-media-player {
		padding: 0.5rem;
	}
	
	.hl2go-media-player .track-title {
		font-size: 0.85rem;
	}
	
	.hl2go-media-player .track-artist {
		font-size: 0.75rem;
	}
	
	.hl2go-media-player .control-btn {
		width: 36px;
		height: 36px;
		font-size: 1rem;
	}
	
	.hl2go-media-player .play-pause-btn {
		width: 44px;
		height: 44px;
		font-size: 1.3rem;
	}
	
	.hl2go-media-player .volume-btn {
		width: 32px;
		height: 32px;
		font-size: 0.9rem;
	}
	
	#youtubeContainer {
		width: 120px;
		height: 68px;
	}
}

/* Add padding to body when player is visible */
body.hl2go-player-active {
	padding-bottom: 90px;
}

@media (max-width: 768px) {
	body.hl2go-player-active {
		padding-bottom: 140px;
	}
}

/* Playlist UI (WordPress) */
.hl2go-playlist-toggle {
	position: absolute;
	left: 10px;
	top: -40px;
	background: linear-gradient(135deg, #11182b, #0a0e27);
	color: #fff;
	border: 1px solid #1f2937;
	border-radius: 8px;
	padding: 8px 12px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 255, 136, 0.25);
	transition: all 0.2s ease;
	z-index: 1001;
}

.hl2go-playlist-toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 255, 136, 0.35);
}

.hl2go-playlist-panel {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 70px;
	background: rgba(8, 12, 26, 0.96);
	border: 1px solid #1f2937;
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 25px rgba(0, 153, 255, 0.3);
	backdrop-filter: blur(4px);
	max-height: 320px;
	overflow: hidden;
	display: none;
	flex-direction: column;
	z-index: 1000;
}

.hl2go-playlist-panel.open {
	display: flex;
}

.hl2go-playlist-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: linear-gradient(135deg, #0f172a, #0b1223);
	border-bottom: 1px solid #1f2937;
	font-weight: 600;
	color: #fff;
}

.hl2go-playlist-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}

.hl2go-playlist-items {
	overflow-y: auto;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hl2go-playlist-item {
	display: grid;
	grid-template-columns: 56px 1fr auto;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 10px;
	background: #0f172a;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #fff;
}

.hl2go-playlist-item:hover {
	border-color: #1f2937;
	background: #111b34;
}

.hl2go-playlist-item.active {
	border-color: #00ff88;
	box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.hl2go-playlist-thumb {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	overflow: hidden;
	background: #1f2937;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.hl2go-playlist-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hl2go-playlist-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow: hidden;
}

.hl2go-playlist-title {
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hl2go-playlist-artist {
	font-size: 13px;
	color: #9ca3af;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hl2go-playlist-views {
	font-size: 12px;
	color: #9ca3af;
}

@media (max-width: 768px) {
	.hl2go-playlist-panel {
		left: 8px;
		right: 8px;
		bottom: 80px;
		max-height: 50vh;
	}

	.hl2go-playlist-toggle {
		top: -36px;
	}

	.hl2go-playlist-item {
		grid-template-columns: 48px 1fr auto;
	}

	.hl2go-playlist-thumb {
		width: 48px;
		height: 48px;
	}
}
