.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Mobile friendly: pops up from bottom */
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal-body {
    padding: 10px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-list-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    font-size: 1.1rem;
    color: #333;
    transition: background 0.2s;
    text-align: center;
}

.modal-list-item:hover {
    background: #f0f0f0;
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
        /* Center on desktop */
    }

    .modal-content {
        border-radius: 12px;
        transform: scale(0.9);
        height: auto;
    }

    .modal-overlay.show .modal-content {
        transform: scale(1);
    }
}
