html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "M PLUS 1", sans-serif;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#title {
    text-align: center;
    padding: 20px 0;
    background-color: #f8f8f8;
}

#title h1 {
    font-size: 2.2em;
    margin: 0;
    color: #333; /* Neutral dark color */
}

#tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #f8f8f8;
}

.tab {
    padding: 10px 25px;
    min-width: 100px;
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    color: white;
    position: relative;
}

.content {
    padding: 20px;
    transition: background-color 0.5s, color 0.5s;
    flex-grow: 1;
    overflow: auto;
}

/* Character descirptions */
.character-description {
    margin: 20px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

.character-description h2 {
    font-size: 24px;
    color: #333;
}

.character-description p {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}

/* Base styles for the gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-gap: 20px;
    justify-items: center;
    margin: 48px;
    flex-grow: 1;
}

/* Styles for thumbnails */
.thumbnail-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 20px;
}

.thumbnail-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid;
    border-color: white;
    border-radius: 20px;
    transition: all 0.3s ease-in-out;
    box-sizing: border-box;
    z-index: 1;
}

.thumbnail-container:hover::before {
    border-width: 10px;
}

.thumbnail-container:hover {
    cursor: pointer;
}

.thumbnail-container canvas {
    display: block;
    width: 100%;
    height: auto;
    z-index: 0;
    transition: all 0.3s ease-in-out;
}

.thumbnail-container:hover canvas {
    scale: 1.1;
}

.thumbnail-artist {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 10px;
    z-index: 2;
    pointer-events: none;
}

#modal {
    display: none; /* Hide modal by default */
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
    justify-content: center;
    align-items: center;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.modal-content {
    background-color: transparent;
    padding: 0;
    max-width: 90%;
    overflow: hidden; /* Prevent scrolling of the image */
    pointer-events: auto; /* enable pointer events for the modal content */
    animation: zoom 0.5s;
}

.modal-content .carousel {
    position: relative;
    max-width: 100%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modal-content .carousel #modal-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    margin-bottom: 20px;
    border: 4px solid;
    border-radius: 20px;
    padding: 0;
}

.modal-content .carousel .preview {
    position: relative;
    width: 100px;
    height: 100px;
    background-color: black;
    background-size: cover;
    background-position: center;
    border: 4px solid;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    margin: 0 10px; /* Add margin to position previews */
    visibility: visible;
    pointer-events: auto;
}

.modal-content .carousel .preview.left {
    order: -1;
}

.modal-content .carousel .preview.right {
    order: 1;
}

.modal-content .artist-info {
    color: #eee;
    text-align: center;
    font-size: 18px;
    font-weight: 400;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content .artist-info:hover {
    cursor: default;
}
