:root {
    --body-background: #14151b;
    --primary: #1f2129;
    --nav: #18191f;
    --text-primary: #b6bccc;
    --text-secondary: #c6cee2;
    --icons-color: brightness(0) saturate(100%) invert(80%) sepia(12%) saturate(302%) hue-rotate(184deg) brightness(99%) contrast(97%);
}

* {
    font-family: var(--default-font);
    margin: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
    width: 100%;
    background-color: var(--body-background);
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-secondary);
}

.main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.orv_main h1 {
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin: 1rem 0;
    line-height: 1.2;
    font-weight: bold;
}

.orv_main {
    width: min(100%, 800px);
    margin: 0 auto;
    background-color: var(--primary);
    color: var(--text-primary);
    padding: 1rem;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}


/* This is for the images */
.orv_image {
    margin-top: var(--paragraph-space);
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    padding-left: 0.25em;
    padding-right: 0.25em;
}

.orv_image img {
    display: block;
    max-height: 90vh; 
    width: auto;
    height: auto;
    max-width: 100%;
}

.orv_cover {
    background-color: var(--primary);
    display: flex;
    justify-content: center;
    width: min(100%, 800px);
}

.orv_cover img {
    padding: 2vh;
    width: auto;
    height: min(90vh, 130vw);
}

.title_mobile {
    background-color: var(--primary);
    display: flex;
    justify-content: center;
    width: min(100%, 800px);
}

.title_mobile img {
    padding: 2vh;
    width: auto;
    height: clamp(70px, 20vh, min(200px, 90vw));
}

/* This is for the navbar */
.menu {
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: end;
    align-content: center;
    background-color: var(--nav);
    width: 100%;
    height: fit-content;
    position: static;
}

.menu a:first-child {
    margin-right: auto;
}

.menu a {
    margin: 1vh clamp(0px, 1vw, 20px);
    transition-duration: 250ms;
    display: flex;
    align-content: center;
    padding: min(1vw, 5px);
}

.menu a:hover {
    transform: scale(1.2);
    transition: transform 500ms;
}

.menu a svg {
    height: clamp(35px, 4vh, 70px);
    width: auto;
    filter: var(--icons-color);
    scale: 0.8;
}


/* for the comments */

.giscus {
    position: relative;
    top: 5vh;
    max-width: clamp(100px, 90%, 900px);
}

/* For chapters */

.chapters,
.settings,
.download,
.edit {
    background-color: var(--primary);
    display: none;
    z-index: 5;
    position: fixed;
    right: 0;
    top: 0;
    height: 100dvh;
    width: min(600px, 100%);
    box-shadow: -12px 2px 20px 0px rgba(0, 0, 0, 0.75);
}

.close-chapters-btn,
.close-settings-btn,
.close-download-btn,
.close-edit-btn {
    position: fixed;
    top: 0px;
    display: flex;
    width: min(3vw, 30px);
    width: min(3vw, 30px);
    justify-content: center;
    align-items: center;
    padding: 0.5em 1em;
    font-size: 30px;
}

.chapters {
    overflow-y: auto;
}

.search_reasult {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    width: 100%;
}

.chapters input {
    position: sticky;
    top: 2em;
    margin: 2em;
    padding: 1em 2em;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.chapters input::placeholder {
    font-weight: bold;
    color: gray;
}


.chapter_item {
    border-radius: 0.5em;
    border: var(--text-primary) 0.1em solid;
    color: var(--text-primary);
    text-align: center;
    margin: 0.5em;
    width: min(400px, 90%);
    align-self: center;
    text-wrap: wrap;
}

.chapter_item p {
    padding: 0.5em;
}

#current-chapter {
    background-color: var(--text-primary);
    color: var(--primary);
}

.chapters a,
.chapters a:link,
.chapters a:visited,
.chapters a:hover,
.chapters a:active,
.chapters a:focus {
    all: unset;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: inline;
}

/* This is for settings */

.settings {
    overflow-y: auto;
}

.setting_items {
    margin-top: 6vh;
}

.setting_item {
    padding: 0.75em;
}

.setting_reset {
    position: fixed;
    top: 1em;
    right: 1em;
}

.setting_item input,
select {
    float: right;
    height: min(25px, 10vh);
    width: min(150px, 25vw);
}

.setting_item select{
    backdrop-filter: brightness(0) invert(100%);
}

.setting_item input[type="text"] {
    backdrop-filter: brightness(0) invert(100%);
}

/* for download tab */

.download {
    display: none;
    flex-direction: column;
    align-content: center;
    justify-content: center;
}

.download h1,
button {
    text-align: center;
    padding: 1em;
    font-size: large;
    margin: 2vh auto;
    width: min(300px, 90%);
}

.download a {
    margin-left: auto;
    margin-right: auto;
    text-decoration: none;
    color: black;
    width: min(300px, 90%);
}

.download a button {
    width: 100%;
}

/* for edit tab */

.edit {
    display: none;
    flex-direction: column;
    align-content: center;
    justify-content: center;
}

.edit h1,
button {
    text-align: center;
    padding: 1em;
    font-size: large;
    margin: 2vh auto;
    width: min(300px, 90%);
}

.edit a {
    margin-left: auto;
    margin-right: auto;
    text-decoration: none;
    color: black;
    width: min(300px, 90%);
}

.edit a button {
    width: 100%;
}

.edit a,
.edit a:link,
.edit a:visited,
.edit a:hover,
.edit a:active,
.edit a:focus {
    text-decoration: none;
    color: black;
}

/* Navigation button */

.change-ch {
    width: min(100%, 800px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
    /* Adjust padding as needed */
    background-color: var(--primary);
}

.change-ch a {
    display: flex;
    align-items: center;
    color: #e3e3e3;
    text-decoration: none;
    font-size: 16px;
    /* Adjust font size as needed */
}

.change-ch a,
.change-ch svg{
    margin: 0 5px;
    filter: var(--icons-color);
}

.change-ch a:hover {
    text-decoration: underline;
    /* Optional: Underline on hover */
}

/* ads */

.evadav {
    width: min(100%, 800px);
    height: auto;
    height: auto;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* for print */

@media print {

    /* Hide non-essential elements for printing */
    .menu,
    .giscus,
    .chapters,
    .settings,
    .download,
    .edit,
    .evadav,
    .change-ch {
        display: none !important;
    }

    /* Ensure main content takes full width */
    .orv_main,
    .orv_cover,
    .title_mobile {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Adjust images for better print layout */
    .orv_image img,
    .orv_cover img,
    .title_mobile img {
        max-width: 100%;
        height: auto;
    }
}
