/* fonts */
@import url('https://fonts.googleapis.com/css2?family=Dosis:wght@200..800&family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* global variables */
:root {
    color-scheme: light dark;
    --primary-color: #1f64c9;
    --primary-accent: #65c1f9;
    --secondary-color: #ff6619;
    --secondary-accent: #fca31b;
    --background-main: light-dark(#f1f1f1, #181818);
    --background-alt: light-dark(#ebebeb, #232229);
    --text-color: light-dark(#010101, #f1f1f1);
    --text-color-hover: light-dark(#1d1d1d, #d4d4d4);
    --text-color-light: #f1f1f1;
    --text-color-dark: #010101;
    --border-color: light-dark(#aaaaaa, #303030);
    --border-color-alt: light-dark(#303030, #aaaaaa);
    --top-height: 8%;
    --content-height: calc(100% - var(--top-height));
    --menu-footer-height: 20%;
    --menu-height: calc(100% - var(--menu-footer-height));
    --menu-width: 15%;
    --content-width: calc(100% - var(--menu-width));
    --animate-duration: 0.5s;
}

/* general */

html {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-size: 18px;
    background-color: var(--background-main);
    font-family: 'Dosis', sans-serif;
    color: var(--text-color);
}

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

#wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    flex-direction: column;
    overflow: hidden;
}

#overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #000000;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

#overlay.active {
    opacity: 0.7;
    transition: opacity 0.4s ease;
    z-index: 200;
}

#overlay.full {
    z-index: 999 !important;
}

h1, h2, h3, h4, h5 {
    margin: 0;
    margin-bottom: 20px;
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    letter-spacing: 2px;
}

/* toast */
#toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    align-items: center;
}

.toast-dialog {
    width: fit-content;
    padding: 0.75rem 1rem;
    color: #fff;
    background-color: #333;
    border-radius: 8px;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-dialog.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-dialog:hover {
    opacity: 1;
    outline: 1px solid var(--border-color-alt);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.toast-icon i {
    font-size: 1.3rem;
    margin-right: 0.5rem;
    padding: 0;
    line-height: 1;
}

.toast-message {
    flex: 1;
    line-height: 1;
    display: inline-flex;
    justify-content: center;
    align-content: center;
    flex-direction: column;
}

.toast-id {
    font-size: 0.9rem;
    display: block;
    flex: 2;
    margin-top: 4px;
}

.toast-dialog.success { background-color: #28a745; }
.toast-dialog.error { background-color: #dc3545; }
.toast-dialog.info { background-color: #17a2b8; }

/* dialog */

#dialog {
    position: absolute;
    width: 400px;
    height: 400px;
    z-index: 1000;
    align-self: center;
    top: 20%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: none;
}

#dialog-header {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-alt);
    padding: 4px;
}

#dialog-header h4 {
    margin: 0;
}

#dialog-close {
    position: absolute;
    display: none;
    margin-left: auto;
    order: 2;
    top: 0px;
    right: 5px;
    font-size: 20px;
    cursor: pointer;
}

#dialog-close:hover {
    color: var(--secondary-color);
}

#dialog-content {
    padding: 8px;
}

/* login */

#login-dialog {
    width: 40%;
    height: 360px;
    margin: 30px auto;
    background-color: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

#login-dialog h1 {
    margin-bottom: 55px;
}

a.login-button {
    margin: auto;
    width: 60%;
    height: 45px;
    border-radius: 45px;
    border: 1px solid var(--border-color-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-transform: uppercase;
    text-decoration: none;
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

a.login-button:hover {
    background-color: rgb(0, 0, 0, 0.7) !important;
}

.login-button i {
    width: 35px;
    margin-right: 5px;
    vertical-align: middle;
    display: inline-block;
}

.login-button.twitch {
    background-color: #8956fb;
    color: var(--text-color-light);
}

/* logo */
.logo-img {
    cursor: pointer;
}

.logo {
    height: 100%;
    display: flex;
    align-items: center;
}

.logo img:first-child {
    height: 80%;
    width: auto;
}

.logo img:last-child {
    height: 50%;
    width: auto;
}

.menu-logo {
    height: var(--top-height);
    width: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.menu-logo img:first-child {
    height: 80%;
    width: auto;
}

.menu-logo img:last-child {
    height: 50%;
    width: auto;
}

.login-logo {
    height: auto;
    width: 30%;
    display: flex;
    align-items: center;
    margin: 0 auto;
    margin-top: 20px;
}

.login-logo img:first-child {
    width: 20%;
    height: auto;
}

.login-logo img:last-child {
    width: 80%;
    height: auto;
}

/* top */

#top-bar {
    width: 100%;
    height: var(--top-height);
    position: absolute;
    padding: 0 14px;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#menu-burger {
    flex: 1;
    display: none;
}

#menu-burger-button {
    color: var(--text-color);
    cursor: pointer;
}

#top-bar .user-menu {
    order: 99;
    margin-left: auto;
    flex: 1;
    text-align: right;
    line-height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

.avatar {
    border-radius: 50%;
    max-width: 50px;
    height: auto;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.avatar:hover {
    opacity: 0.7;
}

#user-menu {
    width: 250px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-alt);
    position: absolute;
    right: 14px;
    top: calc(var(--top-height) - 1.5%);
    overflow: hidden;
    margin: 0;
    display: none;
    z-index: 250;
}

#user-menu.active {
    display: block;
}

#user-menu hr {
    border: 0;
    border-top: 1px solid var(--border-color);
}

#user-menu a {
    width: 90%;
    height: 35px;
    display: block;
    color: var(--text-color);
    margin: 6px auto;
    padding: 8px;
    border-radius: 8px;
    text-align: left;
    line-height: 17px;
    text-decoration: none;
}

#user-menu a i {
    width: 30px;
    margin-right: 4px;
}

#user-menu a:hover {
    background-color: var(--primary-accent);
    color: var(--text-color-dark);
}

/* menu */

#menu {
    width: var(--menu-width);
    height: var(--content-height);
    top: var(--top-height);
    background-color: var(--background-alt);
    z-index: 250;
    position: absolute;
    transition: left 0.4s ease;
}

#menu.active {
    left: 0;
}

#menu-wrapper {
    overflow-y: auto;
    height: var(--menu-height);
    padding: 6px;
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

nav ul li {
    margin: 0;
    display: block;
    width: 100%;
    height: 45px;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    line-height: 25px;
    transition: background-color 0.2s;
}

nav ul li:hover a {
    color: var(--text-color-dark);
}

nav ul li:hover li {
    color: var(--text-color-dark);
}

nav ul li:focus {
    outline: 0;
}

nav ul li:hover i:not(:first-child) {
    color: var(--secondary-color);
}

nav ul li i.sub-caret {
    float: right;
    font-size: 12px;
    line-height: 25px;
    transition: rotate 0.2s;
}

nav a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--text-color);
}

nav li:has(a):hover {
    background-color: var(--primary-accent);
}

nav i:first-child {
    width: 30px;
    margin-right: 4px;
}

nav li.active {
    background-color: var(--primary-color);
}

nav li.opened .sub-caret {
    rotate: 180deg;
}

nav li.active a {
    color: #f1f1f1;
}

nav .menu-child {
    display: none;
}

nav .menu-child li {
    padding-left: 42px;
}

#menu-footer {
    height: var(--menu-footer-height);
    border-top: 2px solid var(--border-color);
    width: 100%;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

#menu-footer nav a  i:not(:first-child) {
    vertical-align: super;
    font-size: 12px;
    margin-left: 4px;
}

.menu-footer-socials {
    width: 100%;
    justify-content: center;
    align-items: center;
    display: flex;
    margin-top: auto;
    flex-grow: 1;
}

.menu-footer-socials a {
    color: var(--text-color);
}

.menu-footer-socials a:hover {
    color: var(--secondary-color);
}

/* content */

#content {
    width: var(--content-width);
    height: var(--content-height);
    top: var(--top-height);
    left: var(--menu-width);
    overflow: auto;
    position: relative;
    z-index: 100;
    padding: 18px;
    display: flex;
}

/* scrollbar */

::-webkit-scrollbar {
    background: #010101;
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: #f1f1f1;
}

::-webkit-scrollbar-button {
    display: none;
}

/* media queries */
/* general */
@media only screen and (min-height: 950px) and (max-height: 1367px) {
    :root {
        --menu-footer-height: 15% !important; 
    }
}
@media only screen and (max-width: 1300px) {
    :root {
        --top-height: 8vh;
        --content-height: 92vh;
        --menu-footer-height: 22%;
        --menu-height: calc(var(--content-height) - var(--menu-footer-height));
        --menu-width: 50%;
        --content-width: calc(100% - var(--menu-width));
    }

    #login-dialog {
        width: 80%;
    }

    .login-logo {
        width: 80%;
        height: auto;
        margin-top: 30px;
    }

    .login-button {
        width: 75%;
    }

    .logo img:first-child {
        height: 50%;
        width: auto;
    }

    .logo img:last-child {
        width: auto;
        height: 40%;
    }

    #menu-burger {
        display: block;
    }

    #user-menu {
        width: 200px;
        top: 58px;
        right: 0;
    }
    
    #menu {
        height: 100%;
        width: var(--menu-width);
        top: 0;
        left: -100%;
    }

    .menu-logo {
        display: flex;
        flex-direction: column;
    }

    .menu-logo img:first-child {
        height: 55%;
    }

    .menu-logo img:last-child {
        height: 30%;
    }

    .avatar {
        max-width: 40px;
    }

    #content {
        width: 100%;
        left: 0;
        padding: 14px;
    }
}

/* landscape mode */
@media only screen and (max-width: 1300px) and (orientation: landscape) {
    :root {
        --top-height: 20vh;
        --content-height: 80vh;
        --menu-footer-height: 35%;
        --menu-height: calc(100% - var(--menu-footer-height));
        --menu-width: 45%;
    }

    .login-logo {
        width: 60%;
        height: auto;
        margin-top: 20px;
    }

    #login-dialog {
        width: 60%;
        max-height: 80%;
        margin: 25px auto;
        padding: 8px;
    }

    #login-dialog h1 {
        margin-bottom: 20px;
    }

    .logo {
        font-size: 10vh !important;
    }

    #menu-burger-button {
        font-size: 3vw;
    }

    .avatar {
        max-width: 65px;
    }

    .menu-logo {
        display: none;
    }
}

/* very small, landscape */
@media only screen and (min-width: 320px) and (max-width: 374px) {
    :root {
        --top-height: 25%;
        --content-height: calc(100% - var(--top-height));
        --menu-footer-height: 20%;
        --menu-height: calc(100% - var(--menu-footer-height));
        --menu-width: 55%;
    }

    .menu-logo {
        display: none;
    }
}