body {
    margin: 0;
    padding: 0;
    overflow: hidden; 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8); 
    position: relative; 
}

#viewer {
    position: absolute; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%; 
    z-index: 1; 
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7); 
    display: none; 
    z-index: 999; 
    overflow: hidden; /* اضافه شده */
}

#imagePanel {
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    display: none; 
    padding: 0; 
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 95vw; 
    max-height: 95vh; 
    box-sizing: border-box; 
    overflow: hidden; 
    cursor: zoom-in;
}


#imagePanel img {
    width: auto; 
    height: auto; 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    display: block;
    margin: 0 auto; 
}


#closeButton {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    z-index: 1001; 
}
#prevButton, #nextButton {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    z-index: 1000;
}
#prevButton {
    left: 10px;
}
#nextButton {
    right: 10px;
}
