body.modal-open {
    overflow: hidden;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.4);
    padding: 20px 0;
}

.modal-content {
    background-color: var(--background-dark);
    margin: auto; 
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%; 
    max-width: 600px;
    border-radius: 8px;
    position: fixed; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box; 
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: var(--light-text);
    font-weight: bold;
    font-size: 18px;
    transition: 0.3s;
    user-select: none;
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.next {
    right: 0;
    border-radius: 0 3px 3px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.close {
    color: var(--light-text);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-body img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-position: top;
}

.modal-body h3 {
    margin-top: 0;
    text-align: center;
    color: var(--light-text);
}

.modal-body p {
    text-align: center; 
    margin-top: 0.5rem; 
    color: var(--light-text);
}

.modal-body a {
    display: block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    text-align: center; 
}

.modal-body a:hover {
    text-decoration: underline;
}

#modalBio {
    max-height: 200px; 
    overflow-y: auto;
    padding: 10px; 
    text-align: left;
    color: var(--light-text);
    overflow-y: scroll;
}

#modalBio p {
    text-align: left; 
}

/* Media Queries for smaller screens */
@media (max-width: 768px) {
    .modal-content {
        width: 95%; 
        padding: 15px; 
    }

    .modal-body img {
        width: 100%;
        max-width: 250px; 
    }

    .close {
        font-size: 24px; 
    }
}