@import url('https://fonts.googleapis.com/css2?family=Rubik+Scribble&family=Ubuntu:wght@400;700&display=swap');

:root{
    --primary-color: #175632;
    --primary-color-light: #4D8F5F;
    --secondary-color: #60D26F;
    --secondary-color-light: #A3E6A4;
    --accent-color: #83BEC5;
    --accent-color-light: #b6e2e573;

    --text-color: #0f0f0f;
    --background-color: #feffe5;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0.5em;
}

::-webkit-scrollbar-track {
    background-color: rgba(150, 150, 150, 30%);
}

::-webkit-scrollbar-thumb {
    background-color: rgba(150, 150, 150, 50%);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: Ubuntu, sans-serif;
}

@media screen and (min-width: 1250px) {
    body {
        font-size: 1.2em;
    }
    
}

/* Header */
header {
    position: sticky;
    top: 0; /* At the top of the page */
    z-index: 2;
    background: var(--background-color);
    box-shadow: 0px 0px 50px -20px #cbcbcb;
}

header div {
    display: flex;
    align-items: center;
    gap: 1em;
}

header .container {
    padding: 12px 20px;
    justify-content: space-between;
}

header a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #000;
    font-weight: bold;
}

#header-seperator {
    position: relative;
    bottom: 0;
    z-index: 1;
}

.logo-text {
    font-family: 'Rubik Scribble', cursive;
    font-size: 1.75rem;
    color: black;
}

/* Burger Menu */
#burger-menu {
    display: block;
    position: relative;
    width: 1.5em;
    height: 1.5em;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    cursor: pointer;
}

#burger-menu span {
    display: block;
    position: absolute;
    height: 0.2em;
    width: 100%;
    background: #000;
    border-radius: 0.2em;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
}

#burger-menu span:nth-child(1) {
    top: 0.5em;
}

#burger-menu span:nth-child(2) {
    top: 0.9em;
}

#burger-menu.open span:nth-child(1) {
    top: 0.7em;
    transform: rotate(45deg);
}

#burger-menu.open span:nth-child(2) {
    top: 0.7em;
    transform: rotate(-45deg);
}

/* Navigation */
nav {
    display: flex;
    position: fixed;
    z-index: 1;
    width: calc(100% - 2em); /* Set width to 100% of the viewport width */
    gap: 0.4em;
    padding: 1em;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    background-color: var(--background-color);
    border-bottom: solid 1px grey;
    box-shadow: 0px 0px 50px -20px #b6b6b6;

    transform: translateY(-17.5em);
    transition: 0.5s ease-in-out;
}

nav a {
    display: block;
    padding: 10px;
    width: 40%;
    min-width: 10em;
    text-align: center;
    text-decoration: none;
    color: var(--background-color);
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.75em;     /* round corners */
    transition: 0.3s ease-in-out;
}

nav a:hover {
    transform: translateY(-3px);
    background-color: var(--primary-color-light);
    color: var(--background-color);
}

nav a.self {
    background-color: var(--secondary-color-light);
    color: var(--text-color);
}

nav a.self:hover {
    transform: translateY(-3px);
    background-color: var(--primary-color-light);
    color: var(--background-color);
}

nav.open {
    transform: translateY(0);
}


/* Hero */
.hero {
    grid-area: hero;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    max-width: 70vh;
}

.hero-text {
    box-sizing: border-box; /* Includes padding and border in the element's total width and height */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 1.5em;
    padding: 1em;
}

.hero-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
    width: 100%;
}

@media screen and (min-width: 900px) {
    .hero {
        flex-direction: row;
        justify-content: space-between;
        gap: 2em;
    }

    .hero-image {
        width: 50%;
        max-width: fit-content;
        max-height: 100vh;
    }

    .hero-text {
        width: 50%;
        max-width: 500px;
    }
}


/* Home/Landingpage*/
#landing-page-main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
    "hero"
    "popular"
    "discover";
    margin: 2em 4%;
    gap: 3em;
}

#discover-container {
    display: flex;
    flex-direction: column;
    gap: 2em;
}

@media screen and (min-width: 900px) {
    #landing-page-main {
        /* grid-template-columns: 1fr 1fr;
        grid-template-areas: "hero hero"; */
        margin: 2em calc(12% - 2em);
    }

    #discover-container {
        flex-direction: row;
    }
}

#popular {
    grid-area: popular;
}

#discover {
    grid-area: discover;
}

.landing-page-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1em;
    gap: 1em;
    padding: 1em;
}

.shower {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1em;
    gap: 2em;
    padding: 1em;
    padding-top: 50px;
    background-color: var(--accent-color-light);
}

.shower p {
    padding: 0 1em;
}

.big {
    position: absolute;
    top: 0;
    z-index: -1;
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 5em;
    height: auto;
    color: var(--primary-color-light)
}


/* lexicon */
#lexikon-page-main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
    "hero"
    "afrika"
    "asien"
    "australien"
    "europa"
    "nordamerika"
    "suedamerika"
    "polar";
    margin: 2em 4%;
    gap: 2em;
}

@media screen and (min-width: 900px) {
    #lexikon-page-main {
        grid-template-columns: 1fr;
        grid-template-areas: 
        "hero"
        "afrika"
        "asien"
        "australien"
        "europa"
        "nordamerika"
        "suedamerika"
        "polar";
        margin: 2em calc(12% - 2em);
    }

    .continent {
        padding: 2em;
    }
}

.continent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 0px 50px -15px #a5a5a5;
    border-radius: 1em;
    gap: 1em;
    padding: 1em;
}

#afrika {
    grid-area: afrika;
}

#asien {
    grid-area: asien;
}

#australien {
    grid-area: australien;
}

#europa {
    grid-area: europa;
}

#nordamerika {
    grid-area: nordamerika;
}

#suedamerika {
    grid-area: suedamerika;
}

#polar {
    grid-area: polar;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1em;
}

.card {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 13rem;
    gap: 1em;
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0px 0px 50px -15px #a5a5a5;
    transition: 0.5s ease-in-out;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0px 0px 50px -15px var(--primary-color);
}

.card-image {
    width: 100%;
}

.card-text {
    position: absolute;
    bottom: 0;
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5em;
    padding: 0.5em;
    background: linear-gradient(to bottom, #00000000 0%, #feffe5bd 70%, #FEFFE5 100%);
    color: var(--text-color);
    font-size: 1rem;
    text-align: center;
    transition: 0.5s ease-in-out;
}

.card:hover .card-text {
    background-color: #feffe52b;
}

.card-text p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-text h3 {
    text-align: inherit;
}


/* Game */
#animal-guesser-page-main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
    "heading"
    "game"
    "instructions";
    margin: 2em 4%;
    gap: 2em;
}

@media screen and (min-width: 1300px) {
    #animal-guesser-page-main {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: min-content 1fr 1fr;
        grid-template-areas:
        "heading heading heading instructions instructions"
        "game game game instructions instructions"
        "game game game instructions instructions";
        margin: 2em calc(12% - 2em);
    }
}

@media screen and (min-width: 1500px) {
    #animal-guesser-page-main {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: min-content 1fr 1fr;
        grid-template-areas:
        "heading heading instructions"
        "game game instructions"
        "game game instructions";
        margin: 2em calc(12% - 2em);
    }
    
}

.correct {
    background-color: var(--secondary-color);
}

.incorrect {
    background-color: #d84e4e;
    color: white;
}

.heading-container {
    grid-area: heading;
}

.game {
    grid-area: game;
}

#game-instruction {
    grid-area: instructions;
}

.game-head {
    position: relative;
    display: flex;
    justify-content: center; /* Aligns items horizontally in the center */
    align-items: center; /* Aligns items vertically in the center */
    padding: 0.5em 1em;
    margin: 0 auto; /* Centers the div itself if it has a specified width */
}

.game-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0px, 2.6vw, 0.9em); /* Minimum size of 0px, preferred size of 2.6vw, maximum size of 0.9em*/
    border-radius: 1em;
    overflow: hidden;
}

.game-body table, td, th {
    padding: 0.7em 0.5em;
    border: 1px solid var(--background-color);
}

.game-body td{
    text-align: center;
    max-width: 8vw;
    height: calc(30px + 2vw);
    word-wrap: break-word;
}

.game-body th {
    text-align: center;
    background-color: var(--accent-color);
    max-width: 8vw;
    word-wrap: break-word;
}

.game-body th:nth-child(5), td:nth-child(5) {
    max-width: 6vw;
}


/* encyclopaedia */
#animal-page-main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
    "hero"
    "facts"
    "first-paragraph"
    "funfact"
    "second-paragraph";
    margin: 2em 4%;
    gap: 2em;
}

@media screen and (min-width: 900px) {
    #animal-page-main {
        grid-template-columns: 1fr calc(10% + 15em);
        grid-template-areas: 
        "hero hero"
        "first-paragraph facts"
        "funfact facts"
        "second-paragraph facts";
        margin: 2em calc(12% - 2em);
    }
}

/* facts-list */
.facts {
    grid-area: facts;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.facts-list {
    background-color: var(--accent-color);
    border-radius: 1em;
    padding: 1em 2em;
}

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

.facts-list li {
    display: grid;
    grid-template-columns: min-content 1fr;
    padding-block-start: 1em;
    padding-block-end: 1em;
}

.facts-list li:not(:last-of-type) {
    border-bottom: 1px solid var(--background-color);
}

.facts-list-icon {
    grid-column: 1/2;
    grid-row: 1/3;
    width: 2.5rem;
}

.facts-list-label {
    grid-column: 2/3;
    padding-inline-start: 1rem;
}

.facts-list-value {
    grid-column: 2/3;
    padding-inline-start: 1rem;
    font-weight: bold;
    font-size: 1.1em;
}

/* funfact */
.funfact {
    grid-area: funfact;
    height: fit-content;
    display: grid;
    grid-template-columns: min-content 1fr min-content;
    align-items: center;
    gap: 1em;
    padding: 1.5em 1.5em;
    background-color: var(--secondary-color-light);
    border-radius: 1em;
}

.funfact-icon {
    grid-column: 1/2;
    grid-row: 1/2;
    width: 2rem;
}

.funfact-heading {
    grid-column: 2/4;
    grid-row: 1/2;
    text-align: left;
}

.funfact-text {
    grid-column: 2/3;
    grid-row: 2/3;
    text-align: left;
}

.funfact-text b {
    color: var(--primary-color);
    font-weight: bold;
}

/* Animal Text */
.first-paragraph, .second-paragraph {
    display: flex;
    flex-direction: column;
    gap: 1em;
    text-align: left;
    padding: 1em;
}

.first-paragraph {
    grid-area: first-paragraph;
}

.second-paragraph {
    grid-area: second-paragraph;
}


/* Helpers */
/* Button colors */
.link-button {
    display: block;
    padding: 0.8em 0;
    width: 100%;
    border-radius: 0.5em;
    text-decoration: none;
    text-align: center;
    transition: 0.3s ease-in-out;
}

.bg-primary {
    background-color: var(--primary-color);
    color: var(--background-color);
}

.bg-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0px 15px 50px 10px var(--primary-color);
}

.bg-secondary {
    background-color: var(--secondary-color-light);
    color: var(--text-color);
}

.bg-secondary:hover {
    transform: translateY(-5px);
    box-shadow: 0px 15px 50px 10px var(--secondary-color-light);
}

/* Text, Links */
.inline-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.inline-link:hover {
    color: var(--primary-color-light);
}

h1 {
    font-size: 3em;
    color: var(--text-color);
    text-align: left;
}

h2 {
    font-size: 2.2em;
    color: var(--text-color);
    text-align: left;
}

h3 {
    font-size: 1.8em;
    color: var(--text-color);
    text-align: left;
}

h4 {
    font-size: 1.3em;
    color: var(--text-color);
    text-align: left;
}

p {
    line-height: 1.3;
}

em {
    color: var(--primary-color);
    font-weight: bold;
    font-style: normal;
    font-size: 1.15em;
}

.section-title {
    text-align: center;
}

/* Divs */
.heading-container{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
    padding: 0 1em;
}

/* breadcrumbs */
.breadcrumbs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 1em;
    margin: 0 auto;
    background-color: var(--secondary-color-light);
    border-end-end-radius: 1em;
    border-end-start-radius: 1em;
}

.breadcrumb-arrow {
    width: 1.5em;
}

/* Info Box */
.info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2em;
    padding: 2em 4.5em;
    background-color: var(--secondary-color-light);
    border-radius: 1em;
    overflow: hidden;
}

.info-heading, .info-footer {
    display: flex;
    flex-direction: column;
    width: calc(100% + 5em);
    gap: 1em;
}

.info-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5em;
}

.info-body .one::before {
    content: "1";
    font-size: 1.65rem;
    font-weight: bold;
    position: absolute;
    transform: translate(-1em);
    color: var(--accent-color);
    line-height: 0.5;
}

.info-body .two::before {
    content: "2";
    font-size: 1.65rem;
    font-weight: bold;
    position: absolute;
    transform: translate(-1em);
    color: var(--accent-color);
    line-height: 0.5;
}

.info-body .three::before {
    content: "3";
    font-size: 1.65rem;
    font-weight: bold;
    position: absolute;
    transform: translate(-1em);
    color: var(--accent-color);
    line-height: 0.5;
}

.info-body .four::before {
    content: "4";
    font-size: 1.65rem;
    font-weight: bold;
    position: absolute;
    transform: translate(-1em);
    color: var(--accent-color);
    line-height: 0.5;
}

/* Combo Box */
.combobox {
    position: relative;
}

.combobox .group {
    display: inline-flex;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    background-color: var(--background-color);
    border-radius: 1em;
    overflow: hidden;
}

.combobox .group.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.combobox .group.victory {
    background-color: var(--primary-color);
}

.combobox .group.victory input::placeholder {
    color: var(--background-color);
}

.combobox .group.victory:hover {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color-light);
}

.combobox input,
.combobox button {
    background-color: inherit;
    color: black;
    box-sizing: border-box;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    position: relative;
    cursor: pointer;
}

.combobox input {
    width: 100%;
    outline: none;
    margin-left: 1em;
    padding: 1px 3px;
    font-size: 1em;
}

.combobox button {
    width: 55px;
    border-radius: 1em;
    outline: none;
    color: var(--primary-color);
}

.combobox button[aria-expanded="true"] svg {
    transform: rotate(180deg) translate(0, -3px);
}


ul[role="listbox"] {
    margin: 0;
    padding: 0;
    z-index: 2;
    position: absolute;
    list-style: none;
    background-color: var(--background-color);
    display: none;
    box-sizing: border-box;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: 1em;
    border-bottom-right-radius: 1em;
    max-height: 40vh;
    width: 100%;
    overflow: scroll;
    overflow-x: hidden;
    cursor: pointer;
}

ul[role="listbox"].open {
    display: block;
}

ul[role="listbox"] li[role="option"] {
    margin: 0;
    display: block;
    padding-left: 1em;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* focus and hover styling */

.combobox .group.focus polygon,
.combobox .group:hover polygon {
    fill-opacity: 1;
}

.combobox .group.focus input,
.combobox .group.focus button,
.combobox .group button:hover {
    background-color: #def;
}

[role="listbox"].focus [role="option"][aria-selected="true"],
[role="listbox"] [role="option"]:hover {
    background-color: #def;
}