/*
 * User: efebagri
 * Date/Time: 9/1/23, 1:37 AM
 * File: layout.css
 *
 * Modified: 9/1/23, 1:25 AM
 *
 * Copyright (c) 2023 Exbil Bilgisayar (https://www.exbil.net)
 *    All rights Reserved.
 */

:root {
    --font-size: 12px;
    --line-height: 15px;
    --font-family: monospace;
    --box-padding: 12px 20px;
    --box-padding-top: 12px;

    --bg: #2b2b2b;
    --fg: #ffffff;
    --gutter-fg: #787878;
    --gutter-active: #ffd557;
    --panel-bg: #515658;
    --panel-hover: #2d2f30;
    --collapse-bg: gray;
    --track: #24292e;
    --thumb: #888;
    --thumb-hover: #555;
    --line-highlight: rgba(255, 221, 87, 0.16);
    --counter-bg: rgba(0, 0, 0, 0.55);
}

html.light {
    --bg: #f5f5f5;
    --fg: #1b1b1b;
    --gutter-fg: #9aa0a6;
    --gutter-active: #b58900;
    --panel-bg: #d7dade;
    --panel-hover: #b3b8bd;
    --collapse-bg: #b0b0b0;
    --track: #e4e4e4;
    --thumb: #bbb;
    --thumb-hover: #999;
    --line-highlight: rgba(255, 213, 0, 0.38);
    --counter-bg: rgba(255, 255, 255, 0.85);
}

body {
    background-color: var(--bg);
}

textarea {
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--font-family);
    color: var(--fg);
    background: 0 0;
    border: 0;
    padding: var(--box-padding);
    width: 100%;
    height: 99vh;
    outline: none;
    resize: none;
}

#codeBox {
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--font-family);
    background: 0 0 !important;
    color: var(--fg);
    margin: 0;
    padding: var(--box-padding);
    width: 100%;
    min-height: 100vh;
    display: flex;
    position: relative;
}

.codeLines {
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--font-family);
    text-align: right;
    left: 0;
    color: var(--gutter-fg);
    width: 2%;
    min-width: 32px;
    padding-right: 30px;
    user-select: none;
    z-index: 1;
}

.codeLines .ln {
    cursor: pointer;
}

.codeLines .ln:hover {
    color: var(--fg);
}

.codeLines .ln.active {
    color: var(--gutter-active);
    font-weight: bold;
}

#codeBox > code {
    z-index: 1;
}

/* Line highlighting */

.line-highlights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.line-highlight-band {
    position: absolute;
    left: 0;
    right: 0;
    height: var(--line-height);
    background-color: var(--line-highlight);
}

/* Char counter */

.char-counter {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 5;
    font-family: var(--font-family);
    font-size: 12px;
    color: var(--fg);
    background-color: var(--counter-bg);
    padding: 4px 9px;
    border-radius: 4px;
    user-select: none;
}

.char-counter.warn {
    color: #ffb300;
}

.char-counter.over {
    color: #ef5350;
    font-weight: bold;
}

/* Side panel */

.side-panel {
    background-color: var(--panel-bg);
    bottom: 0;
    right: 0;
    position: fixed;
    padding: 8px;
    z-index: 6;
    -webkit-animation-name: "slide-in";
    -moz-animation-name: "slide-in";
    -o-animation-name: "slide-in";
    animation-name: "slide-in";
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
}

.collapse-button {
    margin: -8px -8px 8px;
    height: 10px;
    background-color: var(--collapse-bg);
    cursor: pointer;
}

.buttons {
    display: inline-grid;
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.collapsed {
    -webkit-animation-name: "slide-out";
    -moz-animation-name: "slide-out";
    -o-animation-name: "slide-out";
    animation-name: "slide-out";
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
}

@keyframes slide-in {
    from {
        -webkit-transform: translateY(95%);
        -ms-transform: translateY(95%);
        transform: translateY(95%);
    }
}

@keyframes slide-out {
    to {
        -webkit-transform: translateY(95%);
        -ms-transform: translateY(95%);
        transform: translateY(95%);
    }
}

.buttons > p {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
}

.invisible {
    display: none !important;
}

i.material-icons {
    font-size: 2.5rem;
    color: var(--fg);
    cursor: pointer;
}

i.material-icons:hover {
    color: var(--panel-hover);
}

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

/* Burn after read overlay */

.burn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
}

.burn-box {
    text-align: center;
    color: var(--fg);
    font-family: var(--font-family);
    max-width: 420px;
    padding: 24px;
}

.burn-box i.material-icons {
    font-size: 4rem;
    color: #ef5350;
    cursor: default;
}

.burn-box i.material-icons:hover {
    color: #ef5350;
}

.burn-box h4 {
    margin: 8px 0;
}

/* TextBar */

.textBar {
    display: flex;
    visibility: hidden;
    text-align: center;
    background-color: black;
    color: white;
    font-family: var(--font-family);
    border-radius: 5px;
    padding: 0.4% 0.5% 0.4% 0.9%;
    position: fixed;
    bottom: 5%;
    left: 5%;
    z-index: 7;
}

.textBar > i.material-icons {
    height: 20%;
    right: 0;
    top: 0;
    font-size: 0.9rem;
    color: white;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.textBar > i.material-icons:hover {
    color: #bbbbbb;
}

.textBar.show {
    visibility: visible;
    animation: fadeIn 0.5s;
    -webkit-animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {bottom: 0}
    to {bottom: 5%}
}

@-webkit-keyframes fadeIn {
    from {bottom: 0}
    to {bottom: 5%}
}

/* Materialize / settings modal */

.input-field input:focus + label {
    color: #9e9e9e !important;
}

.input-field input:focus {
    border-bottom: 1px solid #9e9e9e !important;
    box-shadow: 0 1px 0 0 #9e9e9e !important
}

input {
    color: #e0e0e0 !important;
}

.settings-field {
    margin: 18px 0;
}

.settings-field > label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #e0e0e0;
}

.settings-field select.browser-default {
    width: 100%;
    padding: 8px;
    background-color: #515658;
    color: #ffffff;
    border: 1px solid #6e6e6e;
    border-radius: 4px;
}

/* Markdown view */

.markdown-body {
    color: var(--fg);
    background: var(--bg);
    padding: 24px 6%;
    min-height: 100vh;
    box-sizing: border-box;
    line-height: 1.6;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    border-bottom: 1px solid var(--gutter-fg);
    padding-bottom: 0.2em;
}

.markdown-body a {
    color: #4a9eff;
}

.markdown-body pre,
.markdown-body code {
    font-family: var(--font-family);
    background: var(--track);
    border-radius: 4px;
}

.markdown-body code {
    padding: 2px 5px;
}

.markdown-body pre {
    padding: 12px;
    overflow-x: auto;
}

.markdown-body pre code {
    padding: 0;
    background: none;
}

.markdown-body blockquote {
    border-left: 3px solid var(--gutter-fg);
    margin-left: 0;
    padding-left: 14px;
    color: var(--gutter-fg);
}

.markdown-body table {
    border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--gutter-fg);
    padding: 6px 12px;
}

.markdown-body img {
    max-width: 100%;
}

/* QR code */

.qr-code {
    display: flex;
    justify-content: center;
    padding: 12px 0;
}

.qr-code img,
.qr-code canvas {
    background: #ffffff;
    padding: 10px;
    border-radius: 6px;
}

/* width */
::-webkit-scrollbar {
    width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background: var(--track);
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: var(--thumb);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: var(--thumb-hover);
}
