:root {
    --background: #05050f;
    --background2: #0a0a1e;
    --background3: #1b1a32;
    --foreground: #e1ffff;
    --accent: #80a4ff;

    font-family: sans-serif;
    color: var(--foreground);
    font-size: 16px;
    color-scheme: only dark;
    accent-color: var(--accent);
}

* {
    margin: 0;
}

body {
    display: flex;
    justify-content: center;
    background-color: var(--background);
}

a {
    display: contents;
    color: inherit;
    text-decoration: none;
}
a[href]:hover * {
    text-decoration: underline;
}
a.no_underline:hover * {
    text-decoration: none;
}

input[type="text"] {
    font-size: 1rem;
    background-color: var(--background3);
    border-style: none;
    outline: none;
    height: 32px;
    padding: 0 8px 0 8px;
    border-radius: 4px;
    color: inherit;
}

header {
    display: flex;
    height: 48px;
    background-color: var(--background2);
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 0 4px black;
    position: fixed;
    width: 100%;
    box-sizing: border-box;
    z-index: 911;
}

main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 48px;
    width: 100%;
    max-width: 900px;
}

hr {
    margin: 8px 5px;
    border-color: var(--accent);
}

.a_button,
button {
    display: inline-block;
    background-color: var(--background3);
    border: none;
    padding: 8px 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: fit-content;
    color: inherit;
}

select {
    background-color: var(--background3);
    border-style: none;
    padding: 4px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    color: inherit;
}

input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 20px;
    height: 20px;
    background-color: var(--background3);
    border-radius: 4px;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: var(--accent);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 8px;
    top: 3px;
    left: 6px;
    border-width: 0 4px 4px 0;
    border-color: var(--foreground);
    border-style: solid;
    border-radius: 2px;
    z-index: 2;
    transform: rotate(45deg);
}

input[type="number"] {
    background-color: var(--background3);
    border-style: none;
    padding: 4px;
    border-radius: 4px;
    font-size: 1rem;
    color: inherit;
}

.logo {
    fill: var(--accent);
}

#header_logo {
    width: 2rem;
    height: 2rem;
}

#header_buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

#name {
    font-weight: 512;
    padding-left: 4px;
}

#comment_sort_form {
    display: flex;
    justify-content: end;
    gap: 4px;
}

.icon {
    display: inline;
    width: 16px;
    height: 16px;
    fill: var(--accent);
    vertical-align: sub;
}

.icon_button {
    padding: 4px;
    border-radius: 4px;
    min-height: 32px;
    min-width: 32px;
}

.icon_button.icon {
    vertical-align: middle;
}

.card {
    padding: 8px;
    border-radius: 8px;
    background-color: var(--background2);
}

.post_text a,
.comment_text a {
    display: inline;
    color: var(--accent);
    text-decoration: underline;
}

.post {
    display: flex;
    flex-direction: column;
    background-color: var(--background2);
    border-radius: 8px;
    max-width: 100%;
    gap: 8px;
    padding: 8px 0px 8px 0px;
    position: relative;
    overflow: hidden;
}
.post_header {
    display: flex;
    margin: 0px 8px 0 8px;
}
.post_name {
    display: flex;
    gap: 4px;
    align-items: center;
}
.badges {
    display: inline-block;
    background-color: var(--accent);
    color: var(--background);
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.85rem;
    font-weight: 500;
}
.post_profile_picture {
    width: 40px;
    height: 40px;
    border-radius: 100%;
    margin-right: 4px;
    user-select: none;
}
.post_title {
    font-weight: 450;
}
.profile_name {
    font-weight: bold;
}
.profile_checkmark {
    margin-left: 4px;
}
.post_time {
    font-size: 0.8rem;
    font-weight: 450;
}
.post_text {
    white-space: pre-wrap;
    margin: 0 8px 0 8px;
}
.post_feedback {
    display: flex;
    position: relative;
    align-items: center;
    margin: 0 8px 0 8px;
}
.post_feedback span {
    padding-left: 4px;
    margin-right: 8px;
}
.post_link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.post > *:not(.post_link) {
    z-index: 2;
}
.post * {
    pointer-events: auto;
}
.post > div,
.post > .post_header > div,
.post > .post_header > div > div {
    pointer-events: none;
}
.post_attachment {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.post_attachment > * {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: calc(33.3333% - 4px);
}
.post_attachment > :nth-child(1):nth-last-child(3n+1) {
    flex-basis: 100%;
}
.post_attachment > :nth-child(1):nth-last-child(3n+2),
.post_attachment > :nth-child(2):nth-last-child(3n+1) {
    flex-basis: calc(50% - 4px);
}
.post_attachment > .post {
    background-color: var(--background);
    margin: 0 4px 0 4px;
}
.post_attachment > *,
.post_attachment > a > * {
    width: 100%;
}
.post_attachment > a {
    display: flex;
}
.post_attachment img {
    object-fit: contain;
    background-color: black;
}
.attachments_left {
    display: block;
    align-content: center;
    text-align: center;
    font-size: 2rem;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.25);
}
.post_attachment > .url {
    margin: 0 8px 0 8px;
}

.comment {
    display: flex;
    gap: 4px;
    background-color: var(--background2);
    padding: 8px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-left: calc(32px * var(--depth, 0));
}
.comment_profile_picture {
    width: 32px;
    height: 32px;
    border-radius: 100%;
    user-select: none;
}
.comment_link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.comment > *:not(.comment_link),
.comment > a > img {
    z-index: 2;
}
.comment_body {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}
.comment * {
    pointer-events: auto;
}
.comment_body,
.comment_body > div {
    pointer-events: none;
}
.comment_attachment {
    display: flex;
    flex-wrap: wrap;
    width: 50%;
    gap: 4px;
}
.comment_attachment > *,
.comment_attachment > a > * {
    width: 100%;
}
.comment_footer {
    display: flex;
    justify-content: space-between;
}
.comment_time {
    font-size: 0.8rem;
    font-weight: 450;
}
.comment_feedback {
    position: relative;
    display: flex;
    align-items: center;
}
.comment_feedback span {
    padding-left: 4px;
    margin-right: 8px;
}
.comment_feedback > :last-child {
    margin-right: 0;
}

#whole_screen {
    display: flex;
    max-width: 100%;
    height: calc(100vh - 48px);
    margin: 0 10% 0 10%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.search_bar {
    display: flex;
    width: 100%;
    gap: 4px;
}

.search_bar > input {
    width: 100%;
}

.centered {
    text-align: center;
}

.reactions_popup {
    display: flex;
    position: absolute;
    top: -2rem;
    left: 0;
    background-color: var(--background3);
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 1px 1px 4px black;
    transition: 0s;
    visibility: hidden;
}

.comment_feedback > .reactions_popup {
    left: unset;
    right: 0;
    top: calc(-1rem - 16px);
}

.reactions:hover + .reactions_popup {
    visibility: visible;
    transition-delay: 250ms;
}

.reactions_popup:hover {
    visibility: visible;
}

.reactions {
    display: contents;
    cursor: help;
}

.read_more,
.read_more:checked + span,
.read_more:checked + span + label,
.read_more:not(:checked) + span + label + span {
    display: none;
}
.read_more + span + label {
    cursor: pointer;
    font-weight: bold;
    user-select: none;
}

.comment_section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

#navigation_buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.scrollable_text {
    overflow-x: auto;
    width: 100%;
}

.media_container {
    display: flex;
    position: relative;
    height: 100%;
    align-items: center;
    background-color: black;
}
.media_container * {
    width: 100%;
}
.media_container .icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25%;
    height: 25%;
}

.message_card {
    background-color: var(--background);
    border-radius: 8px;
    padding: 8px;
    margin: 0 4px 0 4px;
    text-align: center;
}

.event {
    background-color: var(--background);
    border-radius: 8px;
    padding: 8px;
    margin: 0 4px 0 4px;
    text-align: center;
}

.poll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--background);
    border-radius: 8px;
    padding: 8px;
    margin: 0 4px 0 4px;
}
.poll_item {
    display: flex;
    background-color: var(--background3);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.poll_item_layer1 {
    z-index: 1;
    color: var(--background3);
}
.poll_item_layer2 {
    z-index: 2;
    position: absolute;
    clip-path: inset(0 0 0 var(--persent, 0));
    pointer-events: none;
}
.poll_item_layer1,
.poll_item_layer2 {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 4px;
    box-sizing: border-box;
}
.poll_item_bg {
    position: absolute;
    height: 100%;
    width: var(--persent, 0);
    background-color: var(--accent);
    top: 0;
    left: 0;
}
