body {
    background-color: #121212;
    color: white;
    font-family: sans-serif;
    margin-top: 60px; /* Adjust margin to match new header height */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0em 1em;
    z-index: 2;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    padding-right: 30px;

}

#about-link {
    color: white;
    text-decoration: none;
}

#about-modal .about-content {
    background-color: #1e1e1e;
    padding: 2em;
    border-radius: 5px;
    max-width: 500px;
    margin: 15% auto;
}

#about-modal a {
    color: #4a90e2;
}

.header-container h1 {
    font-size: 1.2em;
}

.cross {
    margin-right: 10px;
}

.cross-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem; /* 20px */
    text-decoration: none;
}

.cross-icon > div {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5; /* neutral-200 */
    background: #fff;
    height: 40px;
    width: 40px;
    border-radius: 0.75rem; /* 12px */
}

#search-input {
    padding: 0.5em 0.5em 0.5em 1em; /* Add padding to the left */
    border-radius: 5px;
    border: none;
}

#gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 10px;
    grid-gap: 10px;
}

.gallery-item {
    background-color: #1e1e1e;
    cursor: pointer;
}

.gallery-item .placeholder {
    background-color: #2a2a2a;
    height: 300px; /* Adjust as needed */
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item img {
    width: 100%;
    height: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 3; /* Ensure modal is on top of the header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content-container {
    height: 100%;
    overflow: auto; /* Allow scrolling when content overflows */
    position: relative;
}

#modal-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.modal-open {
    overflow: hidden;
}

.modal-content {
    max-width: 80%;
    max-height: 80%;
    transition: opacity 0.3s ease-in-out;
}

.fade-in {
    opacity: 1;
}

.fade-out {
    opacity: 0;
}

.slide-in {
    transform: translateX(0) !important;
}

.slide-out-left {
    transform: translateX(-150%) !important;
}

.slide-out-right {
    transform: translateX(150%) !important;
}

#modal-thumbnails {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px;
    text-align: center;
    white-space: nowrap;
    overflow-x: auto;
    z-index: 4; /* Ensure thumbnails are on top of other modal content */
}

.thumbnail {
    width: 80px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    margin: 0 5px;
    display: inline-block;
}

.thumbnail.active {
    border-color: #fff;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

#modal-book-name {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #f1f1f1;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 5;
    text-align: center;
    max-width: 70%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.download-button {
    position: absolute;
    top: 20px;
    right: 80px;
    color: #f1f1f1;
    font-size: 30px;
    font-weight: bold;
    transition: 0.3s;
    text-decoration: none;
}

.close-about {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close-about:hover,
.close-about:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}
