body { font-family: Arial, sans-serif; }

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

button {
    margin-top: 10px;
    padding: 5px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .modal-content {
        margin: 50% auto;
        width: 80%;  /* Smaller width on smaller screens */
    }
    button {
        width: 100%;
        margin-top: 5px;
    }
}

@media (min-width: 601px) and (max-width: 1000px) {
    .modal-content {
        margin: 15% auto;
        width: 80%;  /* A bit larger on medium screens */
    }
}

@media (min-width: 1001px) {
    .modal-content {
        margin: 10% auto;
        width: 60%;  /* Optimal width on larger screens */
    }
}
