:root {
	--contrast-box-shadow: .1em .1em .2em rgba(0, 0, 0, 0.3); /* Subtle text shadow */
	--footer-box-shadow: -0.1em -0.1em .2em rgba(0, 0, 0, 0.3); /* Subtle text shadow */
	--subtle-background-color: #f9f9f9;
	--header-height: 8rem;
	--highlight-color: #0073e6;
	--grey-text-color: #333

}

html, body {
    height: 100%; /* Ensure the full height of the viewport is utilized */
	width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* Stack the elements vertically */
    box-sizing: border-box;
	justify-content: center;
	align-items: center;

}

/* General Styling */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--subtle-background-color);
}

header {
	width: 100%;
	padding-block-end: 1em;
	margin-block-end: .2em;
    background-color: var(--subtle-background-color);
	box-shadow: var(--contrast-box-shadow);

}

h1 {
    color: var(--grey-text-color);
    text-align: center;
    padding: 20px 0;
}

ul {
	padding-inline: 1em;
	margin-block: .2em;
}

form {
    text-align: center;
/*     margin-bottom: 1em; */
    width: 100%;
}

input[type="text"], select {
    font-size: 1rem;
    padding: 8px;
    margin-right: 10px;
    width: 60%;
    box-shadow: var(--contrast-box-shadow);
    border: solid thin transparent;
/*     max-width: 400px; */
}


/* Hover effect */
.styled-button:hover {
    background-color: #005bb5;
}

/* Icon inside button */
.styled-button .icon {
    width: 1em;  /* Size to match text */
    height: 1em;
/*     margin-right: 5px; */
}

input[type="submit"]:hover {
    background-color: #005bb5;
}

p {
    text-align: center;
    font-size: 0.9rem;
    color: #555;
}

/* Form styling for flexible layout */
fieldset {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 1cqw;
    margin-block: 1em 0;
    width: 96%;
    margin-inline: auto;
	max-width: 1000px;
	border:none
}

form > p {
	flex: 0 0 75%;
	margin-block: 0;
	padding-inline: 5%;
}

form label {
    flex: 1 1 30%;
    text-align: left;
    font-weight: 600
/*     min-width: 200px; */
}

label[for="threshold"] {
	display: none;
}

label[for="question"] {
	flex: 1 1 70%;	
}


input[type="text"], select {
    font-size: 1rem;
    padding: 8px;
    width: 100%;
/*     max-width: 300px; */
    margin: 5px 0;
    box-sizing: border-box;
}

input[type="submit"], .styled-button, #tabs button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: var(--highlight-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-block-end: .5cqh;
    align-self: end;
    box-shadow: var(--contrast-box-shadow);

}

input[type="submit"] {
    flex: 1 1 28%;
}

.styled-button {
    flex: 0 0 2%;
    padding: 9px 10px;

    

}

input[type="submit"]:hover, .styled-button:hover {
    background-color: #005bb5;
}


/* main */

main {
	padding-block-start: 1em;
/* 	margin-block-end: 4rem; */
	width: 100%;
    overflow-y: auto; /* Enables scrolling within the main content area */
	}
/* Saved Searches and Search Results Layout */
	#savedSearches, #search-results {
		display: flex;
		justify-content: space-around;
		margin: 0 auto 1em auto;
		gap: 2cqw;
		width: 96%
	}
	
	#tabs {
		display: none
	}
	
	#search-results > section {
		flex: 0 0 49%	
	}
	
	#savedSearches {
		flex-wrap: wrap;
		
	}
	
	#savedSearches > section {
		flex: 0 0 48%
	}
	
	#popular-searches, #recent-searches, #results, #song-display {
		background-color: #fff;
		padding-inline: .5em;
		border-radius: 1cqw;
		box-shadow: var(--contrast-box-shadow);
		flex: 1;
		padding-block: .4em;
		min-height: 4em;
	}

	#results, #song-display {
		height: 55cqh;
		overflow: auto;
		position: relative
	}
	
	#results h2, #song-display h2 {
/* 
		position: fixed;
		top: 0
 */
	}

h2 {
    color: var(--grey-text-color);
    border-bottom: .1em solid var(--highlight-color);
    padding-bottom: .2em;
    font-size: 1.2em
}

/* Recent and Popular Searches as Rounded Rectangles */
#recent-searches ul, #popular-searches ul {
    display: flex;
    flex-wrap: wrap;
	gap: .4cqw .2cqw;
    padding: .5em 0;
    align-items: center;
    justify-content: space-evenly;
    margin-block: .2em;
}

#recent-searches li, #popular-searches li {
	background-color: var(--highlight-color);
    color: #fff;
    padding: .2em .8em;
    border-radius: 1.2em;
    font-size: 0.9rem;
    cursor: pointer;
    list-style: none;
    box-shadow: var(--contrast-box-shadow);
}

#recent-searches a, #popular-searches a {
    text-decoration: none;
    color: inherit;
}

/* Search Results Styling */
#results li {
    list-style: none;
    margin-block-end: .5em;
	display: flex;
	gap: 1em;
	justify-content: space-between;

}

#results a.song-link:link, #results a.song-link:visited {
    color: #444;
    text-decoration: none;
    display: block;
}

.song-link {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--highlight-color);
}

.song-link:hover {
    text-decoration: underline;
}

.song-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--highlight-color);
}

.lyrics {
    color: var(--grey-text-color);
    font-size: 0.95rem;
    display: block
}

.relevance, .stars {
    color: #888;
    font-size: 0.85rem;
	display: block
}

.relevance {
	display: none;
}

/* Styling for Play on Spotify links */
.play-link {
    display: flex;
    gap: .5em;
    padding: 4px 10px;
    font-size: 0.85rem;
    background-color: #effefe;
    color: var(--grey-text-color);
    border-radius: 20px;
    text-decoration: none;
    margin-top: 5px;
    transition: background-color 0.3s, color 0.3s;
    width: fit-content;
    align-items: center;
    margin-block: auto
}

.play-link:hover {
    background-color: #efefef;
    color: #000;
}

.play-link img {
	height: 2em;
}

.play-icon {
	font-size: 1.1em;
	color: #777
}

/* Highlighting */
.highlight {
    background-color: #ffffa5;
    padding: 0 3px;
    border-radius: 3px;
}

.selected {
    background-color: #eef5ff;
}

/* Lyrics Display */
.verse, .chorus, .bridge {
    margin-block: 1em;
}

.line {
    display: block;
}

/* footer */

footer {
	font-size: .8em;
	text-align: right;
	padding-inline-end: 2em;
	width: 100%;
	bottom: 0;
	text-align: center;
	background-color: var(--highlight-color);
	height: 2rem;
	padding-block: 1.5rem ;
	padding-inline-end: 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1%;
    box-sizing: border-box;
	box-shadow: var(--footer-box-shadow);
	margin-block-start: .2em;

}
    
	footer button {
		appearance: none;
		border: none;
		background-color: transparent;
		padding: 0
	}
	
	footer button img {
		width: 80%;
	}
	
/* 	[popover]] */

        #creditsPopover {
/*         	display: flex; */
            background-color: white;
            border-radius: 1em;
            border-style: none;
            padding: 1rem;
            box-shadow: var(--contrast-box-shadow);
            max-width: 50vw;
            text-align: center;
            position: fixed /* context for close button */
        }
        
        #creditsPopover .credits {
        	display: flex;
		align-items: center;
        }
        
        #creditsPopover .credits img {
			flex: 0 0 10%;
			width: 15%;
			aspect-ratio: 1;
			display: block;
        }
        
        #closePopover {
			position: absolute;
			top: .5em;
			right: .5em;
			width: 2em;
			appearance: none;
			border: none;
			background-color: transparent;
			padding: 0

        }

		#closePopover img {
			width: 100%;
		}
		
		#creditsPopover ul {
			text-align: left;
			list-style-type: none;
		}

/* narrow */

@media (max-width: 767px) {

	fieldset {
		flex-wrap: wrap;
	}

	form > p {
		flex: 0 0 90%;
	}

label[for="question"] {
	flex: 1 1 60%;	
}
	
	#savedSearches, #search-results {
		display: block
	}

	#savedSearches > section {
	}
	
	#savedSearches h2 {
		display: none
	}
	
	#tabs {
		display: flex;
	}
	
	#tabs button {
		font-size: .8em;
		font-weight: 600;
		border-radius: 0;
		opacity: .8 
	}
	
	#tabs button.active-tab {
		opacity: 1
	}
	
	#tabs button:first-child {
		border-top-left-radius: .3em;
	}
	
	#tabs button:last-child {
		border-top-right-radius: .3em;
	}
	
	.tab-content {
    display: none; /* Ensures that tab content is hidden by default */
}

.tab-content.tabShowing {
    display: block; /* Shows the tab content when tabShowing class is added */
    animation: fadeEffect 1s; /* Optional: Adds a fade effect */
}
	
	#results, #song-display {
		height: 40cqh;
		overflow: auto;
		margin-block-end: 1em;
	}
	
	#results li {
		display: flex;
		gap: 1em;
        justify-content: space-between;
	}
	
    #creditsPopover {
		max-width: 80vw;
	}

}