@charset "UTF-8";

* {
    padding: 0;
}

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    font-size: 1em;
    font-family: sans-serif;
    background: url("../images/background.jpg") repeat-y, rgba(255, 255, 255, 0.9);
    background-blend-mode: lighten;
    background-size: cover;
}

header {
    background: var(--background-color);
    padding: 20px;
    text-align: center;
}

nav {
    text-align: center;
    position: sticky;
    top: 0;
}

nav > ul > li > a:link, nav > ul > li > a:visited, nav > ul > li > button[type=button] {
    text-decoration: none;
    background-color: var(--primary-color);
    color: var(--background-color);
    padding: 10px 20px;
    text-align: center;
    display: inline-block;
    border-radius: 10px;
    border: none;
    text-transform: capitalize;
    margin: 5px;
}

nav > ul > li > a:hover, nav > ul > li > a:active, nav > ul >  li > button[type=button]:hover, nav > ul > li > button[type=button]:active {
    text-decoration: none;
    background-color: var(--secondary-color);
    margin: 5px;
    opacity: 1;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--background-color);
}

li{
	display: inline;
}

main {
    padding: 20px;
    text-align: justify;
    margin: 0 5% 0 5%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    color: var(--primary-color);
    line-height: 4rem;
}

h2, h3, h4, h5, h6 {
    text-decoration: underline;
}

.greeting {
    text-transform: capitalize;
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

input[type=text], input[type=email], input[type=password], input[type=text] {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

button[type=submit] {
    color: #fff;
    background-color: #007bff;
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid #007bff;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

button[type=reset] {
    color: #6c757d;
    background-color: var(--background-color);
    background-image: none;
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid #6c757d;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

button[type=delete] {
    color: var(--background-color);
    background-color: #DC3545;
    background-image: none;
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid #6c757d;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.error-message {
    position: absolute;
    top: 60px;
    right: 20px;
    overflow: hidden;
    padding: 1rem 2rem;
    border-radius: 7px;
    border-color: #f5c6cb;
    background-color: #f8d7da;
    color: #721c24;
    -webkit-animation: fadeinout 5s linear 1 forwards;
    animation: fadeinout 5s linear 1 forwards;
}

.success-message {
    position: absolute;
    top: 60px;
    right: 20px;
    overflow: hidden;
    padding: 1rem 2rem;
    border-radius: 7px;
    border-color: #c3e6cb;
    background-color: #d4edda;
    color: #155724;
    -webkit-animation: fadeinout 5s linear 1 forwards;
    animation: fadeinout 5s linear 1 forwards;
}

.cardbox {
    display: flex;
}

.card {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    width: 300px;
}

@-webkit-keyframes fadeinout {
    0% { opacity: 0; }
    25% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

.error-message::before,
.success-message::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #000000;
    transform-origin: left;
    transform: scaleX(0);
    animation: progress 5s linear forwards;
}

@keyframes fadeinout {
    0% { opacity: 0; }
    25% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes progress {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

footer {
    background: #424242;
    padding: 20px;
    text-align: center;
}

@media screen and (max-width: 768px) {
    nav {
        text-align: center;
    }
    .cardbox {
        display: block;
    }
    .card {
        width: 100%;
        padding: 5px;
        margin: 10px 0 10px 0;
    }
}

@media screen and (max-width: 600px) {
    .error-message,
    .success-message {
        top: auto;
        bottom: 20px;
        text-align: center;
        width: 100%;
        left: 0;
        right: 0;
    }
    main > p {
        hyphens: auto;
        text-align: justify;
    }
}