/* Basics */

body {
    padding: 0;
    margin: 0;
    font-family: sans-serif;
    font-size: 1.2rem;
    background-color: var(--background);
    background-size: contain;
    background-repeat: no-repeat;
}

a {
    text-decoration: none;
    font-weight: bold;
    color: var(--link);
    transition: 0.2s;
}

a:hover {
    color: var(--link-hover);
}

/* Index Page */

.index-main {
    margin-top: 10%;
}

.title-holder {
    display: flex;
    justify-content: center;
    align-items: center;
}

.title-holder img {
    max-width: 4.3rem;
    max-height: 4.3rem;
    margin-right: 0.6rem;
}

.title-holder h1 {
    font-size: 3.625rem;
}

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

#autocompleteList {
    display: none;
    padding: 0.6rem;
    font-size: inherit;
    max-width: 31.25rem;
    width: 100%;
    outline: 0;
    margin: 0 auto;
    border-radius: 0 0 1.12rem 1.12rem;
    background-color: var(--element-background);
    border: 1px solid var(--border-color);
    border-top: none;
    color: var(--foreground-secondary);
    transition: 0.3s;
    list-style: none;
}

#autocompleteList li a {
    color: var(--foreground);
    font-weight: normal;
}

#autocompleteList li {
    cursor: pointer;
    border-radius: 0.5rem;
    margin-bottom: 2px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

#autocompleteList li:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#autocompleteList li:last-child {
    margin-bottom: 0;
}

.search-container input[type="search"] {
    padding: 10px;
    font-size: inherit;
    max-width: 500px;
    width: 100%;
    outline: 0;
    margin-right: 0;
    border-radius: 1.12rem 0 0 1.12rem;
    background-color: var(--element-background);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--foreground-secondary);
    transition: 0.3s;
}

.search-container input[type="search"]:focus {
    border: 1px solid var(--border-color-hover);
    border-right: none;
}

.search-container button[type="submit"] {
    background-color: var(--element-background);
    color: var(--foreground-secondary);
    border: 1px solid var(--border-color);
    outline: 0;
    padding: 10px 20px 10px 20px;
    margin-left: 0;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 0 18px 18px 0;
    transition: 0.3s;
}

.search-container button[type="submit"] img {
    height: 1.2rem;
    width: 1.2rem;
    margin-right: 0.18rem;
}

.search-container button[type="submit"]:hover {
    border: 1px solid var(--border-color-hover);
}

.about {
    margin-top: 17.5rem;
}

/* About Cards */

.card {
    width: 100%;
    height: 20rem;
}

#first-card {
    border-top: 0.4rem solid var(--background);
    color: white;
    background: linear-gradient(var(--background), var(--background-secondary));
}

#first-card p {
	max-width: 70%;
	margin: 0 auto;
}

#second-card {
    background: var(--background-secondary);
    height: 31.25rem;
}

#second-card h1 {
    margin-top: 0;
}

.grid-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 15rem);
    margin: 0 auto;
    padding: 0;
    gap: 0.6rem;
}
  
.info-card {
    padding: 1rem;
    background-color: hsla(288, 100%, 83%, 0.2);
    border-radius: 0.3rem;
    transition: 0.3s;
}

.info-card img {
    max-width: 50%;
    max-height: 50%;
}  

/* Search Page */

header {
    background-color: var(--background-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem;
}

header input[type="search"] {
    padding: 0.6rem;
    font-size: inherit;
    max-width: 31rem;
    width: 100%;
    outline: 0;
    margin-right: 0;
    border-radius: 1.12rem;
    background-color: var(--element-background);
    border: 1px solid var(--border-color);
    color: var(--foreground-secondary);
    transition: 0.3s;
}

header input[type="search"]:focus {
    border: 1px solid var(--border-color-hover);
}

header form {
    display: flex;
    align-items: center;
}

header #image-mobile {
    max-width: 3.75rem;
    max-height: 3.75rem;
    margin-right: 0.6rem;
}

header .type-selectors {
    display: flex;
    overflow-x: scroll;
    padding: 2px;
}

.type-selectors::-webkit-scrollbar {
    width: 0;
}
  
.type-selectors::-webkit-scrollbar-track {
    background-color: transparent;
}

header .type-selectors button {
    font-size: 1.3rem;
    border: 0;
    outline: 0;
    width: 6.25rem;
    padding: 0.3rem;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.93rem 0.93rem 0.3rem 0.93rem;
}

.type-selectors img {
    max-width: 1.2rem;
    max-height: 1.2rem;
    margin-right: 0.3rem;
}

.type-selectors #active {
    color: var(--link);
    border-bottom: 2px solid var(--link);
}

.settings {
    position: absolute;
    right: 1.2rem;
    top: 1.2rem;
    background: transparent;
    outline: 0;
    border: 0;
    opacity: 0.8;
}

.settings img {
    max-width: 1.2rem;
    max-height: 1.2rem;
}

/* Text, News, Video & Forum Results */

.results {
    margin-left: 5rem;
    margin-top: 2rem;
}

.video-result {
    text-align: center;
}

.text-result {
    max-width: 44rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    word-break: break-word;
    transition: 0.3s;
}

.text-result span {
    color: gray;
    font-weight: normal;
}

.text-result h2 {
    font-size: 1.3rem;
    margin: 0;
    padding-bottom: 0;
}

.text-result p {
    margin-top: 1px;
    padding-top: 0;
}

.text-result .thumbnail {
    border-radius: 0.3rem;
    max-width: 35%;
    max-height: 35%;
}

.text-result:hover {
    border: 1px solid var(--border-color-hover);
}

.correction {
    max-width: 15.6rem;
	margin: 1rem 5rem;
	padding: 0.3rem;
	background: var(--background-secondary);
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
}

.infobox {
    position: absolute;
    right: 0;
    padding: 0.62rem;
    max-width: 31.25rem;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--background-secondary);
    color: var(--foreground-secondary);
    margin: 2rem 5rem 0 0;
    transition: 0.3s;
}

.infobox:hover {
    border: 1px solid var(--border-color-hover);
}

.infobox img {
    display: flex;
    max-width: 40%;
    max-height: 40%;
    margin: 0 auto;
    border-radius: 0.3rem;
}

.page-buttons {
    margin-left: 5rem;
    max-width: 10rem;
}

.page-button {
    font-size: 1.2rem;
    background-color: var(--background-secondary);
    color: var(--foreground-secondary);
    outline: 0;
    border: 1px solid var(--border-color);
    padding: 0.62rem 1.25rem;
    border-radius: 0.3rem;
    margin: 0.62rem 0.62rem 0.62rem 0;
    transition: 0.3s;
}

.page-button:hover {
    border: 1px solid var(--border-color-hover);
}

/* Image Results */

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

.image-result {
    max-width: 25rem;
    max-height: 15rem;
    margin: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.image-result img {
    max-width: 25rem;
    max-height: 15rem;
    border-radius: 0.3rem;
}

.image-result:hover {
    filter: brightness(0.8);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 9999;
}
  
.overlay.active {
    display: block;
    opacity: 1;
}

.main-image-holder {
    text-align: center;
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    width: 50%;
    margin: 10% auto 0 auto;
    border-radius: 1.2rem;
}

.main-image-holder img {
    border-radius: 1.2rem;
    max-width: 37rem;
    max-height: 18rem;
}

/* Unique/Global IDs */

#close-button {
    position: absolute;
    font-weight: lighter;
    padding: 0.3rem 0.9rem 0.3 0.9rem;
    font-size: 1.3rem;
    right: 0.6rem;
    top: 0.6rem;
    outline: 0;
    background: transparent;
    border-radius: 0.25rem;
    border: 0;
}

#close-button:active {
    background: hsla(0, 0%, 100%, 0.35);
}

#cover {
    background-size: cover;
}

#centered-body {
    text-align: center;
}

#fallbacking {
	max-width: 5rem;
    max-height: 5rem;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-self: center;
    justify-self: center;
}

#noResults {
    font-weight: bolder;
    font-size: 1.4rem;
}

#save, #reset, #home, #verify, #download {
    font-size: 1.2rem;
    background-color: var(--background-secondary);
    color: var(--foreground-secondary);
    outline: 0;
    border: 1px solid var(--border-color);
    padding: 0.62rem 1.25rem;
    border-radius: 0.3rem;
    margin: 0.62rem 0.62rem 0.62rem 0;
    transition: 0.3s;
}

#save:hover, #reset:hover, #home:hover, #verify:hover, #download:hover {
    border: 1px solid var(--border-color-hover);
}

#special {
    margin-left: 5rem;
    margin-top: 2rem;
}

#cached {
    text-align: right;
    float: right;
    margin-left: auto;
}

#settings-buttons {
    padding: 1rem 0;
}

.padded-main {
    padding: 1rem;
}

/* General */

.tabs {
    padding-bottom: 0px;
}

.tab-link {
    margin-bottom: 0;
    padding: 0.6rem 2.3rem;
    outline: 0;
    border: 1px solid var(--border-color);
    border-bottom: 0;
    border-radius: 0.5rem 0.5rem 0 0;
    background-color: var(--background);
    transition: 0.3s;
    margin-left: 0.3rem;
}

.tab-link:hover {
    border: 1px solid var(--border-color-hover);
    border-bottom: 0;
}

select {
    display: block;
    margin: 0.6rem auto;
}

.frontend-holder input[type="url"] {
	padding: 0.3rem;
	font-size: 1.2rem;
	max-width: 20rem;
	width: 100%;
	outline: 0;
	border-radius: 1.12rem;
	background-color: var(--background-secondary);
	border: 1px solid var(--border-color);
	color: var(--foreground-secondary);
    margin: 0.2rem auto;
    text-align: center;
    display: block;
}

.frontend-holder label {
    margin: 0.3rem auto;
}

input[type="text"] {
	padding: 0.3rem;
	font-size: 1.2rem;
	max-width: 12.5rem;
	width: 100%;
	outline: 0;
	border-radius: 1.12rem;
	background-color: var(--background-secondary);
	border: 1px solid var(--border-color);
	color: var(--foreground-secondary);
}

button {
    cursor: pointer;
}

hr {
    border-color: var(--border-color);
    color: var(--border-color);
}

select {
	color: var(--foreground-secondary);
	font-size: 16px;
	background-color: var(--background-secondary);
	outline: 0;
	border: 1px solid var(--border-color);
	padding: 5px 15px 5px 15px;
	border-radius: 18px;
}

/* Footer */

footer {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: var(--background-secondary);
    color: var(--foreground-secondary);
    border-top: 1px solid var(--border-color);
}

footer:after { /* Clearfix */
    content: "";
    display: table;
    clear: both;
}

footer ul {
    padding: 0.25rem;
    list-style: none;
    display: inline-block;
    max-width: 9.25rem;
    vertical-align: middle;
}

footer a {
    color: var(--link-secondary);
}

footer a:hover {
    color: var(--link-secondary-hover);
}

.footer-sidebar {
    display: block;
    position: relative;
    text-align: center;
    font-size: x-small;
    float: right;
    margin-left: auto;
}

.footer-sidebar .footer-text p {
    max-width: 43.75rem;
}

.image-holder {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-holder h3 {
    font-size: 3rem;
    margin: 0 0 1.3rem 0;
}

.footer-sidebar img {
    max-width: 4.68rem;
    max-height: 4.68rem;
    margin: 0 0 1.3rem 0;
}

/* Mobile Compatibility */
@media screen and (max-width: 767px) {
    body {
        font-size: 0.9rem;
    }

    header .type-selectors button {
        font-size: 0.75rem;
        width: 4.3rem;
        margin: 0.3rem 0.3rem 0 0.3rem;
    }

    header .type-selectors button img {
        margin-right: 0;
        max-height: 0.75rem;
        max-width: 0.75rem;
    }

    header .type-selectors {
        margin: 0 auto;
    }

    header #image-mobile {
        max-width: 2.8rem;
        max-height: 2.8rem;
        margin-right: 0;
    }

    .settings, .settings img {
        display: none;
    }

    .card-grid {
        grid-template-columns: 10rem;
    }

    .info-card {
        width: 100%;
    }

    #first-card {
        height: 37.5rem;
    }

    #second-card {
        height: 68.75rem;
    }

    .footer-sidebar {
        font-size: xx-small;
    }

    .footer-sidebar h3 {
        font-size: 1.2rem;
    }

    .search-container button[type="submit"] {
        padding: 7.4px 20px 7.5px 20px;
    }

    .search-container input[type="search"] {
        width: 65%;
    }

    #autocompleteList {
        width: 65%;
    }

    #autocompleteList li {
        padding: 4px 1px;
    }

    .infobox {
        position: relative;
        width: 80%;
        margin: 0.62rem auto;
    }

    .results {
        margin: 1.2rem 0;
    }

    .text-result {
        margin: 0 auto 1.25rem auto;
        width: 90%;
    }

    .page-buttons {
        margin: 0 auto;
    }

    #fallbacking {
        text-align: center;
    }
    
    #noResults {
        text-align: center;
    }
    
    .correction {
		margin: 1rem auto;
	}

    .main-image-holder {
        text-align: center;
        background-color: var(--background-secondary);
        border: 1px solid var(--border-color);
        width: 90%;
        margin: 5% auto 0 auto;
        border-radius: 1.2rem;
    }
    
    .main-image-holder img {
        border-radius: 1.2rem;
        max-width: 50%;
        max-height: 50%;
    }

    #has-background {
        background-size: contain;
    }
    
    #special {
        margin: 2rem 0 0 0;
    }
    
    .info-card {
        padding: 0;
    }
}

/* Management for smaller screens */
@media only screen and (max-width: 1280px) {
    .infobox {
        position: relative;
        width: 80%;
        margin: 0.62rem auto;
    }

    .results {
        margin: 1.2rem 0;
    }

    .text-result {
        margin: 0 auto 1.25rem auto;
        width: 80%;
        max-width: 80%;
    }

    .page-buttons {
        margin: 0 auto;
    }

    #fallbacking {
        text-align: center;
    }
    
    #noResults {
        text-align: center;
    }

    .correction {
		margin: 1rem auto;
	}

    #special {
        margin: 2rem 0 0 0;
    }
}
