:root {
    --bg-color: #282828; /* background color */
    --fg-color: #e2d3ba; /* default foreground color */
    --fg-highlight: #d8a657; /* foreground color for "highlighted" items */
    --pane-bg-color: #32302f; /* background color for panes e.g. search bar and link containers */
    --button-color: #45403d; /* background color for buttons */
    --text-input-underline-unfocused: #7c6f64; /* underline color for text input when not focused */
    --text-input-underline-focused: var(--fg-highlight); /* underline color for text input when focused */
    --shadow-color: #1d2021; /* shadow color */
}

body {
    background-color: var(--bg-color);
    font-family: "Inter", sans-serif;
    margin: 0px;
    min-height: 100vh;
}

#main-container {
    margin: auto;
    display: flex;
    width: 640px;
    min-height: inherit;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
}

#user-greeting {
    margin-top: 30px;
    font-size: 21px;
    font-weight: normal;
    color: var(--fg-color);
}

#current-time {
    font-size: 35px;
    font-weight: normal;
    color: var(--fg-highlight);
}

#search {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background-color: var(--pane-bg-color);
    border-radius: 8px;
    box-shadow: 5px 5px 3px 0px var(--shadow-color);
    box-sizing: border-box;
    gap: 10px;
    font-size: 14px;
}

.button {
    background-color: var(--button-color);
    color: var(--fg-color);
    border-radius: 8px;
    border-style: none;
}

.button:active {
    background-color: #5a524c;
}

#search-engine-select {
    padding: 0.6em 10px;
    border-right: 10px solid transparent;
    font-family: inherit;
    font-size: inherit;
}

#search-input-cont {
    flex: 1;
}

#search-input {
    background: linear-gradient(var(--text-input-underline-unfocused), var(--text-input-underline-unfocused)),
                linear-gradient(var(--text-input-underline-focused), var(--text-input-underline-focused));
    background-size: 100% 0.1em, 0 0.1em;
    background-position: 100% 100%, 0 100%;
    background-repeat: no-repeat;
    transition: background-size 400ms ease;
    border: none;
    outline: none;
    color: var(--fg-color);
    padding: 0.6em 0;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
}

#search-input:focus {
    background-size: 0 0.1em, 100% 0.1em;
}

#search-button {
    padding: 0.6em 12px;
    font-family: inherit;
    font-size: inherit;
}

#links {
    display: flex;
    flex-direction: row;
    font-size: 14px;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.link-group {
    padding: 10px;
    background-color: var(--pane-bg-color);
    border-radius: 8px;
    box-shadow: 5px 5px 3px 0px var(--shadow-color);
    flex: 1 1 0%;
} 

.link-group-title {
    color: var(--fg-highlight);
    margin-bottom: 10px;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

a {
    text-decoration: none;
    display: inline-block;
    padding: 2px 0px;
    width: 100%;
}

.link-text {
    display: inline-block;
    padding: 2px 0px;
    background: linear-gradient(var(--fg-highlight), var(--fg-highlight));
    background-size: 0 0.1em;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 250ms, color 250ms;
    color: var(--fg-color);
}

a:hover > .link-text {
    background-size: 100% 0.1em;
    color: var(--fg-highlight);
}

@media (max-width: 800px) {
    #main-container {
        width: 80%;
    }
}

@media (max-width: 650px) {
    #search-engine-cont, #search-engine-select {
        width: 100%;
    }

    .link-group {
        flex: 1 1 40%;
    }
}

@media (max-width: 350px) {
    .link-group {
        flex: 100%;
    }

    #search-button-cont, #search-button {
        width: 100%;
    }
}
