/* Ensure modal background fades smoothly too */
/* Modal overlay */
/* Modal overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scrolling if content is too tall */
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show modal with fade-in */
.modal.show {
    display: block;
    opacity: 1;
}

/* Modal content */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 2em;
    border-radius: 10px;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    position: relative;
    animation: fadeIn 0.3s ease;
}

/* Close button */
.modal .close {
    color: #333;
    position: absolute;
    top: 1em;
    right: 1em;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}


