@import url('css/themes.css');
@import url('css/colors.css');

/*  ROOT
    ----------------------------------------------------  */
:root {
    --font-size: 1.1em;
    --font-family: Verdana, Geneva, Tahoma, sans-serif;

    --bodyheight: 97vh;
    --headerheight: 6vh;
    
    --min-input-width: 20rem;
    --max-input-width: 40rem;
    --page-width: 60vw;
    
    --border-radius: 0.8rem;
    --tb-button-size: 32px;
    --overlay-blur: blur(1px);

    --shadow: 16px 14px 16px #000;

    /* --menutoggler-background: linear-gradient(45deg, #5d1010, #cd890d); */

    --edit-zindex: 220;
    --toolbar-zindex: 210;
    --overlay-zindex: 200;
}


/*  FRAMEWORK
    ----------------------------------------------------  */
body {
    font-size: var(--font-size);
    font-family: var(--font-family);

    display: grid;

    height: var(--bodyheight);

    grid-template-columns: 1fr 6fr 1fr;
    grid-template-rows: 2fr 30fr 1fr;
    grid-template-areas:
        "header header header"
        "left page right"
        "footer footer footer";
    gap: 10px;
    padding: 10px;
}

.data {
    display: none;
}

.left {
    grid-area: left;
}

.mid {
    width: var(--page-width);
    position: absolute;
    left: calc( (100vw - var(--page-width))/2 );
    top: 0vh;
}

nav {
    grid-area: header;
    height: var(--headerheight);
    display: flex;
    justify-content: space-between;
}

main {
    display: flex;
    flex-flow: column;
}

footer {
    font-size: small;
    font-style: italic;
    display: flex;
    position: fixed;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    width: inherit;
    bottom: 8px;
    box-shadow: var(--shadow);
    padding-left: 4px;
    padding-right: 4px;
}

.version {
    color: var(--fg);
}
.sitename {
    color: var(--bg);
}

a {
    color: var(--button-text);
}
.right {
    grid-area: right;

}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}


/*  TOP MENU
    ----------------------------------------------------  */

#menutoggler {
    border-radius: 4px;
    font-size: x-large;
    cursor: pointer;
    height: 36px;
    text-align: center;
    width: 40px;
    margin-left: 8px;
    margin-top: 8px;
}


#sitetitle {
    font-weight: bold;
    align-content: center;
    font-size: xx-large;
}

#sitelogo {
    margin-right: 8px;
    margin-top: 8px;
}

.logo {
    width: 64px !important;
    height: 64px !important;
}

h2 {
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

/*  MAIN MENU
    ----------------------------------------------------  */
.menu {
    width: inherit;
    flex-flow: column;
    z-index: 310;
    margin-top: 10px;
}

.menu input {
    width: 80% !important;
    margin-left: 10%;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1em;
    box-shadow: var(--shadow);
}

.menu input[type="button"],
input[type="submit"] {
    color: var(--fg);
    cursor: pointer;
    margin-bottom: 1rem;
}

.menu .sub {
    width: 80%;
    display: none;
    flex-direction: column;
    margin-left: 10%;
    margin-right: 10%;
    margin-bottom: 1rem;
}

.menu .submenu {
    display: block;
}

.menu .page {
    margin-left: 10%;
    margin-top: 4px;
    margin-bottom: 4px;
}

.menu-visible {
    display: flex !important;
}

.menu-hidden {
    display: none !important;
}

.menu-extra {
    width: 2rem;
    height: 2rem;
    background-color: transparent;
    cursor: pointer;
    margin-bottom: 1rem;
}


/*  EDIT
    ----------------------------------------------------  */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-background);
    backdrop-filter: var(--overlay-blur);
    -webkit-backdrop-filter: var(--overlay-blur);
    /* För Safari */
    z-index: var(--overlay-zindex);
}

.pageEditor {
    width: 90vw;
    height: auto;

    .col3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
    }

    .selectDiv {
        display: flex;
        flex-direction: column;
    }

}

.userEditor {
    display: block;
    position: absolute !important;
    top: 30vh !important;
    left: 50vw !important;
    width: 58vw !important;
    height: auto;

    .col3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
    }

    .selectDiv {
        display: flex;
        flex-direction: column;
    }

    select {
        height: 20vh !important;
    }
}

/*  FORM
    ----------------------------------------------------  */
form {
    display: flex;
    flex-direction: column;
    z-index: 500;
    border-radius: var(--border-radius);
    padding: 0.7rem;
    margin-top: 0rem;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

form hr {
    margin: 12px;
}


.formcontainer {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

form .listbox {
    display: inline;
}

.listbox select {
    width: 100%;
}

form iframe {
    width: auto;
    height: 200px;
}

form .content {
    display: flex;
    flex-flow: column;
}

form .buttons {
    display: flex;
    flex-flow: nowrap;
    justify-content: space-evenly;
}

form button,
form input {
    font-weight: bold;
    height: 1.5rem;
    line-height: 1rem;
    margin: 4px;
    border-radius: 4px;
    border: none;
    box-shadow: var(--shadow);
    width: auto;
    min-width: var(--min-input-width);
    max-width: var(--max-input-width);
}

form button[type=submit],
form button[type=button],
form input[type=button],
form input[type=submit] {
    height: 2em;
    border-radius: 8px;
    cursor: pointer;
}

form input[type=password]:focus,
form input[type=button]:focus {
    font-weight: bold;
}

form button[type=submit]:hover,
form button[type=button]:hover,
form input[type=button]:hover,
form input[type=submit]:hover {
    font-weight: bold;
}

form input[type=checkbox] {
    height: 20px;
    width: 20px;
}

form .inputDiv {
    display: grid !important;
    grid-template-columns: 40% 60%;
    gap: 0.7rem;
    margin: 0.7rem;
}

form table {
    display: inline-table;
    width: 56vw;
}

form th {
    text-align: left;
    font-weight: bold;
}

form td {
    font-weight: unset;
    font-size: small;
}

/*  THEME
    ----------------------------------------------------  */
.theme {
    display: flex;
    background: transparent;
    flex-direction: column;
    align-items: center;
}

.theme-selectors {
    display: flex;
    background: transparent;
    flex-direction: row;

}

.theme-red {
    background: linear-gradient(45deg, rgb(255, 81, 28), rgb(255, 0, 0)) !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 1em;
}

.theme-dark {
    background: linear-gradient(45deg, rgb(126, 126, 126), black) !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 1em;
}

.theme-light {
    background: linear-gradient(45deg, rgb(92, 91, 91), rgb(214, 213, 213)) !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 1em;
}

.theme-blue {
    background: linear-gradient(45deg, rgb(114, 234, 250), rgb(8, 2, 88)) !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 1em;
}

.theme-green {
    background: linear-gradient(45deg, rgb(111, 230, 81), rgb(6, 41, 1)) !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 1em;
}

.theme-orange {
    background: linear-gradient(45deg, rgb(247, 162, 66), rgb(92, 49, 0)) !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 1em;
}

.theme-container {
	height: 2em;
	width: 80%;
	display: flex;
	justify-content: space-around;
	margin-left: 10%;
	margin-bottom: 2%;
	background: transparent;
}

.theme-item {
	width: 1.5em;
	margin-left: 0.5em;
	border-radius: 8px;
	box-shadow: var(--shadow);
	height: 1.5em;
	border-radius: 50%;
	margin-top: 0.2em;
}

/*  PAGES
    ----------------------------------------------------  */
.viewport {
    overflow: hidden;
    width: 100%;
}

.pages {
    display: flex;
    transition: transform 300ms ease;
}

.page {
    flex: 0 0 100%;
    display: grid;
    gap: 1rem;
}

/*  POPUP
    ----------------------------------------------------  */
.pop {
    font-weight: bold;
    margin: 20px;
    border-radius: 8px;
    top: 50%;
    left: 50%;
    position: fixed;
    box-shadow: var(--shadow);
    transform: translate(-50%, -50%);
    z-index: 600;
    display: flex;
    flex-direction: column;
}

.pop div {
    display: flow-root;
    text-align: center;
}


.pop input {
    color: var(--fg);
    font-weight: bold;
    height: 1.5rem;
    width: max-content;
    line-height: 1rem;
    margin: 4px;
    border-radius: 4px;
    border: none;
    box-shadow: var(--shadow);
    min-width: var(--min-input-width);
    max-width: var(--max-input-width);
}

.pop .message {
    position: relative;

}

.pop .error {
    background: red;
    color: wheat;
    position: relative;
}

/*  SECTIONS
    ----------------------------------------------------  */
section {
    display: block;
    width: inherit;
    margin: 10px;
    border-radius: var(--border-radius);
    outline: none;
    min-height: 2rem;
}

section .edit {
    display: flex;
    flex-direction: column;

}

.enabled {
    border-radius: 2px;
}

.busy {
    z-index: var(--edit-zindex);
    position: relative;
    border-radius: 2px;
}

/*  TEXT
    ----------------------------------------------------  */
section .text {
    display: block;
}

.text a {
    cursor: pointer;
}

section strong {
    font-weight: bold;
}

/*  AUDIO
    ----------------------------------------------------  */
audio {
    width: -moz-available;
    width: -webkit-fill-available;
    box-shadow: var(--shadow);
    background: transparent;
    border-radius: var(--border-radius);
}

.audio {
    display: block;
}

.audio figcaption {
    font-style: italic;
}


/*  SPOTIFY
    ----------------------------------------------------  */
.spotify {
    display: block;
    text-align: center;
}


/*  TOOLBAR
    ----------------------------------------------------  */
.toolbar {
    display: inline;
    height: var(--tb-button-size);
    background: transparent;
    padding: 0.5rem;
    color: var(--fg);
    border-radius: var(--border-radius);
    z-index: var(--toolbar-zindex);
}

.toolbar .toolitem {
    width: var(--tb-button-size);
    height: var(--tb-button-size);
    margin-left: 0.5em;
    margin-bottom: 1em;
    border-radius: 0.5em;
    background: transparent;
    margin-right: 0.5em;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.toolbar .spacer {
    outline: 'none';
    background: transparent;
    box-shadow: none;
    width: var(--tb-button-size);
    height: var(--tb-button-size);
    margin-left: 0.5em;
    margin-bottom: 1em;
    border-radius: 8px;

}

.disable-toolitem {
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/*  USER
    ----------------------------------------------------  */
.userEditor {
    display: flex;
    z-index: 10;
    position: fixed;
    left: 20vw;
    top: 2vh;
    padding: 10px;
    border-radius: var(--border-radius);
    width: 25rem;
    gap: 1rem 1rem;
    flex-direction: column;

    select {
        height: 2rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }

    div {
        display: flex;
        flex-flow: column;
        gap: 1rem 1rem;
    }

    input[type=checkbox] {
        outline: none;
        background: transparent;
        color: transparent;
        box-shadow: none;
    }
}

/*  USER MENU
    ----------------------------------------------------  */
.usermenu {
    display: none;
    /* flex; */
    flex-direction: column;
    position: fixed;
}

.usermenu input[type=button] {
    font-weight: bold;
    height: 1.5rem;
    line-height: 1rem;
    margin: 4px;
    border-radius: 4px;
    border: none;
    box-shadow: var(--shadow);
    width: auto;
    min-width: calc(var(--min-input-width)/2);
    max-width: calc(var(--max-input-width)/2);
}

.usermenu input[type=button]:focus {
    font-weight: bold;
}

.usermenu input[type=button]:hover {
    font-weight: bold;
}

/*  VIDEO
    ----------------------------------------------------  */
.video {
    display: block;
}

/*  YOUTUBE
    ----------------------------------------------------  */
.youtube {
    display: flex;
    justify-content: center;
    text-align: center;
}

/*  IMAGE
    ----------------------------------------------------  */
.image {
    display: grid;
    grid-template-columns: 50% auto;
    flex-flow: wrap;
    justify-content: center;
}

.image figure {
    height: auto;
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 1rem;
}

.image img {
    width: 90%;
    height: auto;
    box-shadow: var(--shadow);
    margin: 1rem;
    border-radius: var(--border-radius);
}

.image img:hover {
    outline: none;
}

.busy img:hover {
    width: 90%;
    height: auto;
    outline: var(--outline-hover);
}

.busy img:active {
    width: 90%;
    height: auto;
    outline: var(--outline-active);
}

.image figcaption {
    text-align: center;
    font-style: italic;
    color: var(--strong-color);
}

/*  PAGE EDITOR
    ----------------------------------------------------  */
.pageEditor {
    display: flex;
    flex-direction: column;
}

.pageContent {
    display: flex !important;
    flex-flow: row !important;
    justify-content: space-evenly !important;
}

.pageEditor .left {
    display: flex;
    flex-direction: column;
}

.pageEditor .right {
    display: flex;
    flex-direction: column;
}



/*  MOBILE 
    ----------------------------------------------------  */
@media screen and (max-width: 480px) {

    /*  FRAMEWORK */
    body {
        font-size: 0.8em;
        gap: 7px;
        padding: 0px;
        height: 96vh;
        grid-template-columns: 0fr 1fr 0fr;
    }

    main {
        width: 90vw;
        margin-left: 6px;

    }

    .mid {
        left: 0;
        width: unset;
    }

    h2 {
        font-size: inherit;
    }

    .image {
        display: grid;
        grid-template-columns: 100%;
        flex-flow: wrap;
        justify-content: center;
    }

    #sitetitle {
        font-size: medium;
    }

    footer {
        font-size: 0.5em;
        width: 88%;
        margin-left: 2%;
    }

    #menutoggler {
        height: 28px;
        width: 28px;
        line-height: 28px;
        margin-top: 4px;
    }

    #sitelogo {
        width: 14vw;
        margin-top: 2px;
        margin-right: 5px;
    }


    form {
        margin-left: 5% !important;
        width: 80%;
        max-height: unset !important;
    }

    /* MAINMENU */
    #login {
        display: none;
    }
    .logo {
        width: 42px !important;
        height: 42px !important;
    }


    /* THEME */
    .theme-dark,
    .theme-light,
    .theme-blue,
    .theme-green,
    .theme-orange,
    .theme-red {
        width: 10px;
        height: 10px;
        margin-top: 1em;
        margin-left: 0.5em;
    }
}