
/* theme */

:root {
    --theme-topbar: #bfb3ff;
}

/* editor */

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

* {
    margin: 0;
    padding: 0;
    border: none;
}

/* dialog styling */

dialog {
    /*position: absolute;*/
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: none;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
}

/* topbar styling */

#topbar {
    height: 50px;
    background-color: var(--theme-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

#heading {
    margin-left: 5px;
    display: flex;
    align-items: center;
    width: fit-content;
}

#heading > h2 {
    width: fit-content;
    align-self: center;
    font-family: monospace;
    font-size: 30px;
}

#file-name {
    width: 100%;
    margin-left: 10px;
    resize: none;
    height: 100%;
    overflow: hidden;
    text-align: left;
    font-size: 1.5rem;
    background-color: transparent;
    outline: none;
    color: #333;
    font-family: monospace;
    font-weight: lighter;
    white-space: nowrap;
}

#file-name::placeholder {
    font-style: italic;
    color: #333;
}

#buttons {
    margin-right: 5px;
    position: relative;
}

#buttons-list > li {
    display: inline-block;
}

#buttons-list > li > button > span, #hamburger > span {
    color: black;
}

#hamburger {
    display: none;
}

.button {
    outline: none;
    background-color: transparent;
    background-repeat: no-repeat;
    border: none;
    position: relative;
}

.tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 0%);
    width: auto;
    height: auto;
    font-family: monospace;
    display: none;
    text-align: center;
    font-size: 1rem;
    color: black;
}

*:has(.tooltip):hover > .tooltip {
    display: block;
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24;
}

.icon {
  width: 30px;
  height: 30px;
  line-height: 30px !important;
}

/* sidebar styling */

#sidebar {
    width: 200px;
    height: 100%;
    background-color: #9f97cc;
    flex-shrink: 0; /* prevent flexbox taking over */
    overflow-y: auto;
    overflow-x: hidden;
}

/* holy cow this sucks */
/* but is the easiest option i found quickly */
.sidebar-minimized > #sidebar {
    display: none;
}

.sidebar-minimized > #edit-options {
    left: 0px;
}

.category {
    width: 100%;
    text-align: left;
    background-color: #8e87b6;
    font-size: 20px;
    font-family: monospace;
    padding-left: 2px;
    cursor: pointer;
    position: relative;
}

.category:has(input) {
    position: sticky;
    top: 0;
    background-color: #837ca8;
    padding-right: 2px;
    z-index: 2;
}

input[type=search] {
    background-color: transparent;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-align: left;
    font-size: 20px;
    font-family: monospace;
    color: #fff;
    outline: none;
}

input[type=search]::placeholder {
    color: #000;
}

input[type=search]::-webkit-search-cancel-button {
    display: none;
}

.category-item {
    user-select: none;
    display: flex;
    height: 100%;
    align-items: center;
    background-color: #9891c2;
    font-weight: bold;
    font-size: 20px;
    font-family: monospace;
}

.category-item > span {
    margin-left: 5px;
}

.category-item:hover {
    background-color: #8f86c5;
}

.category-item > img {
    object-fit: contain; /* make images not stretch */
}

.minimized, .search-hidden {
    display: none;
}

/* chart styling */

#chart {
    background-color: #777196;
    width: 0;
    height: 100%;
    flex-grow: 1;
    touch-action: none;
    user-select: none;
}

/* edit option styling */

#edit-options {
    position: absolute;
    left: 200px;
    top: 50px;
    height: 15px;
    font-size: 15px;
    color: white;
    margin: 10px;
}

#edit-options > div {
    height: 30px;
}

#edit-options > * {
    height: 15px;
    border: none;
}

#edit-options > * > input {
    width: 30px;
    height: 20px;
    margin-left: 5px;
}

#edit-options > * > input[type=checkbox] {
    width: 15px;
    height: 15px;
}

#edit-options > * > button {
    width: 20px;
    height: 20px;
    border-radius: 100%;
}

.hidden > div:not(:has(button)) {
    display: none;
}

#connection-colors {
    display: inline-flex;
    flex-direction: column;
}

#connection-colors > div {
    display: flex;
    flex-direction: row;
    width: auto;
    height: 20px;
    margin: 0;
}

#connection-colors > div > div {
    display: flex;
    width: 20px;
    height: 20px;
    margin: 0;
}

select {
    color: black;
}

#edit-options > div > button {
    color: black;
}

/* miscellaneous */

#content {
    height: calc(100% - 50px);
    display: flex;
}

#summary-notice {
    min-width: 20%;
}

#readonly-warning {
    display: none;
    width: 80%;
}

p {
    display: block;
}

.inline {
    display: inline-block;
}

.spoiler {
    background-color: #000;
    color: #000;
    display: inline-block;
    margin-left: 4px;
}

.spoiler:hover {
    background-color: transparent;
    text-decoration: underline;
}

/* settings */

.keybind {
    min-width: 80px;
    font-family: monospace;
}

/* media conditions */

/*@media screen and (max-width: 980px) {
    #sidebar, #buttons {
        display: none;
    }
    #readonly-warning {
        display: initial !important;
    }
    #edit-options {
        display: none;
    }
}*/

.desktop {
    display: initial;
}

.mobile {
    display: none;
}

@media only screen and (max-width: 980px), only screen and (max-height: 300px) {
    .desktop {
        display: none !important;
    }
    
    .mobile {
        display: initial !important;
    }

    #buttons-list {
        position: absolute;
        right: 0px;
        top: 40px;
        background-color: var(--theme-topbar);
        display: none;
        z-index: 2;
    }
    
    .opened {
        display: block !important;
    }

    .tooltip {
        text-align: right;
        display: block;
        left: unset;
        right: 100%;
        top: 0;
        transform: translate(-5px, 25%);
        text-shadow: #fff 0px 0px 5px;
    }

    #buttons-list > li {
        display: block;
    }

    #hamburger {
        display: inline-block;
    }
    
    dialog {
        width: 100%;
    }

    /*dialog {
        z-index: 3;
        max-width: 100%;
        max-height: 70%;
        overflow-y: scroll;
        overflow-x: hidden;
    }*/
}