@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@400&display=swap');

html {
    --logo-size: 48px;
    --box-border-radius: .2em;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --box-shadow: 0 8px 32px 0 var(--shadow-color);
}

html {
    --bg-color: white;
    --bars-bg-color: #bbb;
    --font-color: black;
    --header-bg-color: white;
    --header-font-color: black;
    --summary-bg-color: #aaa;
    --summary-font-color: black;
    --content-bg-color: #ddd;
    --content-font-color: black;
    --example-bg-color: #fed;
    --example-keyword-color: blue;
    --link-font-color: blue;
    --about-font-color: #888;
    --message-box-bg-color: lightblue;
    --message-box-font-color: black;
    --small-logo: url('/static/darkicon.png');
    --big-logo: url('/static/darkhand.png');
}

@media (prefers-color-scheme: dark) {

    :root:not([user-scheme]),
    html[user-scheme="dark"] {
        --bg-color: #272822;
        --bars-bg-color: #333432;
        --font-color: #F8F8F2;
        --header-bg-color: black;
        --header-font-color: white;
        --summary-bg-color: 444;
        --summary-font-color: white;
        --content-bg-color: #222;
        --content-font-color: white;
        --example-bg-color: #343434;
        --example-keyword-color: lightblue;
        --link-font-color: #0ad;
        --about-font-color: #4e5044;
        --message-box-bg-color: darkblue;
        --message-box-font-color: white;
        --small-logo: url('/static/lighticon.png');
        --big-logo: url('/static/lighthand.png');
    }
}

/* ------------------------------------------------------------ */

html {
    margin: 0;
    padding: 0;
    height: 100%;
    color: var(--font-color);
    background-color: var(--bg-color);
    font-family: 'Inter', 'Open+Sans', Helvetica, Arial, sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1 {
    padding: .12em 1em;
}

a {
    color: var(--link-font-color);
}

footer {
    display: block;
    position: relative;
    text-align: center;
    width: 100%;
    font-size: .8em;
    background-color: var(--bars-bg-color);

    nav {
        display: inline;
        list-style-type: none;

        h2 {
            font-size: 1.2em;
        }

        a {
            text-decoration: none;
        }

        div {
            display: table-cell;
            padding: .5em 4vw;
            text-align: start;
        }
    }
}

.hidden {
    display: none !important;
}

.center {
    margin: auto;
    width: 86vw;
}

.center-table {
    margin: auto;
    width: 86vw;

    td {
        min-width: 20vw;
        overflow-wrap: break-word;
    }
}

.center-content {
    text-align: center;

    img {
        max-height: 60vh;
        max-width: 96vw;
        padding: 4vh;
    }
}

ul#devices {
    width: 46vw;
    list-style-type: none;

    li {
        table {
            width: 100%;
            background-color: var(--bars-bg-color);
            padding: 1em;
            border-radius: 1em;
            margin: 1em;
        }

        td {
            width: 20%;
        }

        td:nth-child(1) {
            width: 0;
            padding: 0 2em;
        }
    }
}

ul#terminal {
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
    font-family: "Kode Mono", monospace;
    color: lightgreen;
    list-style-type: none;
    padding: 2em;
    overflow: hidden;
    overflow-y: scroll;
    scrollbar-color: #222 black;

    li {
        padding: .2em;
        margin: .2em;

        span {
            border-radius: .4em;
            padding: .2em;
            margin: .2em;
        }
    }

    .recdtext {
        text-align: left;

        span {
            background-color: #020;
        }
    }

    .senttext {
        text-align: right;

        span {
            background-color: #004;
        }
    }
}

.chunkotext {
    padding: 0 12%;
    line-height: 1.8em;
    margin: auto;
}

.left-panel {
    position: fixed;
    left: 4vw;
    width: 42vw;
}

.gallery {
    vertical-align: top;
    min-width: 480px;
}

.article-gallery {
    grid-column-start: 3;
    grid-column-end: 3;
    max-height: 50vh;
    object-fit: contain;
    display: grid;
    /* the gallery is itelf a grid */
    grid-template-columns: auto auto auto;
    text-align: center;
    align-items: center;
    font-size: 4em;
    font-weight: 800;
    color: var(--text-color);
}

.article-gallery-image {
    grid-column-start: 2;
    grid-column-end: 2;
}

.article-gallery-image>img {
    object-fit: cover;
    width: 100%;
}

.article-gallery-thumbnails {
    grid-column-start: 1;
    grid-column-end: 3;
}

.article-details {
    grid-column-start: 2;
    grid-column-end: 4;
}

table.specs {
    border-style: hidden;
}

table.specs tr {
    min-height: 1em;
}

table.specs td:nth-child(1) {
    vertical-align: top;
    text-align: end;
    padding: .4em 2em;
    min-width: unset;
    /*border: 1px solid var(--border-color);*/
}

table.specs tr.header-row {
    background-color: var(--header-background);
    color: var(--header-color);
}

table.faq td:nth-child(1) {
    vertical-align: top;
    text-align: end;
    padding: 0 2em;
    padding: .2em 2em;
    min-width: unset;
}

textarea,
input {
    font-size: 1em;
}

.label {
    text-align: end;
    padding: 2em;
}

.product {
    text-align: left;
    padding: 2em;
}

.about {
    position: fixed;
    display: block;
    bottom: .5em;
    right: .5em;
    padding: 1em;
    color: var(--about-font-color);
    cursor: default;
}

.version {
    color: var(--font-color);
}

/* message box */
.messagebox {
    position: fixed;
    top: 30vh;
    height: 10vh;
    left: 30vw;
    width: 30vw;
    z-index: 255;
    background-color: var(--message-box-bg-color);
    color: var(--message-box-font-color);
    padding: 10vmin;
    border-radius: 1em;
    filter: none;
}

.messagebox-btns {
    position: absolute;
    bottom: 2em;
    right: 2em;
}

.messagebox-btn {
    width: 8em;
    height: 3em;
}

/* login box */
.loginbox,
.profilebox {
    position: fixed;
    background: white;
    border-radius: 1em;
    padding: 2.5em 2em 2em 2em;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    z-index: 1000;
}

#loginBox-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    width: 100%;
}

.loginbox-btns {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1em;
    position: static;
    margin-top: 1em;
}

.loginbox-btn {
    width: 7em;
    height: 2.5em;
    font-size: 1em;
    border-radius: 0.5em;
    border: none;
    background: #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.loginbox-btn:hover {
    background: #e0e0e0;
}

#loginBox-text {
    text-align: center;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 0.2em;
}

.box-close {
    position: absolute;
    top: var(--box-border-radius);
    right: var(--box-border-radius);
    background: transparent;
    border: none;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.box-close:hover {
    color: #333;
}

#login-overlay {
    /* TODO: remove and merge with .overlay-container */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-container {
    position: absolute;
    display: flex;
    padding: 2.5em 2em 2em 2em;
    margin: 1rem;
    flex-direction: column;
    z-index: 100;
    background-color: var(--bars-bg-color);
    border: 0.12em solid #808080;
    border-radius: .4rem;
    pointer-events: all;
    box-shadow: var(--box-shadow);
}

.centered-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 0);
    min-width: 320px;
}

.centered {
    /* this is used for divs.  there's `center` for text*/
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.login-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-button:hover {
    background: #f5f5f5;
}

.login-button img {
    width: 24px;
    height: 24px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.removed {
    display: none;
}