@font-face {
    font-family: pixelate;
    font-weight: normal;
    src: url(../fonts/pixelate.ttf);
}

/**
 *
 * Reset styles
 *
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

img {
    display: block;
    outline: none;
}

/* Width */
::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

/* Track */
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.container::-webkit-scrollbar-track {
    background: transparent;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background-color: #cdcdcd;
    border-radius: 10px;
}

.container::-webkit-scrollbar-thumb {
    background-color: hsl(69, 87%, 48%);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #a6a6a6;
}

/**
*
* Global styles
*
*/

body {
    display: grid;
    font: 1rem / 1.5rem Arial;
    gap: 2rem;
    grid-template-areas:
        'aside nav'
        'aside main'
        'aside footer';
    grid-template-columns: 2fr 4fr;
    grid-template-rows: auto 1fr auto;
    height: 100%;
}

h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

table,
.dataTable-table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    overflow-x: scroll;
    width: 100%;
}

tbody tr {
    background-color: #f1f1f1;
}

tbody tr td {
    padding: 0.5rem 1rem;
}

td:first-child {
    border-radius: 6px 0 0 6px;
}

td:last-child {
    border-radius: 0 6px 6px 0;
}

thead {
    background-color: white;
    box-shadow: 0 10px 10px white;
    position: sticky;
    top: 0;
}

th {
    padding: 0 0 0.5rem 1rem;
    text-align-last: left;
}

a {
    color: royalblue;
    text-decoration: none;
}

a:hover {
    color: black;
}

label {
    display: block;
}

form > *:not(:last-child) {
    margin-bottom: 1rem;
}

input {
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 1.2rem;
    padding: 0.5rem;
    width: 100%;
}

input:focus {
    border: 2px solid mediumpurple;
    box-shadow: 0 0 1px mediumpurple;
    outline: none;
    transition: ease 0.25s;
}

input[type='checkbox'] {
    height: 1.2rem;
    outline: none;
    width: 1.2rem;
}

input[type='range'] {
    width: 100%;
}

select {
    border: 2px solid #bbb;
    border-radius: 4px;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

.btn {
    align-items: center;
    align-self: stretch;
    border: 1px solid #333;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 0.75rem;
    justify-content: center;
    letter-spacing: 1px;
    padding: 0.25rem 0.75rem;
    text-align: center;
    text-transform: uppercase;
}

.btn.blue {
    background-color: royalblue;
    border-color: royalblue;
    color: #fff;
}

.btn.submit {
    background-color: black;
    color: #fff;
    padding: 1rem 1.5rem;
    width: 100%;
}

.btn:hover {
    opacity: 0.8;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-group > * {
    position: relative;
}

/**
 *
 * Content styles
 *
 */

aside {
    background: url(../img/real-estate.webp) no-repeat 0 top / contain;
    grid-area: aside;
    height: 100vh;
}

.container {
    background: linear-gradient(transparent, hsl(69, 87%, 71%) 175px);
    height: 100%;
    overflow-y: scroll;
    padding: 175px 2vw 2rem;
    /* Firefox scrollbar fix */
    scrollbar-color: hsl(69, 87%, 48%) transparent;
    scrollbar-width: thin;
}

aside .btn-group input[type='radio'] {
    background-color: red;
    cursor: pointer;
    height: 100%;
    opacity: 0;
    position: absolute;
    width: 100%;
}

aside .type .wrap,
aside .location .wrap {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

aside .wrap > * {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.btn-group input[type='radio'] + label {
    background-color: hsl(69, 87%, 71%);
}

.btn-group input[type='radio']:checked + label {
    border-color: transparent;
    box-shadow: 0 0 0 2px royalblue;
    color: royalblue;
    font-weight: bold;
}

aside form > *:not(:first-child) {
    margin-top: 2.5rem;
}

aside .btn-group > * {
    width: 100%;
}

nav:not(.dataTable-pagination) {
    align-items: center;
    border-bottom: 1px solid #ccc;
    display: flex;
    gap: 1rem;
    grid-area: nav;
    justify-content: space-between;
    padding: 2vw 0;
    width: 96%;
}

.logo {
    font-family: pixelate;
    font-size: 2.2rem;
}

.logo a {
    color: black;
}

.locale {
    display: flex;
    gap: 0.25rem;
}

.locale button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    margin: 0;
}

main {
    display: flex;
    grid-area: main;
    height: 100%;
    overflow: auto;

    /* Firefox scrollbar */
    scrollbar-color: #cdcdcd #f0f0f0;
    scrollbar-width: thin;
    width: 96%;
}

footer {
    align-items: center;
    border-top: 1px solid #ccc;
    display: flex;
    grid-area: footer;
    justify-content: space-between;
    padding: 2vw 0;
    width: 96%;
}

footer span {
    color: crimson;
}

/* Login Page */

body.login {
    grid-template-areas:
        'nav'
        'main'
        'footer';
    grid-template-columns: 1fr;
}

body.login > * {
    margin: 0 auto;
}

body.login main {
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

form#login {
    background-color: #f1f1f1;
    border-radius: 8px;
    padding: 2.5rem 3rem 3rem;
}

form#login .wrapper {
    display: grid;
    gap: 1rem 2rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 2rem;
}

/* Ajax Login Form */
#loginbtn {
    position: relative;
    z-index: 999;
}

#loginbtn.close {
    border-width: 4px;
    padding: 0;
    position: fixed;
    right: 2rem;
    top: 2rem;
}

#loginbtn.close span {
    display: none;
}

#loginbtn.close:after {
    content: '\2716';
    font-size: 2.2rem;
    font-weight: bold;
    height: 3.1rem;
    line-height: 3.2rem;
    width: 3.1rem;
}

nav #login-form {
    opacity: 0;
    position: fixed;
    visibility: hidden;
}

nav #login-form.show {
    align-items: center;
    backdrop-filter: blur(10px);
    background-color: hsl(69, 87%, 71%, 70%);
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 1;
    top: 0;
    transition: 0.75s ease;
    visibility: visible;
    width: 100%;
    z-index: 9;
}

nav #login-form form {
    background-color: rgb(128 0 128 / 80%);
    visibility: hidden;
}

nav #login-form.show form {
    box-shadow: 0 0 50px rgb(0 0 0 / 70%);
    color: #fff;
    visibility: visible;
    width: 50%;
}

/* End Login Page */

/**
 *
 * Media Queries
 * Mobile Last... Only this time ;) 
 *
 */

@media screen and (max-width: 639px) {
    body {
        gap: 0;
        grid-template-areas:
            'nav'
            'aside'
            'main'
            'footer';
        grid-template-columns: 1fr;
        height: auto;
        overflow: overlay;
    }

    nav {
        flex-direction: column;
    }

    nav #login-form.show form {
        width: 90%;
    }

    aside,
    .container {
        height: auto;
    }

    .container {
        overflow: auto;
        padding-left: 4%;
        padding-right: 4%;
    }

    main {
        padding: 0 2%;
        width: 100%;
    }

    nav,
    main,
    footer {
        padding: 2rem 2%;
        width: 100%;
    }
}
