@import url("./reset.css");
@font-face {
    font-family: "SpecialElite";
    src: url("../fonts/special-elite/SpecialElite.ttf");
}

:root {
    --backgroundColor: #FCFFFD;
    --accentColor: #DAFFEF;
    --foregroundColor: #4D565D;
    --altAccentColor: #C0FDFB;
    --altColor: #376C65;
    --darkText: rgb(50, 50, 50);
}


html, body {
    width: 100%;
    height: 100%;
}

body {
    background-color: #FCFFFD;
    display:grid;
    grid-template-columns: 1rem 1fr 1fr 1rem;
    grid-template-rows: 3rem 20vh auto 10vh 10vh;
    grid-template-areas: 
        " . . . . "
        " . header header . "
        " . widget widget . "
        " catalog catalog catalog catalog"
        " footer footer footer footer";
}
@media (min-width: 1500px) {
    body {
        grid-template-columns: 1rem 1fr 1fr 1rem 1fr;
        grid-template-rows: 3rem 20vh auto 10vh 10vh;
        grid-template-areas: 
            " . . . . catalog"
            " . header header . catalog "
            " . widget widget . catalog "
            " . . . . catalog"
            " footer footer footer footer footer"
    }
}

.bodyNoCatalog {
    display:grid;
    grid-template-columns: 1rem 1fr 1fr 1rem;
    grid-template-rows: 3rem 20vh auto 10vh 10vh;
    grid-template-areas: 
        " . . . . "
        " . header header . "
        " . widget widget . "
        " . widget widget ."
        " footer footer footer footer";
}

header {
    grid-area: header;
    
}

header > h1 {
    font-size: 5rem;
    text-align: center;
    font-family: SpecialElite, 'Courier New', Courier, monospace;
}

header > p {
    font-size: 1rem;
    text-align: center;
    padding-top: 3vh;
    font-family: Arial, Helvetica, sans-serif;
}

main {
    grid-area: widget;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    
}

footer {
    grid-area: footer;
    height: 100%;

    background-color: var(--altColor);
    color: var(--altAccentColor);

    display:flex;
    justify-content: space-evenly;
    align-items: center;

    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
}
@media (min-width: 800px) {
    footer {font-size: 1.3rem;}
}
footer > p > a {
    color: var(--altAccentColor);
    height: 100%;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

a {
    text-decoration: underline;
    cursor: pointer;
}

.infoContainer {
    margin-bottom: 5rem;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    line-height: 2rem;
}
@media (min-width:800px){
    .infoContainer{ 
        margin: 0px 15vw; 
        margin-bottom: 5rem;
    }
}

.infoTitle {
    font-size: 2rem;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    margin-bottom: 1rem;
}
.infoText {
    
    font-size: 1rem;
}
.infoText a {
    cursor: pointer;
}
.infoText strong {
    font-weight: bold;
}

.infoContainer form {
    margin-top: 3rem;
    padding:2rem;

    background-color: var(--accentColor);
    border-radius: 15px;
    height: max-content;
}
.infoContainer form p {
    margin: 2rem;
    display:flex;
    align-items: center;
    flex-wrap: wrap;
    overflow: visible;
}
.infoContainer fieldset {
    border: 1px solid var(--foregroundColor);
    margin: 1rem 0px;
}
.infoContainer legend {
    margin-left: 1rem;
    font-size: 1.5rem;
    background-color: var(--accentColor);
} 
.infoContainer h3 {
    font-size: 2rem;
}
.infoContainer textarea {
    width: 100%;
    height: 5rem;
    border-radius: 15px;
    border-color: var(--altAccentColor);
    font-size: 1rem;
}
.infoContainer label {
    margin-right: 1rem;
}
.infoContainer input {
    width: 50%;
    height: 2rem;
    border-radius: 5px;
    font-size: 1rem;
    
    border: 1px solid var(--altAccentColor)
}
.infoContainer input[type="submit"] {
    width:25vw;
    height: max-content;
    margin: 1rem auto;
    padding:1rem;
    font-size: 1rem;
    background-color: var(--backgroundColor);
    border: 1px solid var(--altAccentColor);
    border-radius: 15px;
    
    cursor: pointer;
}


/* Refresh button */

.refreshButton {
    border: none;
    background-color: transparent;
    width:max-content;
    height:auto;
    margin:3rem;
    cursor: pointer;
    animation: shake 1s ease-in-out;
}   
.refreshIcon {
    width:2rem;
}

/*Article stuff*/

.widget {
    
    width: 100%;
    height: max-content;
    display:grid;
    grid-template-columns: 1rem 7fr 3fr 1rem;
    grid-template-rows: 1rem max-content max-content auto min-content 1rem;
    grid-template-areas: 
        " . . . . "
        " . header thumb . "
        " . instructions instructions . "
        " . ingredients ingredients . "
        " . tags tags . "
        " . . . . ";

    background-color: var(--accentColor);
    border-radius: 15px;
}
@media (max-width: 400px) {
    .widget{
        grid-template-columns: 1vw 7fr 3fr 1vw;
        grid-template-rows: 1rem max-content max-content auto min-content 1rem;
        grid-template-areas: 
            " . . . . "
            " . header header . "
            " . instructions thumb . "
            " . ingredients ingredients . "
            " . tags tags . "
            " . . . . ";
    }
}
@media (min-width: 800px) {
    .widget {
        grid-template-columns: 1rem 7fr 3fr 1rem;
        grid-template-rows: 1rem max-content max-content auto min-content 1rem;
        grid-template-areas: 
            " . . . . "
            " . header thumb . "
            " . instructions thumb . "
            " . ingredients . . "
            " . tags tags . "
            " . . . . ";
    }
    
}

@media (min-width: 1500px) {
    .widget {
        grid-template-columns: 1rem 5fr 3fr 1rem;
        grid-template-rows: 1rem max-content max-content auto min-content 1rem;
        grid-template-areas: 
            " . . . . "
            " . header thumb . "
            " . ingredients thumb . "
            " . ingredients instructions . "
            " . tags tags . "
            " . . . . ";
    }
    
}

.widgetIngredient {
    
    width: 100%;
    height: max-content;
    display:grid;
    grid-template-columns: 1rem 7fr 3fr 1rem;
    grid-template-rows: 1rem max-content max-content auto min-content 1rem;
    grid-template-areas: 
        " . . . . "
        " . header header . "
        " . instructions instructions . "
        " . instructions instructions . "
        " . tags tags . "
        " . . . . ";

    background-color: var(--accentColor);
    border-radius: 15px;
}
@media (min-width: 800px) {
    .widgetIngredient{
        width:auto;
        margin: 0px 15vw; 
        margin-bottom: 5rem;
    }
}


.widget[hidden] {
  display: none;
}
@media (min-width: 1500px) {
 .widget[hidden] {
    display:grid;
 }
}
.widgetHeader {
    grid-area: header;
    display:flex;
    flex-direction: column;   
    justify-content: start; 
    align-items: start;
    padding: 1rem;
    margin-right: 5rem;
    
    font-family: SpecialElite, 'Courier New', Courier, monospace;

    
}
.widgetTitle {
    text-align: left;
    font-size: 2rem;
    color: var(--darkText);
    overflow-wrap: normal;
    font-family: SpecialElite, 'Courier New', Courier, monospace; 
    
}
@media (min-width: 800px) {
    .widgetTitle {
        word-break: normal;
        font-size: 4rem;
    }
}
.widgetSubtitle {
    padding: 0px;
    font-size: 1rem;
    color:var(--foregroundColor);
    text-align: left;
    font-family: SpecialElite, 'Courier New', Courier, monospace;
}
@media (min-width: 800px) {
    .widgetSubtitle {
        font-size: 2rem;
    }
}
.widgetThumb {
    grid-area: thumb;
    width: 25vw;
    height: auto;
    border-radius: 5px;
    transform: rotate(5deg) translateY(-15px) translateX(-15px);
}

@media (min-width: 1500px) {
    .widgetThumb {
        width: 15vw;
    }
}

.widgetClip {
    position:relative;
    top: -25px;
    left: 70vw;
    width: 3rem;
    height: auto;
}
@media (max-width: 400px) {
    .widgetClip {
        left: 85vw;
        width: 2rem;
        top: 16vh;

        display:none;
    }
}
@media (min-width: 1500px) {
    .widgetClip {
        left: 50vw;
        width: 4rem;
    }
}

.widgetIngredientDescription {
    grid-area: instructions;
    width:80%;
    padding-left: 10%;
    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5rem;
}
.widgetInstructions {
    grid-area: instructions;
    width:80%;
    padding-left: 10%;
    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5rem;

}

@media (min-width: 1500px){
    .widgetInstructions{
        padding:0px;
    }
    .widgetInstructions::before{
        content: "Instructions ";
        font-weight: bold;
        display:block;
        width:100%;
        font-size: 1.5rem;
    }
}
.widgetIngredients {
    grid-area: ingredients;
}

.widgetIngredients tr {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding-top:2rem;
}

.widgetIngredients th {
    width:33%;
    font-size: 1.2rem;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    
    text-align: left;
    
}

.widgetIngredients td {
    width: 33%;
    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    
}
.widgetIngredients a {
    color: black;
}
.widgetTags {
    grid-area: tags;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
    
    margin: 1rem;
}
@media (min-width: 1500px) {
    .widgetTags{
        margin-top: 4rem;
    }
}
.widgetTags p {
    padding: 0.5rem;
    margin-top: 0.5rem;
    margin-right: 1rem;
    background-color: var(--altAccentColor);
    border-radius: 10px;

    color: var(--darkText);
    font-size: 1rem;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    

}


/*Shaker stuff*/

#shakerButton {
    background-color: transparent;
    padding: 0px;
    border: none;
    width:50vw;
    height:auto;
    cursor: pointer;
}
@media (min-width: 800px) {
    #shakerButton {
        width: 20vw;
    }
}

#shakerButton > img {
    width:100%;
    height:auto;
}

.shakeAnimation {
    animation: shake 1s ease-in-out;
}
.shakeAnimationFade {
    animation: shakeFade 1s ease-in-out;
}

@keyframes shake {
    10%, 90% {
        transform: rotate(-10deg);
    }
    
    20%, 80% {
        transform: rotate(20deg);
    }

    30%, 50%, 70% {
        transform: rotate(-40deg);
    }

    40%, 60% {
        transform: rotate(40deg);
    }
}

@keyframes shakeFade {
    10%, 90% {
        transform: rotate(-10deg);
    }
    
    20%, 80% {
        transform: rotate(20deg);
    }

    30%, 50%, 70% {
        transform: rotate(-40deg);
    }

    40%, 60% {
        transform: rotate(40deg);
    }
    100% {
        opacity: 0%;
    }
}

/*Catalog stufff*/

.showCatalog{
    animation: slideUpCatalog 1s ease-out;

    box-sizing: border-box;
    min-width: 100vw;
    max-width:100vw;
    height:80vh;
    position:absolute;
    top:0;
    left:0;
    z-index: 99;
    margin-top:20vh;
    padding: 1rem;

    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center     ;


    background-color: var(--altColor);
    color: var(--backgroundColor);
    border-radius: 50% 50% 0 0 / 5% 5% 0 0;
    
}


@keyframes slideUpCatalog {
    0% {
        transform: translateY(80%);
    }
    100% {
        transform: translateY(0);
    }
}

.catalog {
    grid-area: catalog;
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 2rem;
    border-radius: 50% 50% 0% 0%;

    background-color: var(--altColor);
    color: var(--backgroundColor);
    
}

.catalog > button {
    background-color: var(--altColor);
    padding: 0px;
    border: none;
    height: max-content;
    width: max-content;
    color:inherit;
    cursor:pointer;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.showCatalog > button {
    background-color: var(--altColor);
    padding: 0px;
    border: none;
    height: max-content;
    width: max-content;
    color:inherit;
    cursor:pointer;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
}

.catalogSearch {
    padding: 1rem;
    width: 70%;
    margin:3rem;
    font-size: 1rem;
    border-radius: 15px;
    border: 3px solid var(--altAccentColor);

}

.catalogResultsContainer {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: 100%;
}

.searchResultItem {
    padding: 1rem;
    width: 100%;
    font-size: 1rem;
    border:none;
    background-color: inherit;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    color: var(--backgroundColor);
    cursor: pointer;
}

.searchResultItem:hover, .searchResultItem:focus {
    background-color: #44857d;
}

@media (min-width: 1500px) {
    .showCatalog{
        animation: slideUpCatalog 1s ease-out;
        min-width: 100%;
        max-width: 100%;    
        height: 100%;
        margin: 0px;
        padding: 1rem;
        

        grid-area: catalog;
        position: static;

        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: center;


        background-color: var(--altColor);
        color: var(--backgroundColor);
        border-radius: 0%;
        
    }


    @keyframes slideUpCatalog {
        0% {
            transform: translateX(50%);
        }
        100% {
            transform: translateX(0);
        }
    }

    .catalog {
        grid-area: catalog;
        display: flex;
        justify-content: center;
        justify-self: end; 
        align-items: center;
        margin: 0px;
        padding: 2rem;
        border-radius: 0%;
        width:min-content;

        background-color: var(--altColor);
        color: var(--backgroundColor);
        
    }

    .catalog > button {
        background-color: var(--altColor);
        padding: 0px;
        border: none;
        height: max-content;
        width: max-content;
        color:inherit;
        cursor:pointer;
        text-align: center;
        font-size: 1.5rem;
        font-weight: bold;
    }

    .showCatalog > button {
        background-color: var(--altColor);
        padding: 0px;
        border: none;
        height: max-content;
        width: max-content;
        color:inherit;
        cursor:pointer;
        text-align: center;
        font-size: 2rem;
        font-weight: bold;
    }

    .catalogSearch {
        padding: 1rem;
        width: 70%;
        margin:3rem;
        font-size: 1rem;
        border-radius: 15px;
        border: 3px solid var(--altAccentColor);

    }

    .catalogResultsContainer {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        width: 100%;
    }

    .searchResultItem {
        padding: 1rem;
        width: 100%;
        font-size: 1rem;
        border:none;
        background-color: inherit;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: bold;
        color: var(--backgroundColor);
        cursor: pointer;
    }

    .searchResultItem:hover {
        background-color: #44857d;
    }
}
