@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap");

:root {
	/* Neutral   */
	--neutral-900: hsl(243, 96%, 9%);
	--neutral-800: hsl(243, 27%, 20%);
	--neutral-700: hsl(243, 23%, 24%);
	--neutral-600: hsl(243, 23%, 30%);
	--neutral-300: hsl(240, 6%, 70%);
	--neutral-200: hsl(250, 6%, 84%);
	--neutral-0: hsl(0, 0%, 100%);

	/* Orange */
	--orange-500: hsl(28, 100%, 52%);

	/* Blue */
	--blue-500: hsl(233, 67%, 56%);
	--blue-700: hsl(248, 70%, 36%);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: "DM Sans", sans-serif;
}

body {
	background-color: var(--neutral-900);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	padding: 2em 6em 2em 6em;
}

header {
	display: flex;
	flex-direction: column;
	width: 100%;
	align-items: center;
	gap: 3em;
}

nav {
	display: flex;
	flex-direction: row;
	width: 100%;
	justify-content: space-between;
	position: relative;
}

h1 {
	color: var(--neutral-0);
	font-family: "Bricolage Grotesque", sans-serif;
	font-weight: 700;
	font-size: 2.5rem;
}

#units {
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	color: var(--neutral-0);
	background-color: var(--neutral-800);
	padding: 0.6em;
	gap: 0.5em;
	font-size: 1.2em;
	border-radius: 0.5em;
	cursor: pointer;
}

.dropdown-invisible {
	display: none;
}

.dropdown-visible {
	background-color: var(--neutral-700);
	border: 1px solid var(--neutral-600);
	border-radius: 0.5em;
	margin-top: 0.5em;
	display: flex;
	flex-direction: column;
	position: absolute;
	top: 100%;
	right: 0;
	background-color: var(--neutral-800);
	min-width: 100px;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
	z-index: 1;
	padding: 0.3em;
	display: flex;
	gap: 0.5em;
}

#units-dropdown p {
	color: var(--neutral-300);
	font-size: 12px;
	cursor: pointer;
	padding: 0.4em;
}

#switch-measurement {
	background-color: var(--neutral-700);
	border-radius: 0.5em;
	color: var(--neutral-0);
	padding: 0.5em 3em 0.5em 1em;
}

.temperature-switch,
.wind-speed-switch {
	display: flex;
	align-items: flex-start;
	flex-direction: column;
	gap: 0.1em;
	border-bottom: 1px solid var(--neutral-600);
	padding-bottom: 0.1em;
}

.switch-btn {
	background-color: var(--neutral-800);
	border: none;
	width: 100%;
	border-radius: 0.5em;
	color: var(--neutral-0);
	padding: 0.5em 0.5em 0.5em 1em;
	display: flex;
	justify-content: space-between;
	cursor: pointer;
	align-items: center;
}

.fahrenheit,
.mph,
.in {
	background-color: var(--neutral-800);
}

.selected {
	background-color: var(--neutral-700);
}

.checkmark {
	height: 15px;
	width: 15px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
	background-image: url("assets/images/icon-checkmark.svg");
}

.checkmark-selected {
	height: 15px;
	width: 15px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
	background-image: url("assets/images/icon-checkmark.svg");
}
.gear {
	height: 20px;
	width: 20px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
	background-image: url("assets/images/icon-units.svg");
}

.arrow {
	height: 10px;
	width: 20px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
	background-image: url("assets/images/icon-dropdown.svg");
}

/* Search bar */

.search-container {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1em;
	width: 100%;
}

.search-icon {
	height: 20px;
	width: 20px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
	background-image: url("assets/images/icon-search.svg");
}

.search {
	display: flex;
	color: var(--neutral-0);
	background-color: var(--neutral-800);
	border-radius: 0.5em;
	border: 2px solid transparent;
	padding: 0.6em 1em 0.6em 1em;
	gap: 1em;
	box-sizing: border-box;
	width: 28%;
}
.search:focus-within {
	border: 2px solid var(--neutral-0); /* Border when div or its input is focused */
	outline: none; /* Remove default outline (optional) */
}

.search input {
	background-color: transparent;
	border: none;
	color: var(--neutral-0);
	outline: none;
	font-size: 1.2em;
}

.search-button {
	background-color: var(--blue-500);
	color: var(--neutral-0);
	border: none;
	padding: 0.6em 1em 0.6em 1em;
	border-radius: 0.5em;
	cursor: pointer;
	font-size: 1.2em;
}

main {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(6, 1fr);
	grid-gap: 2em;
	margin-top: 3em;
}

.current-weather {
	background-image: url("assets/images/bg-today-large.svg");
	background-repeat: no-repeat;
	background-size: cover;
	grid-column: span 2;
	grid-row: span 3;
	background-color: var(--neutral-800);
	color: var(--neutral-0);
	padding: 2em;
	border-radius: 1.5em;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.current-weather-info {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	width: 100%;
}

.location {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1em;
}

.city {
	font-size: 2rem;
	font-weight: 700;
}

.date {
	font-size: 1.2rem;
	font-weight: 400;
}

.temperature {
	font-size: 8rem;
	font-weight: 700;
	font-style: italic;
}

/* Hourly forecast */
.hourly-forecast {
	background-color: var(--neutral-800);
	color: var(--neutral-0);
	grid-column: span 1;
	grid-row: span 6;
	padding: 2em;
	border-radius: 1.5em;
	display: flex;
	flex-direction: column;
	gap: 1em;
	position: relative;
}

.forecast-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 1.2rem;
	font-weight: 700;
}

.hourly-forecast-dropdown-invisible {
	display: none;
}

.hourly-forecast-dropdown {
	border: 1px solid var(--neutral-600);
	border-radius: 0.5em;
	position: absolute;
	top: 1em;
	right: 1em;
	border-radius: 0.5em;
	margin-top: 0.5em;
	display: flex;
	flex-direction: column;
	position: absolute;
	top: 5em;
	right: 2em;
	background-color: var(--neutral-800);
	min-width: 100px;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
	z-index: 1;
	padding: 0.3em;
	display: flex;
	gap: 0.5em;
}

.day {
	background-color: var(--neutral-800);
	border: none;
	display: flex;
	align-items: center;
	color: var(--neutral-0);
	gap: 1em;
	padding: 0.5em 5em 0.5em 0.5em;
	border-radius: 0.6em;
	cursor: pointer;
}

.selected-day {
	background-color: var(--neutral-700);
}

#day-select {
	background-color: var(--neutral-600);
	border: none;
	display: flex;
	align-items: center;
	color: var(--neutral-0);
	gap: 1em;
	padding: 1em;
	border-radius: 0.6em;
	cursor: pointer;
}

.hourly {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: 700;
}

.hour-container {
	display: flex;
	justify-content: center;
	align-items: center;
}

.hour-container p {
	font-size: 1.2rem;
}

.icon-weather {
	height: 40px;
	width: 40px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
}

.icon-drizzle {
	background-image: url("assets/images/icon-drizzle.webp");
}

.hourly {
	background-color: var(--neutral-700);
	border: 1px solid var(--neutral-600);
	border-radius: 0.5em;
	padding: 1em;
}

/* weather stats */

.weather-stats {
	width: 100%;
	display: flex;
	grid-column: span 2;
	grid-row: span 1;
	gap: 1.5em;
}

.weather-stats-item {
	width: 25%;
	background-color: var(--neutral-800);
	border: 1px solid var(--neutral-600);
	border-radius: 0.5em;
	color: var(--neutral-0);
	padding: 1em;
	display: flex;
	flex-direction: column;
	gap: 1em;
}

.weather-stats-item h4 {
	font-size: 1.2rem;
	font-weight: 300;
}
.weather-stats-item P {
	font-size: 2rem;
	font-weight: 300;
}

.daily-forecast {
	display: flex;
	flex-direction: column;
	grid-column: span 2;
	grid-row: span 2;
}

.header {
	color: var(--neutral-0);
	padding: 1em 0 1em 0;
	font-size: 1.2rem;
	font-weight: 700;
	height: 25%;
}

.day-container {
	display: flex;
	flex-direction: row;
	height: 75%;
	gap: 1em;
	justify-content: space-between;
}

.day-card {
	max-width: 150px;
	background-color: var(--neutral-700);
	border: 1px solid var(--neutral-600);
	width: calc(100% / 7);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	border-radius: 0.5em;
	padding: 1em;
	color: var(--neutral-0);

	h5 {
		font-size: 1.2rem;
		font-weight: 700;
	}
}

.degrees {
	display: flex;
	justify-content: space-between;
	width: 100%;
}

.icon-weather-mid {
	height: 80px;
	width: 80px;
	background-repeat: no-repeat;
	background-size: contain;
	display: block;
}
