@font-face {
    font-family: 'Linux Libertine';
    src: url(fonts/LinLibertine_R.ttf);
}

@font-face {
    font-family: 'Linux Libertine Bold';
    src: url(fonts/LinLibertine_RB.ttf);
}

@font-face {
    font-family: 'Linux Libertine SC';
    src: url(fonts/LinLibertine_aS.ttf);
}

header {
    text-align: center;
    margin: 3rem 0;
}

body,
main {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.backbutton {
    position: absolute;
    top: 5px;
    left: 5px;
    font-family: 'Linux Libertine';
}

.backbutton a {
    color: black;
}

.backbutton a:visited {
    color: black;
}

.title,
.ref {
    font-family: 'Linux Libertine SC', 'Georgia', 'Times', 'Source Serif Pro',
        serif;
}

.logo {
    font-family: 'Hoefler Text', 'Linux Libertine SC';
}

.title {
    filter: drop-shadow(rgba(0, 0, 0, 0.3) 0px 0px 4px);
    font-size: xx-large;
}

.ref {
    font-size: large;
}

div.inputs {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 400px;
}

div.inputs p {
    text-align: center;
}

button#swapBtn {
    width: 10%;
}

button#swapBtn img {
    height: 0.8rem;
}

.langSelectContainer {
    display: flex;
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
    width: 100%;
}

label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    width: 40%;
    font-size: small;
}

select {
    border: solid 1px #ccc;
    background-color: #f0f0f0;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 10px 0;
    text-overflow: ellipsis;
    width: 100%;
}

.searchInputContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: solid 1px #ccc;
    border-radius: 4px;
    padding: 0 0 0 0.5rem;
}

.searchInputContainer.active {
    border-radius: 4px 4px 4px 0;
}

.cancelBtn {
    cursor: pointer;
    color: #aaa;
    margin: 0 0.7rem 0 0.2rem;
    font-weight: 900;
}

.cancelBtn:hover {
    color: #808080;
}

.searchIcon {
    cursor: pointer;
    background-color: #f0f0f0;
    border: none;
    height: 2.5rem;
    border-radius: 0 4px 4px 0;
    padding: 0 0.7rem;
    display: flex;
    align-items: center;
}

.searchIcon:hover {
    background-color: #ddd;
}

.search-icon {
    width: 1rem;
    height: 1rem;
}

input {
    width: 100%;
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
}

input:focus-visible {
    outline: none;
}

input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

button,
select,
input {
    height: 2.5rem;
    color: black;
}

div.searchContainer {
    position: relative;
    width: 100%;
}

div.suggestionDropdown {
    display: none;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ccc;
    border-top: none;
    background-color: white;
    border-radius: 0 0 4px 4px;
    scrollbar-width: thin;
    width: calc(100% - 2.4rem);
    position: absolute;
    z-index: 1000;
    font-size: small;
    box-sizing: border-box;
}

div.suggestion-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    scrollbar-width: thin;
    width: 100%;
    height: 100%;
    max-height: 14.5rem;
}

div.recent-header {
    display: none;
    position: relative;
    font-weight: bold;
    background-color: #f0f0f0;
    width: 100%;
    padding: 0.3rem;
    box-sizing: border-box;
    border-bottom: 1px solid #ccc;
}

span.clear-button {
    cursor: pointer;
    color: #808080;
    position: absolute;
    right: 0.5rem;
    font-weight: 900;
}

span.clear-button:hover {
    text-decoration: underline;
}

div.suggestion-item {
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    padding: 0.3rem;
    transition: background-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

div.suggestion-item.selected {
    background-color: #f0f0f0;
}

span.lang-pair {
    font-weight: 700;
    color: #808080;
    font-size: smaller;
}

img.item-thumbnail {
    width: 2rem;
    height: 2rem;
    object-fit: cover;
}

div.item-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 0.5rem;
}

div.item-description {
    font-size: smaller;
    color: #aaa;
    margin-top: 0.2rem;
}

button {
    border: solid 1px #ccc;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 10px 0;
    background-color: #f0f0f0;
    cursor: pointer;
    width: 100%;
}

button:hover {
    background-color: #ddd;
}

.results {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 400px;
    font-size: xx-large;
    font-weight: 900;
    font-family: 'Linux Libertine Bold', 'Georgia', 'Times', 'Source Serif Pro',
        serif;
    position: relative;
}

.results div.result-container {
    display: none;
}

#resultDiv {
    height: 14rem;
    justify-content: center;
}

.description {
    font-size: small;
    margin-top: 1rem;
    position: absolute;
    bottom: -2.2rem;
}

.spinner {
    display: none;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #36c;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

a {
    color: #36c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #3056a9;
}

a.visited {
    color: #36c !important;
}

.footer {
    position: fixed;
    bottom: 1rem;
    display: flex;
    flex-direction: row;
    width: 400px;
    justify-content: space-between;
    font-size: x-small;
    color: #808080;
    border-radius: 4px;
    padding: 0.5rem;
    background: linear-gradient(to bottom, #f0f0f0, #ddd);
    box-sizing: border-box;
}

.left-footer {
    display: flex;
    flex-direction: column;
    left: 5px;
    text-align: left;
}

.right-footer {
    display: flex;
    flex-direction: column;
    right: 5px;
    text-align: right;
}

.acknowledgment {
    margin: 0.2rem;
}

div.footer div a img {
    width: 6rem;
}

@media screen and (max-width: 600px) {
    body {
        width: 100%;
        margin: 0;
    }

    .backbutton {
        display: none;
    }

    main,
    .footer {
        width: 90%;
    }
    div.inputs,
    .results,
    .description {
        width: 100%;
    }

    input,
    select,
    button,
    .recent-header,
    .clear-button {
        font-size: 16px;
    }

    button:hover {
        background-color: #f0f0f0;
    }

    .footer {
        width: 100%;
        border-radius: 0;
        bottom: 0;
        top: auto;
    }
}
