@media (prefers-reduced-motion) {
    /* styles to apply if a user's device settings are set to reduced motion */
}

:root {
    --main-bg-color: white;
    --main-hover-color: rgb(64, 64, 64);
    --post-hover-color: rgb(32,32,32);
    --border-color: rgb(132, 136, 138);
    --edge-color: rgb(60, 60, 60);
    --main-fg-color: black;
    --highlight-fg-color: rgb(255, 255, 255);
    --link-color: rgb(29, 155, 240);
}

@media (prefers-color-scheme: dark) {
    :root {
        --main-bg-color: black;
        --main-hover-color: rgb(64, 64, 64);
        --border-color: rgb(132, 136, 138);
        --edge-color: rgb(60, 60, 60);
        --main-fg-color: rgb(202, 208, 211);
        --highlight-fg-color: rgb(255, 255, 255);
        --link-color: rgb(29, 155, 240);
    }
}

/* html, body {
    overscroll-behavior-y: none; 
} */

body {
    font-family: sans-serif;
    color: var(--main-fg-color);
    background-color: var(--main-bg-color);
    margin: 0px;
}

hr {
    border-color: rgb(60, 60, 60);
}

.form_field {
    font-size: medium;
    font-family: sans-serif;
    background-color: var(--edge-color);
    color: var(--main-fg-color);
    width: 100%;
    box-sizing: border-box;
    padding-left: 5px;
    padding-right: 5px;
    border: 1px solid var(--border-color);
    resize: vertical;
    border-radius: 20px;
}

#textarea_post {
    font-size: medium;
    font-family: sans-serif;
    background-color: var(--main-bg-color);
    color: var(--main-fg-color);
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 10px;
    border: 1px solid var(--border-color);
    resize: vertical;
    border-radius: 40px;

    width: 98%;
    margin: 1%;
    height: 270px;

    resize: vertical; 

    max-height: 60vh;
}

.flex-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 0px;
}

.content {
    max-width: 600px;
    flex: 1;
    box-sizing: border-box;
    min-width: 300px;
    padding: 20px;
    box-shadow: 0 0 5px var(--edge-color);
    text-align: left;
    overflow-x: hidden;
    line-height: 1.3;
    z-index: 0;
}

.compose-dimmer-normal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    background-color: black;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;

}

.compose-dimmer-dimmed {
    background-color: black;
    opacity: 0.7;
    visibility: visible;
}

.embed {
    max-width: 800px;
    border-color: red;
    border: 1px, solid;
    padding: 20px;
}

.postImage {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    object-position: left;
}

.post-view .postImage {
    max-height: none;
}

.post-body {
    border-radius: 4px;
    padding: 4px;
    transition: background-color 0.1s;
    cursor: pointer;
}

.post-body:hover {
    background-color: var(--post-hover-color);
}

#log {
    font-family: monospace;
    text-wrap: wrap;
    font-size: 10px;
    margin-bottom: 20px;
    width: 100%;
}

/* .compose-footer {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    width: 100%;
    margin-top: 5px;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box; 
} */

.compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    margin-top: 5px;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box; 
}

.compose-left-buttons,
.compose-right-buttons {
    display: flex;
    gap: 10px; /* Puts exactly 10px of space between buttons in the same group */
    align-items: center;
}

.link {
    user-select: none;
    display:inline-block;
}
.link:hover {
    cursor: pointer;
    color: var(--border-color);
}

a {
    color: var(--link-color);
}

#ddln_logo_button {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    background-image: url("/static/favicon.ico");
    background-repeat: no-repeat;
    background-size: cover;
}

@media (prefers-reduced-motion) {
    #ddln_logo_button {
        width: 32px;
        height: 32px;
        image-rendering: pixelated;
        background-image: url("/static/favicon.ico");
        background-repeat: no-repeat;
        background-size: cover;
    }
}

.logo {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    background-image: url("/static/favicon.ico");
    background-repeat: no-repeat;
    background-size: cover;
}

#torrent-content {
    border: solid 1px;
    width: 800px;
}

.img-button {
    cursor: pointer;
}

button,
.button {
    user-select: none;
    font-size: 12px;
    background-color: var(--main-bg-color);
    border-radius: 10px;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-left: 5px;
    color: var(--highlight-fg-color);
    /* border:solid 1px white; */
    border: 1px solid var(--border-color);
    color: var(--main-fg-color);
    cursor: pointer;
}

button:hover,
.button:hover {
    background-color: var(--main-hover-color);
}

#deleteButton {
    float: right;
}

.button-big {
    font-size: large;
}

video {
    width: 100%;
}

iframe {
    width: 100%;
    /* display:none; */
}

.qrcode_image {
    background-color: var(--highlight-fg-color);
    padding: 10px;
}

#ids {
    font-size: xx-small;
}

#peer_display {
    width: 100%;
    height: 300px;
}

/* #compose {
    display: none;
    position: fixed;
    z-index: 100;
} */

#compose {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 5%;
    left: 50%;
    width: 88%;
    transform: translateX(-50%);

    max-height: 85vh;
    max-width: 600px;
    overflow-y: auto;

    background-color: var(--main-bg-color);
    z-index: 100;

    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
}

@media (pointer: coarse) {
    #compose {
        top: 0;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        box-sizing: border-box;
        overflow-y: hidden;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    #textarea_post {
        flex: 1;
        min-height: 0;
        height: auto;
        max-height: none;
        resize: none;
        border: none;
    }

    #textarea_post:focus {
        outline: none;
    }

    #compose-reply-area {
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0;
    }
}

#compose-reply-area {
    display: none;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.compose-reply-author {
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 2px;
}

.compose-reply-preview {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.compose-reply-preview-text {
    flex: 1;
    overflow: hidden;
    max-height: 80px;
}

.compose-reply-preview-text iframe {
    height: 68px;
    pointer-events: none;
}

.compose-reply-preview-image {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.show {
    display:block;
}

.username {
    color: var(--main-fg-color);
    text-decoration: none;
}

.username:hover {
    text-decoration: underline;
}

.nav-container {
    position: sticky;
    /* left: 0;  */
    top: 0;
    height: 100vh;
    background-color: var(--main-bg-color);
    /* border-right: 1px solid rgb(60, 60, 60); */
    /* transition: width 0.3s; */
    overflow: hidden;
    width: 130px;
    margin-right: 5px;
}

.nav-container.collapsed {
    width: 60px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--main-fg-color);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item.profile-pic {
    padding: 8px 6px;
}

.nav-item:hover {
    background-color: var(--edge-color);
}

.nav-emoji {
    font-size: 28px;
    min-width: 28px;
}

.nav-label {
    margin-left: 12px;
}

.burger-menu {
    user-select: none;
    text-align: center;
    width: 46px;
    border-radius: 10px;
    left: 8px;
    display: none;
    position: fixed;
    top: 0px;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    background: none;
    border: none;
    color: var(--main-fg-color);
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

@media (max-width: 700px) {
    .nav-container {
        display: none;
        /* transform: translateX(-100%); */
        z-index:10;
        user-select: none;
    }

    .nav-container.active {
        position: fixed;
        left: 0px;
        display: block;
        /* transform: translateX(0); */
        width: 200px;
    }

    .burger-menu {
        display: block;
        background-color: var(--main-bg-color);
    }

    .nav-overlay.active {
        display: block;
    }
}

@media (min-width: 701px) and (max-width: 800px) {
    .nav-container {
        width: 60px;
    }

    .nav-label {
        display: none;
    }
}

.profile-pic-container {
    width: 48px;
    height: 48px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

.small {
    width: 24px;
    height: 24px;
}

.profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emoji-fill {
    color: transparent;
    text-shadow: 0 0 0 var(--main-fg-color);
}

.compose-button {
    user-select: none;
    font-size: 42px;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    background: rgba(87, 87, 255, 0.5);
}

.compose-button:hover {
    background-color: rgb(87, 87, 255);
}

.status-bar {
    align-content: center;
    padding-left: 55px;
    font-size: 12px;
    height: 12px;
}

.spinner {
    display: inline-block;
    animation-name: spin;
    animation-duration: 2000ms;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    /* font-size: 64px; */
}

.no-scroll {
    overflow: hidden;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
        transform: none;
    }
}