/* ----------------------------
General Styles
---------------------------- */
body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	background-color: #f0f2f5;
	margin: 0;
	padding: 0;
	padding-bottom: 200px;
	/* Space for fixed audio player */
}

header {
	height: 200px;
	/* Fixed height for the header */
	background-image: url('bg.webp');
	background-size: cover;
	/* Ensures image covers entire header */
	background-position: center;
	/* Centers the image */
	background-repeat: no-repeat;
	padding: 30px 0;
	text-align: center;
	color: white;
}

/* Artist's Profile Button */
#artist-profile-button {
	position: absolute;
	top: 20px;
	right: 20px;
	background-color: #ffffff;
	color: #4a90e2;
	border: 2px solid #4a90e2;
	padding: 8px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	transition: background-color 0.3s, color 0.3s;
}

#artist-profile-button:hover {
	background-color: #4a90e2;
	color: #ffffff;
}

main {
	max-width: 1200px;
	margin: 30px auto;
	padding: 0 20px;
}

footer {
	text-align: center;
	padding: 20px 0;
	background-color: #4a90e2;
	color: white;
	position: relative;
}

/* ----------------------------
Search Bar Styles
---------------------------- */
#search-bar-container {
	position: relative;
	width: 100%;
	margin-bottom: 20px;
}

#search-bar {
	width: 100%;
	padding: 12px 40px 12px 20px;
	/* Added right padding for clear button */
	box-sizing: border-box;
	border: 2px solid #ccc;
	border-radius: 4px;
}

/* Clear 'x' Button */
#clear-search {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	font-size: 16px;
	color: lightgray;
	cursor: pointer;
	display: none;
	/* Hidden when search is empty */
	transition: color 0.3s;
}

#clear-search:hover {
	color: red;
}

/* ----------------------------
Albums Section Styles
---------------------------- */
#albums-section {
	margin-bottom: 40px;
}

#albums-section h2 {
	margin-bottom: 20px;
	color: #333;
}

.album {
	display: inline-block;
	width: 150px;
	margin: 10px;
	text-align: center;
	cursor: pointer;
	transition: transform 0.2s, border 0.2s;
	border: 2px solid transparent;
	/* Initial border */
	border-radius: 8px;
}

.album:hover {
	transform: scale(1.05);
}

.album.selected {
	border: 2px solid #4a90e2;
}

.album img {
	width: 150px;
	height: 150px;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.album-name {
	margin-top: 10px;
	font-weight: bold;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.play-album-button {
	margin-top: 10px;
	background-color: #4a90e2;
	border: none;
	color: white;
	padding: 6px 10px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 14px;
	transition: background-color 0.3s;
}

.play-album-button:hover {
	background-color: #357ABD;
}

/* ----------------------------
Song Table Styles
---------------------------- */
#song-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

#song-table th,
#song-table td {
	text-align: left;
	padding: 12px;
	vertical-align: middle;
}

#song-table tr:nth-child(even) {
	background-color: #f9f9f9;
}

#song-table th {
	background-color: #4a90e2;
	color: white;
}

/* Album Thumbnail in Song Table */
.album-thumbnail {
	width: 32px;
	height: 32px;
	object-fit: cover;
	border-radius: 4px;
	margin-right: 8px;
}

/* Center-align track numbers with album thumbnails */
#song-table td:first-child {
	display: flex;
	align-items: center;
	gap: 8px;
	/* Adjusts the space between thumbnail and track number */
}

#song-table th:nth-child(4),
#song-table td:nth-child(4) {
	text-align: center;
	/* or right */
	width: 60px;
}


/* Song Name Link */
.song-name {
	color: #007BFF;
	cursor: pointer;
	text-decoration: none;
}

.song-name:hover {
	text-decoration: underline;
}

/* Play Button Styles */
.play-button {
	background-color: #28a745;
	border: none;
	color: white;
	padding: 8px 12px;
	border-radius: 3px;
	cursor: pointer;
	position: relative;
	transition: background-color 0.3s;
}

.play-button:hover {
	background-color: #218838;
}

/* Active Play Button Styles */
.play-button.active {
	background-color: red;
	animation: pulse 1s infinite;
}

@keyframes pulse {
	0% {
		box-shadow: 0 0 5px red;
	}

	50% {
		box-shadow: 0 0 20px red;
	}

	100% {
		box-shadow: 0 0 5px red;
	}
}

/* Lyrics Button Styles */
.lyrics-button {
	background-color: #17a2b8;
	border: none;
	color: white;
	padding: 8px 12px;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.3s;
}

.lyrics-button:hover {
	background-color: #138496;
}

/* ----------------------------
Highlighting Currently Playing Song
---------------------------- */
.playing {
	background-color: #d1ecf1 !important;
}

/* ----------------------------
Fixed Audio Player Styles
---------------------------- */
#audio-player-container {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background-color: #ffffff;
	box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
	padding: 10px 20px;
	display: flex;
	align-items: center;
	gap: 20px;
	z-index: 1000;
}

#audio-player {
	flex: 1;
}

#audio-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
}

#progress-container {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
}

#progress-bar {
	width: 100%;
	cursor: pointer;
}

#time-display {
	min-width: 80px;
	text-align: right;
	font-size: 14px;
}

.control-button {
	background-color: #ffc107;
	border: none;
	color: white;
	padding: 8px 12px;
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	text-align: center;
	transition: background-color 0.3s;
}

.control-button:hover {
	background-color: #e0a800;
}

.nav-button {
	background-color: #6c757d;
	border: none;
	color: white;
	padding: 8px 12px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 14px;
	transition: background-color 0.3s;
}

.nav-button:hover {
	background-color: #5a6268;
}

/* ----------------------------
Currently Playing Song Display
---------------------------- */
#current-song {
	max-width: 300px;
	overflow: hidden;
	font-weight: bold;
	color: #333;
	font-size:12px;
}

/* ----------------------------
Lyrics Modal Styles
---------------------------- */
.modal {
	display: none;
	/* Hidden by default */
	position: fixed;
	z-index: 2000;
	/* Sit on top */
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.4);
	/* Black w/ opacity */
}

.modal-content {
	background-color: #fefefe;
	margin: 10% auto;
	/* 10% from the top and centered */
	padding: 20px;
	border: 1px solid #888;
	width: 80%;
	/* Could be more or less, depending on screen size */
	max-width: 600px;
	border-radius: 5px;
	position: relative;
}

.close {
	color: #aaa;
	float: right;
	font-size: 28px;
	font-weight: bold;
	position: absolute;
	right: 15px;
	top: 10px;
	cursor: pointer;
	transition: color 0.3s;
}

.close:hover,
.close:focus {
	color: black;
	text-decoration: none;
}

/* ----------------------------
Responsive Design Styles
---------------------------- */
@media (max-width: 768px) {

	#song-table th,
	#song-table td {
		padding: 8px;
	}

	.play-button,
	.lyrics-button,
	.control-button,
	.nav-button,
	.play-album-button {
		padding: 6px 10px;
		font-size: 12px;
	}

	#time-display {
		min-width: 60px;
		font-size: 12px;
	}

	#current-song {
		max-width: 200px;
	}

	.album {
		width: 120px;
	}

	.album img {
		width: 120px;
		height: 120px;
	}

	.album-name {
		font-size: 14px;
	}
}

/* ----------------------------
Albums Grid Styles
---------------------------- */
#albums-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}