:root {
	--primary: #0033a0;
	--silver: #8a8d8f;
	--black: #1b1b1b;
	--white: #ffffff;
	--max-width: 400px;
}

* {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

body {
	background: #00298f;
	font-family: "Noto Serif TC", serif;
	font-optical-sizing: auto;
	color: var(--black);
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	min-height: 100svh;
}

nav {
	background: #001f6b;
	position: sticky;
	top: 0;
	z-index: 1000;
	color: var(--white);
	width: 100%;
}

nav > div {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 2rem;
	margin: 0 auto;
	max-width: var(--max-width);
	cursor: pointer;
}

nav img {
	width: 1.6875rem;
	height: 1.5625rem;
}

h1 {
	font-size: 1.25rem;
}

main {
	flex: 1;
	position: relative;
	text-align: center;
	max-width: var(--max-width);
	width: 100%;
}

footer {
	padding: 1rem;
	text-align: center;
	color: var(--white);
}

section {
	position: absolute;
	inset: 0;
	opacity: 0;
	display: flex;
	align-items: stretch;
	justify-content: center;
	flex-direction: column;
	padding: 1rem;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.home #home,
.reminder #reminder,
.time #time,
.confirm #confirm,
.result #result {
	opacity: 1;
	pointer-events: all;
}

a {
	color: inherit;
}

button {
}

.box {
	background-color: var(--white);
	padding: 2rem;
}

.btn,
input[type="date"] {
	font-family: inherit;
	background: var(--primary);
	border: none;
	color: var(--white);
	padding: 0.25rem 1rem;
	font-size: 1rem;
	cursor: pointer;
}

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

input[type="date"] {
	padding: 0.25rem 0.5rem;
	background-color: #0f45cc;
	font-family: san-serif;
}

input[type="text"] {
	font-family: inherit;
	border: 1px solid var(--silver);
	padding: 0.5rem;
	font-size: 1rem;
	width: 100%;
	margin-bottom: 0.5rem;
}

h2 {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

label {
	display: block;
	text-align: left;
	margin-top: 0.5rem;
	margin-bottom: 0.25rem;
}

hr {
	margin: 1rem 0;
	border: none;
	border-top: 1px solid var(--silver);
}

ol {
	list-style: inside disc;
	text-align: left;
	margin-block: 1rem 2rem;
	text-align: left;
}

#home .link {
	background: transparent;
	border: none;
	color: var(--primary);
	padding-top: 2rem;
	cursor: pointer;
	display: block;
	margin: auto;
}

#home .box {
	padding-top: 5rem;
}

#home p {
	color: #ba0303;
	margin-block: 1rem;
}

.image-container {
	position: relative;
	width: fit-content;
	margin: 1rem auto 1rem;
}

.image-container,
.image-container svg {
	height: 148px;
	max-width: 100%;
}

.image-container svg {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.image-container svg:first-child {
	position: static;
}

.image-container svg.active {
	opacity: 1;
	pointer-events: auto;
}

/* Floor map animations */
.floor-map {
	animation-duration: 0.5s;
	animation-fill-mode: both;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeInDown {
	from {
		opacity: 0;
		transform: translateY(-30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.fade-in-up {
	animation-name: fadeInUp;
}

.fade-in-down {
	animation-name: fadeInDown;
}

.date-container {
	position: relative;
	margin-block: 0.5rem;
	color: var(--white);
}

.date-container h3 {
	border: none;
	padding: 0;
	margin-bottom: 0;
}

#date,
.floor-container {
	position: absolute;
	bottom: 0;
}

#date {
	left: 0;
}

.floor-container {
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.floor-container svg {
	cursor: pointer;
	transition: filter 0.2s ease;
}

.floor-container svg:hover {
	filter: brightness(0.8);
}

.floor-container svg.disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

.time-container {
	flex-shrink: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 1rem;
}

.room {
	display: flex;
	flex-direction: column;
}

.rooms {
	flex: 1;
	display: flex;
	gap: 0.5rem;
	overflow: auto;
	margin-bottom: 1rem;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE, old Edge */
}

.rooms::-webkit-scrollbar {
	display: none; /* Chrome, Safari */
}

.room-name {
	background: var(--primary);
	color: var(--white);
	padding: 2px 4px;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 2px;
	text-align: center;
	position: sticky;
	top: 0;
	z-index: 10;
}

.time-slot {
	border: none;
	border-bottom: 1px solid #bdbdbd;
	background: #a7a7a7;
	color: var(--white);
	padding: 5px 4px;
	line-height: 1;
	font-family: sans-serif;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		transform 0.1s ease;
	width: 100%;
	text-align: center;
}

.time-slot:hover {
	background: #8f8f8f;
	transform: scale(1.02);
}

.time-slot.selected {
	background: var(--primary);
}

.time-slot.unavailable {
	background: #d32f2f;
	cursor: not-allowed;
	opacity: 0.8;
}

.time-slot.unavailable:hover {
	background: #d32f2f;
	transform: none;
}

.time-slot.unavailable {
	background: #d32f2f;
	cursor: not-allowed;
	opacity: 0.8;
}

.time-slot.unavailable:hover {
	background: #d32f2f;
	transform: none;
}

.actions {
	margin-top: 1rem;
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

h3 {
	margin-top: 1rem;
	margin-bottom: 0.5rem;
	text-align: left;
	font-size: 1rem;
	border-bottom: 1px solid var(--silver);
	padding-bottom: 0.5rem;
	margin-bottom: 0.5rem;
}

#add-student {
	background-color: #eee;
	border: none;
	padding: 0.5rem 1rem;
	margin-bottom: 1rem;
}

.friend {
	background: var(--silver);
	border: none;
	color: var(--white);
	padding: 0.25rem 0.4rem;
	font-size: 1rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.friend:hover {
	background: #6d6f71;
}

.friend.selected {
	background: var(--primary);
}

.friend span {
	font-size: 0.8rem;
	margin-left: 0.25rem;
}

#friends {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

i {
	color: var(--primary);
}

form {
	margin-bottom: 1rem;
}

form .btn {
	width: 100%;
}
