:root {
    line-height: 1.5;
    --bg-darker-color: rgba(25, 25, 25, 0.975);
    --bg-alt-color: rgba(59, 59, 72, 0.619);
    --highlight-color: rgba(98, 97, 97, 0.395);
    --green: rgb(38, 163, 38);
}
  
h1, h2, h3, h4, h5, figure, p, ol, ul {
    margin: 0;
}
  
ol[role="list"], ul[role="list"] {
    list-style: none;
    padding-inline: 0;
}
  
h1, h2, h3, h4, h5 {
    font-size: inherit;
    font-weight: inherit;
}

img {
    display: block;
    max-inline-size: 100%;
    width: 50px;
    filter: invert(100%) brightness(1000%);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 
        'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 
        'Helvetica Neue', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.874);
}

header {
    background-color: var(--bg-alt-color);
    width: 100%;
    display: flex;
    gap: 15px;
    padding: 10px max(2rem, 50vw - 200px / 2);
}

h1 {
    line-height: 50px;
    font-size: 1.5rem;
    font-weight: 600;
}

main {
    width: clamp(60ch, 75%, 90ch);
}

dialog {
    width: clamp(45ch, 50%, 75ch);
    color: white;
    background-color: var(--bg-darker-color);  
    border: none;
    border-radius: 10px;
}

dialog p {
    font-size: 1.15rem;
    font-weight: 500;
}

.form-body {
    display: grid;
    grid-template-columns: max-content auto;
    gap: 10px 15px;
    margin: 10px 20px;
}

label {
    font-weight: 450;
}

dialog input {
    padding: 0.3rem;
    color: white;
    background-color: var(--highlight-color);
    border-style: none;
    border-radius: 5px;
    border-bottom: 2px solid white;
}

dialog input:focus {
    outline: none;
    border-bottom: 2px solid rgb(0, 132, 255);
}

#book-pages {
    justify-self: start;
    width: 9ch;
}

#book-read {
    justify-self: start;
    align-self: center;
    width: 20px;
    height: 20px;
}

.form-submit {
    display: flex;
    justify-content: space-between;
}

.form-submit button {
    color: white;
    padding: 5px 8px;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}

#cancel {
    background-color: red;
}

#cancel:hover {
    color: red;
    background-color: white;
}

#confirm {
    background-color: var(--green);
}

#confirm:hover {
    color: var(--green);
    background-color: white;
}

.table-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -35vh;
}

h2 {
    line-height: 50px;
    font-size: 1.5rem;
    font-weight: 500;
}

#add-book {
    padding: 7px 12px;
    color: white;
    background-color: var(--highlight-color);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

#add-book:hover {
    color: var(--bg-darker-color);
    background-color: white;
}

table {
    width: 100%;
    border-spacing: 2px;
    font-size: 1.1rem;
}

th, td {
    border-radius: 3px;
    padding: 0.3rem;
    height: 36px;
}

thead {
    background-color: rgba(126, 121, 121, 0.489);
}

th:nth-child(1), th:nth-child(2) {
    width: 35%;
}

th:nth-child(3), th:nth-child(4), th:nth-child(5) {
    width: 10%;
}

tbody {
    background-color: var(--highlight-color);
}

td:nth-child(3) {
    text-align: right;
}

td:nth-child(4) {
    text-align: center;
}

td:nth-child(5) {
    text-align: center;
    padding: 0;
}

td > input {
    width: 18px;
    height: 18px;
}

td > button {
    width: 90%;
    padding: 3px 5px; 
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    vertical-align: text-bottom;
}

td > button:hover {
    background-color: red;
    color: white;
}

footer {
    background-color: var(--bg-alt-color);
    width: 100%;
    padding: 3px max(2rem, 50vw - 200px / 2);
    font-size: 0.9rem;
}