body {
    font-family: 'Sanchez', serif;
    margin: 0;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #333;
    color: #f0f0f0;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px 70px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, color 0.3s, padding 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

header.scrolled {
    padding: 15px 20px;
}

header.dark-mode {
    background-color: #444;
    color: #f0f0f0;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
}

header img {
    height: 60px;
    margin-right: 10px;
}

header h1 {
    margin: 0;
    font-size: 2em;
    text-align: center;
}

main {
    flex: 1;
    padding: 20px;
    margin-top: 140px;
    margin-bottom: 60px;
}

.search-container {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    padding: 5px;
    border-radius: 5px;
}

.search-container.scrolled {
    position: absolute;
    top: 10px;
    right: 40px;
    left: auto;
    transform: none;
    width: auto;
}

.header-greeting {
    font-family: 'Sanchez', serif;
    font-size: 1.2em;
    padding-left: 20px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: top 0.3s ease;
}

input,
select {
    margin: 0 0 0 10px;
    padding: 5px;
    font-size: 14px;
    border-radius: 5px;
}

select {
    width: auto;
}

.results-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.result-box {
    padding: 10px;
    margin: 5px;
    color: white;
    display: flex;
    align-items: center;
    border-radius: 8px;
    width: calc(33.33% - 10px);
    box-sizing: border-box;
    position: relative;
}

.color-box {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    border-radius: 8px;
}

.room-number {
    font-family: 'Sanchez', serif;
    font-weight: bold;
    font-size: 1.5em;
    margin-right: 10px;
}

.room-name {
    font-family: Arial, sans-serif;
}

.building-code {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.7em;
    opacity: 0.7;
}

footer {
    padding: 10px;
    background-color: #fff;
    text-align: center;
    font-size: 14px;
    color: #555;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: background-color 0.3s, color 0.3s;
    z-index: 100;
}

footer.dark-mode {
    background-color: #444;
    color: #f0f0f0;
}

.dark-mode-toggle {
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
    margin-left: 10px;
}

#aboutButton {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline;
    transition: transform 0.3s ease;
}

#aboutButton:hover {
    display: inline-block;
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-5px);
    }
}

#searchTerm:focus {
    outline: none;
    box-shadow: 0 0 0 2px #002a54;
}

body.dark-mode #searchTerm:focus {
    box-shadow: 0 0 0 2px #ffc20e;
}

#resetButton {
    transition: opacity 0.3s ease-in-out;
    display: none;
    /* Initially hide the reset button */
}

#resetButton.hidden {
    opacity: 0;
    pointer-events: none;
}

#resetButton:not(.hidden) {
    opacity: 1;
    display: inline;
    /* Override display: none when not hidden */
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none;
    width: 80%;
    max-width: 500px;
}

.dark-mode .popup {
    background-color: #444;
    color: #f0f0f0;
}

.popup h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

.popup p {
    margin-bottom: 10px;
}

.close-button {
    background-color: #002a54;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-button:hover {
    background-color: #00152b;
}

footer>* {
    margin: 0 5px;
}

footer> :last-child {
    margin-left: auto;
    margin-right: 0;
}
