:root {
	--color-dark: rgb(10, 10, 18);
	--color-semidark: rgb(34, 36, 44);
	--color-grey: rgb(59, 55, 59);
	--color-light: #fafaff;
	--color-semilight: #959596;
    --color-blue: #3498db;
    --color-purple: #cb89f6;
    --color-green: #2ecc71;
    --color-error: #e74c3c;
}

* {
	box-sizing: inherit;
}

html {
	font-family: system-ui, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.1rem;
	height: 100%;
	box-sizing: border-box;
}

body {
    margin: 0;
    height: 100%;
    min-height: 100vh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	background: var(--color-dark);
	color: var(--color-light);
	padding: 0px;
	font-feature-settings: "liga" 0;
	font-weight: 300;
}

a, summary {
	color: var(--color-blue);
    text-decoration: none;
    cursor: pointer;
}

img {
    display: none;
}
img[src] {
    display: block;
}

h2 {
    margin-left: 0.5rem;
}

p, ul {
    margin-left: 1rem;
}

a:visited {
	color: var(--color-purple);
}
a:hover, summary:hover {
    text-decoration: underline;
}

hr {
   border: 1px solid var(--color-grey);
}

header {
    border-bottom: 4px solid var(--color-semidark);
    .menu-item {
        padding: 0.5em 1em;
        margin: 0;
        font-size: 1.3em;
        display: inline-block;
        img {
            height: 1.3em;
            float: left;
            margin-right: 0.2em;
        }
    }
    a:visited {
        color: var(--color-blue);
    }
    a.active {
        text-decoration: underline;
    }
}

main {
    padding: 0 1em;
    margin-bottom: 1em;
}

footer {
    border-top: 4px solid var(--color-semidark);
    padding: 1em;
    a {
        padding: 1em 0;
    }
}

input, textarea {
    font-size: 1em;
    background: var(--color-semidark);
    color: var(--color-light);
    padding: 0.4em;
    margin-bottom: 0.4em;
    border: 2px solid var(--color-grey);
    border-radius: 0.4em;
}

input[type=submit], button {
    font-size: 1em;
    background: var(--color-semidark);
    color: var(--color-blue);
    border: 2px solid var(--color-blue);
    border-radius: 0.2em;
    padding: 0.4em 0.8em;
	font-weight: 600;
}

textarea {
    min-height: 5em;
}

textarea:focus, input:focus{
    outline: none;
}


code {
    background-color: var(--color-grey);
    padding: 0 0.2em;
}

kbd {
    background-color: var(--color-grey);
    border: 1px solid var(--color-semilight);
    border-radius: 0.3em;
    padding: 0.3em 0.7em;
    margin: 0 0.2em;
    font-family: monospace;
    font-size: 0.85em;
    white-space: nowrap;
    box-shadow: 0 2px 0 var(--color-semidark);
}

table {
    border-collapse: collapse;
    width: 100%;
    td, th {
        padding: 0.5em;
        border: 1px solid var(--color-grey);
        text-align: center;
    }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.container {
    max-width: 70em;
    width: 100%;
    margin: auto;
    margin-top: 1em;
    padding: 1em 2em;
    background-color: var(--color-semidark);
    border: 1px solid var(--color-grey);
    border-radius: 0.4em;
}

.box {
    border: 1px solid var(--color-light);
    padding: 0.5em;
    .header {
        font-weight: bold;
        font-size: 1.4em;
    }
}

.success {
    border-color: var(--color-green);
    color: var(--color-green);
}

.bordered {
    border: 1px solid var(--color-grey);
    border-radius: 0.4em;
}
.padded {
    padding: 1em;
}

.full-width {
    width: 100%;
}

.title {
    img {
        margin: 0 auto;
        max-width: 15em;
    }
}

.search {
    position: relative;
    margin-top: 1em;
    height: 5em;
    input {
        position: absolute;
        top: 0;
        left: 10%;
        width: 80%;
        font-size: 2em;
    }
    #search {
        z-index: 2;
        background-color: transparent;
    }
    #autocomplete {
        z-index: 1;
        color: var(--color-semilight);
    }
}

.hotkeys-button {
    position: fixed;
    bottom: 2em;
    right: 2em;
    width: 3em;
    height: 3em;
    border-radius: 50%;
    background: var(--color-semidark);
    border: 2px solid var(--color-grey);
    color: var(--color-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    svg {
        width: 1.5em;
        height: 1.5em;
    }
    &:hover {
        background: var(--color-grey);
        border-color: var(--color-blue);
        transform: scale(1.1);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    }
}

.hotkey-toggle-section {
    border-top: 2px solid var(--color-grey);
    text-align: center;
    p {
        color: var(--color-semilight);
        font-size: 0.9em;
    }
    .hotkey-toggle-btn {
        transition: all 0.2s ease;
        &:hover {
            background: var(--color-blue);
            color: var(--color-light);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        }
        &:active {
            transform: translateY(0);
        }
    }
}

.result {
    padding: 0.5em;
    margin-top: 0.5em;
    .result-title {
        margin-bottom: 0.2em;
        a {
            font-size: 1.4em;
        }
        img[src] {
            height: 1.6em;
            width: 1.6em;
            margin: 0;
            margin-right: 0.5em;
            display: inline-block;
        }
    }
    .result-url, .readable, .added {
        display: inline-block;
        overflow: hidden;
        height: 1.2em;
        line-height: 1.2em;
        font-size: 0.8em;
        max-width: 100%;
        margin: 0;
        word-break: break-all;
    }
    .result-url, .added {
        color: var(--color-semilight);
    }
    .action-button {
        display: inline-block;
        height: 1.2em;
        width: 1.2em;
        line-height: 1.2em;
        vertical-align: top;
        cursor: pointer;
        user-select: none;
    }
    .result-content {
        margin: 0;
        font-size: 0.9em;
        max-width: 50em;
    }
}

.popup-wrapper {
    background: rgba(0, 0, 0, 0.6);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    .popup {
        max-height: 90%;
        z-index: 14;
        margin: 2em auto;
        overflow: auto;
        .popup-content {
            * {
                margin: 1em 0;
            }
            .hotkey {
                max-width: 30em;
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0.2em 0.5em;
                margin: 0 auto;
                border-bottom: 1px solid var(--color-grey);
                span {
                    flex: 1;
                    text-align: right;
                    color: var(--color-light);
                    font-size: 0.95em;
                }
            }
            img, pre, code {
                max-width: 100%;
            }
            pre {
                text-wrap: wrap;
            }
        }
    }
}

.hidden {
    display: none;
}

.float-right {
    float: right;
}

.nowrap {
    white-space: nowrap;
}

.highlight {
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.10), transparent);
    border-left: 3px solid var(--color-blue);
    padding-left: 1em;
}

.error {
    color: var(--color-error);
}

.mt-1 {
    margin-top: 1em;
}

.mv-1 {
    margin-top: 1em;
    margin-bottom: 1em;
}

.text-center {
    text-align: center;
}

.center-align {
    margin-left: auto;
    margin-right: auto;
}

mark {
    font-weight: 600;
    background: transparent;
    color: inherit;
}

@media screen and (width <= 1280px) {
    html {
        font-size: 1.4rem;
    }
    .search {
        input {
            font-size: 1.5em;
            left: 2.5%;
            width: 95%;
        }
    }
    .result {
        .result-title {
            a {
                font-size: 1.2em;
            }
        }
    }
}
