/*---------------------------------*\
|                                   |
|           Theme Colours           |
|                                   |
\*---------------------------------*/
:root {
    --accent-col: #1e1e1e;
    --main-content-col: #262626;
    --font-col: #dadada;
    --highlight-col: #A88BFA;
    --form-col: #151515;
    --empty-col: #dadada;
    --link-col: #A88BFA;
    --link-hover-col: #725ea8;
    --link-click-col: #5031a7;
    --link-visited-col: #A88BFA;
    --form-input-background: #1e1e1e;
}

/*---------------------------------*\
|                                   |
|       Multi-section Styles        |
|                                   |
\*---------------------------------*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Helvetica, sans-serif;
    color: var(--font-col)
}

body {
    display: grid;
    grid-template-rows: max-content 1fr max-content;
    height: 100vh;
}

/* Remove arrows from form number inputs*/
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/*---------------------------------*\
|                                   |
|            Header Styles          |
|                                   |
\*---------------------------------*/
header {
    grid-row: 1 / 2;
    display: grid;
    grid-template-columns: 3fr 1fr;
    background-color: var(--accent-col);
    padding: 10px;
}

header .headerTitle {
    padding-left: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

header .headerTitle svg {
    font-size: 50px;
    height: 1.75em;
    width: 1.75em;
    fill: var(--highlight-col);
}

header .headerTitle h1 {
    display: inline-flex;
    align-items: center;
    font-size: 50px;
    grid-column: 1 / 2;
    color: var(--highlight-col);
    text-wrap: nowrap;
}

header .buttonContainer {
    grid-column: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buttonContainer > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 900;
    font-size: 50px;
    padding: 5px;
    height: 60px;
    width: 60px;
    border: 2px solid var(--link-click-col);
    cursor: pointer;
    background-color: var(--highlight-col);
    color: var(--accent-col);
}

.buttonContainer > button:hover {
    background-color: var(--link-hover-col);
}

.buttonContainer > button:active {
    background-color: var(--link-click-col);
}

/*---------------------------------*\
|                                   |
|        Page Content Styles        |
|                                   |
\*---------------------------------*/
.container {
    grid-row: 2 / 3;
    background-color: var(--main-content-col);
    color: var(--font-col);
    display: flex;
    justify-content: center;
    padding: 10px;
}

/* Table styles */
table {
    border-collapse: collapse;
    border: 2px solid (--font-col);
    letter-spacing: 1px;
    line-height: 1.5rem;
}

td, th {
    border: 1px solid var(--font-col);
    padding: 10px 20px;
    text-align: center;
}

td {
    text-align: center;
}

#bookReadStatus {
    font-size: 16px;
    height: 1.5em;
    width: 1.5em;
    border-radius: 8px;
}

.deleteBtn {
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    padding: 5px;
    background-color: var(--highlight-col);
    color: var(--accent-col);
    border: 2px solid var(--link-click-col);
}

.deleteBtn:hover {
    background-color: var(--link-hover-col);
}

.deleteBtn:active {
    background-color: var(--link-click-col);
}

/*---------------------------------*\
|                                   |
|           Dialog Styles           |
|                                   |
\*---------------------------------*/
dialog {
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    position: fixed;
    padding: 50px;
    border: 5px solid var(--highlight-col);
    background-color: var(--form-col);
}

form {
    display: grid;
    grid-template: repeat(6, max-content) / repeat(2, max-content);
    gap: 25px;
}

form h1 {
    grid-area: 1 / 1 / 2 / 3;
    font-size: 36px;
    font-weight: 700;
    padding-bottom: 20px;
    color: var(--highlight-col)
}

form div label {
    font-size: 20px;
    font-weight: 700;
}

form div input[type=text], form div input[type=number] {
    background-color: var(--form-input-background);
    border: 1px solid var(--font-col);
    font-size: 18px;
    line-height: 1.5em;
    padding: 5px;
}

form div input[type=number] {
    width: 6ch;
}

#titleInput {
    grid-area: 2 / 1 / 3 / 3;
    display: grid;
    grid-template-rows: max-content max-content;
}

#titleInput label:after {
    content: "*";
    color: var(--font-col);
}

#authorInput {
    grid-area: 3 / 1 / 4 / 3;
    display: grid;
    grid-template-rows: max-content max-content;
}

#authorInput label:after {
    content: "*";
    color: var(--font-col);
}

#pageCountInput {
    grid-area: 4 / 1 / 5 / 2;
}

#pageCountInput label:after {
    content: "*";
    color: var(--font-col);
}

#readStatusInput {
    grid-area: 4 / 2 / 5 / 3;
    display: flex;
    gap: 10px;
    align-items: center;
}

#readStatusInput input[type=checkbox] {
    font-size: 18px;
    height: 1.5em;
    width: 1.5em;
    border-radius: 8px;
}

#ratingInput {
    grid-area: 5 / 1 / 6 / 3;
}

#ratingInput p {
    font-size: 18px;
    font-weight: 700;
}

#inputBtns {
    grid-area: 6 / 1 / 7 / 3;
    display: flex;
    gap: 20px;
}

#inputBtns button {
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
    padding: 10px;
    background-color: var(--highlight-col);
    color: var(--accent-col);
    border: 2px solid var(--link-click-col);
}

#inputBtns button:hover {
    background-color: var(--link-hover-col);
}

#inputBtns button:active {
    background-color: var(--link-click-col);
}

/*---------------------------------*\
|                                   |
|           Footer Styles           |
|                                   |
\*---------------------------------*/
footer {
    grid-row: 3 / 4;
    background-color: var(--accent-col);
    padding: 10px;
}

footer p {
    display: flex;
    justify-content: center;
}

footer a {
    text-decoration: none;
    color: var(--link-col);
}

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

footer a:hover {
    color: var(--link-hover-col);
}

footer a:active {
    color: var(--link-click-col);
}

/*---------------------------------*\
|                                   |
|     Custom Star Rating Styles     |
|                                   |
\*---------------------------------*/
#ratingDiv {
    display: in-line-block;
    position: relative;
    height: 50px;
    line-height: 50px;
}

#ratingDiv label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    cursor: pointer;
}

#ratingDiv label:last-child {
    position: static;
}

#ratingDiv label:nth-child(1) {
    z-index: 5;
}

#ratingDiv label:nth-child(2) {
    z-index: 4;
}

#ratingDiv label:nth-child(3) {
    z-index: 3;
}

#ratingDiv label:nth-child(4) {
    z-index: 2;
}

#ratingDiv label:nth-child(5) {
    z-index: 1;
}

#ratingDiv label input {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

#ratingDiv label .icon {
    float: left;
    color: transparent;
    font-size: 50px;
  }
  
#ratingDiv label:last-child .icon {
    color: var(--empty-col);
}

#ratingDiv:not(:hover) label input:checked ~ .icon,
#ratingDiv:hover label:hover input ~ .icon {
  color: var(--highlight-col);
}

#ratingDiv label input:focus:not(:checked) ~ .icon:last-child {
  color: var(--empty-col);
  text-shadow: 0 0 5px var(--highlight-col);
}