#context-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 10px;
    box-sizing: border-box;
    padding-bottom: calc(env(safe-area-inset-bottom) + 50px);
}
#context-menu-modal.active {
    opacity: 1;
    transform: translateY(0);
}
#context-menu-modal-content {
    color: #fff;
    background-color: #212121;
    border-radius: 5px;
    position: relative;
    max-width: 90vw;
    width: 94%;
    max-height: 70vh;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr; /* Single column */
    grid-template-rows: auto auto auto 1fr auto auto; /* Title, poster, release date, description, button1, button2 */
    gap: 10px;
    padding: 10px;
    max-width: 600px; /* Limit the width to 600px */
    transform: scale(0.95); /* Start slightly smaller */
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease; /* Custom cubic-bezier for the pop effect */
}
#context-menu-modal-content.pop {
    transform: scale(1);
    opacity: 1;
}
#context-menu-close {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
    opacity: .8;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s ease;
    z-index: 2;
    background: #848484;
    width: 40px;
    height: 40px;
    text-align: center;
    border-radius: 6px;
    align-content: center;
}
#context-menu-close:hover {
    opacity: 1;
}
#context-menu-modal h3 {
    margin: 0;
    padding: 0;
    text-align: left;
    grid-column: 1; /* Title in the first column */
}
#context-menu-modal .popup-movie-title {
    color: #fff;
    text-decoration: none;
}
#context-menu-modal .popup-movie-title:hover {
    text-decoration: underline;
}
#context-menu-modal img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    grid-row: 1; /* Poster in the second row */
    object-fit: cover;
    object-position: center;
    max-height: 200px; /* Smaller poster on small screens */
    transition: all .3s;
}
#context-menu-modal img:hover {
    transform: scale(0.96);
}
#context-menu-modal p {
    margin: 0;
    padding: 0;
    text-align: left;
    overflow-y: auto;
    max-height: 100%;
}
#context-menu-modal .release-date {
    grid-column: 1; /* Release date in the first column */
    grid-row: 2; /* Release date in the third row */
}
#context-menu-modal .description {
    grid-column: 1; /* Description in the first column */
    grid-row: 3; /* Description in the fourth row */
    max-height: 200px;
}
#context-menu-modal .buttons-container {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
    grid-column: 1; /* Buttons in the first column */
    grid-row: 5 / span 2; /* Buttons in the fifth and sixth rows */
}
#context-menu-modal button {
    background: #ffffff;
    border: none;
    color: #1e1e1e;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 5px;
    width: 100%;
    font-size: 16px;
}
#context-menu-modal button:hover:not(.watchlistButton) {
    background: #c9c9c9;
}
#context-menu-modal button.watchlistButton {
    background: #06ad00;
    color: #fff;
}
#context-menu-modal button.watchlistButton.active {
    background: red;
}
/* Media query for smaller screens */
@media (max-width: 500px) {
    #context-menu-modal-content {
        padding: 15px;
    }
}