@import url('fonts.css');


/* ---- CSS RESET/MY DEFAULTS ---- */
*, *::before, *::after {
    box-sizing: border-box;
}
* {
    margin: 0;
}
body {
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}
input, button, textarea, select {
    font: inherit;
    font-size: 100%;
}
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}
#root, #__next {
    isolation: isolate;
}
ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}
a {
    color: inherit;
    text-decoration: none;
}


/* OPTIONAL UTILITY CLASSES */
.hidden {
    visibility: hidden;
}


/* COLOR VARIABLES */
:root {
    --primary-dark: #273c40;
    --primary-light: #b6c2c6;
    --primary-light-alt: #c1ced2;
    --highlight-bg: rgba(31, 41, 52, 0.381);
    --danger: #a21d24;
}


/* LAYOUT */
.page-container {
    position: relative;
    min-height: 100vh;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 48px auto minmax(auto, 2fr) 36px;
    grid-template-areas:
        "nav"
        "header"
        "main"
        "footer";
    gap: 1em;
}
.nav-container {
    width: 100%;
    position: sticky;
    padding: 0 0 0 0.5em;
    left: 0;
    top: 0;
    z-index: 2;
    grid-area: nav;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}
.nav-container>a {
    color: var(--primary-dark);
}
.header-container {
    grid-area: header;
}
.body {
    grid-area: main;
    height: auto;
}

.books-container {
    position: relative;
    padding: 1em;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-template-rows: auto;
    gap: 1em;
    justify-content: center;
}


/* ---- GENERAL STYLING ---- */
body {
    font-family: 'glacial-indifference', sans-serif;
    font-size: 16px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
}
h1, h2, h3, h4 {
    color: var(--primary-dark);
}
hr {
    width: 100%;
    border: 1px solid var(--primary-light-alt);
    margin: 1em 0;
}


/* ---- BUTTONS ---- */
button {
    padding: 0.2em 1.5em;
    border: 1px solid var(--primary-dark);
    border-radius: 16px;
    color: var(--primary-dark);
    background-color: transparent;
    font-size: 0.8em;
    transition: 250ms;
    cursor: pointer;
}
button:hover {
    color: var(--primary-light);
    background-color: var(--primary-dark);
    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.196);
    transform: scale(1.05);
}
button:active {
    color: var(--primary-light);
    box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.444);
    transform: scale(0.95);
}

.link-1 {
    color: var(--primary-dark);
    transition: 250ms;
}
.link-1:hover {
    color: var(--primary-light);
    background: var(--highlight-bg);
}


/* ---- NAVIGATION ---- */
.scrolled-bg {
    background-color: var(--primary-dark);
}
.scrolled-link {
    color: var(--primary-light);
}
.nav {
    width: 100%;
    padding: 0.5em 1em;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8%;
    color: var(--primary-dark);
    background-color: rgba(0, 0, 0, 0);
}
.nav-hero-div {
    display: flex;
    align-items: flex-end;
    cursor: pointer;
}
.nav-hero-div>p{
    margin: 0;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-dark);
}
.nav-logo {
    height: 40px;
    width: 40px;
    object-fit: cover;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 1em;
}
.avatar-box {
    height: 42px;
    width: 42px;
    border-radius: 50%;
    overflow: hidden;
    transition: 250ms;
    cursor: pointer;
}
.avatar-box:hover {
    transform: scale(1.1);
}
.avatar {
    height: 100%;
    width: 100%;
    object-fit: cover;
}


/* ---- HEADER SECTION ---- */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}
.header-title-div {
    display: flex;
    align-items: flex-end;
}
.header-title-div>* {
    transition: 250ms;
}
.header-image {
    width: 120px;
}


/* ---- MAIN CONTENT ---- */
/* Book Cards - Cover/Info */
.book-box {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.book-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(-100%);
    transition: transform 250ms ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2%;
    color: white;
    background-color: rgba(15, 33, 43, 0.763);
    font-size: 1em;
    text-align: center;
}
.book-info h2 {
    color: white;
}
.author {
    font-weight: bold;
}

.toggle-read-btn, 
.remove-btn {
    border: 1px solid var(--primary-light);
    color: var(--primary-light);
}
.toggle-read-btn:hover {
    font-weight: bold;
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
    background-color: var(--primary-light);
}
.remove-btn:hover,
.cancel-button:hover {
    font-weight: bold;
    border: 1px solid var(--danger);
    background-color: var(--danger);
}

/* Add Book Form */
.add-book-div {
    width: 100%;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
}
.add-book-form {
    display: none; /* Displayed with JS */
    width: 300px;
    padding: 1em;
    border-radius: 8px;
    flex-direction: column;
    gap: 1em;
    text-align: left;
    background-color: rgba(245, 245, 245, 0.763);
}
label {
    font-size: 0.8em;
}
.add-book-form label {
    margin-bottom: -1em;
}
input[type="file"] {
    display: none;
}
#cover-label {
    margin-bottom: 0.5em;
    font-size: 0.8em;
    color: var(--primary-dark);
    cursor: pointer;
}
#cover-label:hover {
    font-weight: bold;
}
.btn-box {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}
input {
    font-size: 0.8em;
    padding: 0.5em;
    border-radius: 6px;
    border: none;
}
input:active,
input:focus {
    outline: 1px solid white;
    border: 2px solid var(--primary-dark);
}
input::placeholder {
    color: var(--primary-light);
}
.read-container {
    /* Checkbox parent div */
    position: relative;
    height: auto;
    display: flex;
    align-items: flex-start;
    gap: 1em;
}
input[type="checkbox"] {
    outline: none;
    accent-color: var(--primary-dark);
}

/* Cover Thumbnail */
.thumbnail-container {
    align-self: center;
    display: none;
    justify-content: center;
    width: 50%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
}
#cover-label {
    align-self: center;
}
.thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px; 
}

/* ---- FOOTER ---- */
.footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 0.8em;
}
.footer-content { 
    cursor: pointer;
}
.footer-content:hover {
    padding: 0 2em;
}
.footer-content:hover > .footer-p {
    display: none;
}
.footer-content:hover > .github-logo {
    display: block;
}
.footer-p,
.github-logo {
    transition: 250ms;
}
.github-logo {
    display: none;
    height: 24px;
}




/* ---- RELATED APPS PAGE ---- */
.apps-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2em;
}
.related-apps-p {
    width: 66vw;
    text-align: center;
    font-size: 1rem;
}
.related-app-container {
    padding: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1em;
    border-radius: 8px;
}
.related-app-container>p {
    width: 66vw;
    text-align: center;
}
.app-image-div {
    position: relative;
    width: 49.5vw;
    border-radius: 8px;
}
.app-image-div>img {
    width: 100%;
    border-radius: 8px;
}

/* YT Link Hover */
.youtube-hover-div {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    opacity: 0;
    background-color: #3d5a60cc;
    transition: 1000ms;
}
.app-image-div:hover > .youtube-hover-div {
    opacity: 1;
}
.yt-svg-container {
    display: flex;
    gap: 1em;
}
.yt-svg-container>svg {
    height: 50px;
    width: auto;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
}


/* ---- ABOUT PAGE ---- */
.about-body {
    text-align: center;
}
.about-body p {
    width: 66vw;
    margin: 0 auto;
    font-size: 1rem;
}
.about-link:hover {
    background-color: var(--highlight-bg);
    color: var(--primary-light);
}




/* ---- MEDIA QUERIES ---- */
@media screen and (max-width: 800px) {
    .nav-hero-div>p {
        display: none;
    }
    .header-image {
        width: 90px !important;
    }
    .header-title-div>h1 {
        font-size: 48px !important;
    }
    .app-image-div {
        width: 80vw;
    }
    .related-apps-p,
    .related-app-container>p,
    .about-body p,
    .about-body a  {
        width: 80vw;
        font-size: 0.8rem;
    }
}

@media screen and (max-width: 600px) {
    .nav {
        gap: 4%;
    }
    .nav>li {
        font-size: 0.8em;
    }
    .avatar-box {
        height: 36px;
        width: 36px;
    }
    .nav-logo {
        height: 36px;
        width: 36px;
    }
    .header {
        font-size: 1.2em;
    }
    .header-image {
        width: 60px !important;
    }
    
    .header-title-div>h1 {
        font-size: 36px !important;
    }
    .books-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .book-info {
        font-size: 0.8em;
    }
}

@media screen and (max-width: 400px) {
    .header {
        font-size: 1em;
    }
    .header-image {
        width: 45px !important;
    }
    .header-title-div>h1 {
        font-size: 28px !important;
    }
}