/* ----------------------------------- GLOBAL STYLE */

/* google fonts */
@import url('https://fonts.googleapis.com/css2?family=Arvo&display=swap');

/*Remove default auto margin, padding and border*/
* {
    margin: 0;
    padding: 0;
    border: 0;
}

/* CSS variables for light theme */
.theme-light {
    --background-img: url("../images/background-light.jpg");
    --color-background: white;
    --color-bg-modal: white;
    --color-primary: black;
    --color-btn-start: #005C37;
    --btn-border: 1px solid black;
}

/* CSS variables for dark theme */
.theme-dark {
    --background-img: url("../images/background-dark.jpg");
    --color-background: black;
    --color-bg-modal: #454a4f;
    --color-primary: white;
    --color-btn-start: #00B36B;
    --btn-border: 1px solid white;
}

body {
    background-color: var(--color-background);
    background-image: var(--background-img);
    background-repeat: no-repeat;
    background-size: contain;
    background-size: cover;
    color: var(--color-primary);
    font-family: 'Arvo', serif;
    font-size: 100%;
}

h2 {
    text-align: center;
    font-size: 2rem;
}


/* ------------------------------------------- MAIN */

/* flex container used in most sections of the page */
.flex-container {
    display: flex;
    /* default value */
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10%;
    margin-left: 10%;
}

.flex-item {
    flex-basis: 100%;
    text-align: center;
}

.flex-item img {
    max-height: 30vh;
    width: auto;
}

/* buttons */
.btn {
    border: var(--btn-border);
    border-radius: 4px;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    margin: 16px 0px 16px;
    padding: 8px;
}


/* -------------------------- Home section */

h1 {
    color: #F06F66;
    font-size: 2rem;
    margin: 32px 0px 32px 38px;
}

p {
    font-size: 1.5rem;
    margin: 16px 0px 16px 0px;
}

.btn-wrapper {
    display: inline-block;
    margin-top: 8px;
}

#btn-start {
    color: var(--color-btn-start);
}


/* --------------------------- Game layout */

.answer-area {
    margin: auto;
    width: 60%;
}

/* This CSS code to animate buttons was taken from
Federico Dossena's (https://fdossena.com/?p=html5cool/buttons/i.frag)
site (9IDLE AMINATION: BOUNCY BOUNCY section).*/
.bouncy {
    animation: bouncy 5s infinite linear;
    position: relative;
}

@keyframes bouncy {
    0%{top:0em}
    40%{top:0em}
    43%{top:-0.9em}
    46%{top:0em}
    48%{top:-0.4em}
    50%{top:0em}
    100%{top:0em;}
}


/* ------------------------------------------ Modal */

.flex-container-modal {
    flex-direction: column;
    margin-top: 0;
    margin-left: 0;
}

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

#correctAnswer {
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 3rem;
}

/*
Learned how to create a Modal Box with CSS and JavaScript and adopted code from this W3Schools
(https://www.w3schools.com/howto/howto_css_modals.asp) tutorial.
Adopted code from this example https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_modal2 */

/* The Modal (background) W3Schools tutorial */
.modal {
    /* Hidden by default */
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
}

/* Modal Box with CSS and JavaScript - W3Schools tutorial */
.modal-content {
    position: relative;
    background-color: var(--color-bg-modal);
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 70%;
    -webkit-animation-name: animatetop;
    -webkit-animation-duration: 0.4s;
    animation-name: animatetop;
    animation-duration: 0.4s
}

/* Add Animation. Modal Box with CSS and JavaScript - W3Schools tutorial */
@-webkit-keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}
  
@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

/* The Close Button. Modal Box with CSS and JavaScript - W3Schools tutorial */
.close {
    color: white;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

/* Modal Box with CSS and JavaScript - W3Schools tutorial */
.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Modal Box with CSS and JavaScript - W3Schools tutorial */
.modal-header {
    padding: 2px 16px;
    color: white;
}

/* Modal Box with CSS and JavaScript - W3Schools tutorial */
.modal-body {
    padding: 2px 16px;
}

#results-section p {
    line-height: 3rem;
}


/* ---------------------------------- MEDIA QUERIES */

/* flex-item can grow to occupy the available space
   flex-item can shrink to fit the container
   the width of flex-item is auto calculated */

   @media screen and (min-width: 767px) {
    .flex-item {
        flex: 1;
    }
    /* make images visible on smaller devices only*/
    .img-sm-screen {
        display: none;
    }
}

/* hide background image and remove margin for smaller devices*/
@media only screen and (max-width: 767px) and (min-width: 0px) {
    body {
        background-image:none;
    }

    .flex-container {
        margin-left: 0%;
    }
}